-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathinfo.plist
130 lines (119 loc) · 2.92 KB
/
info.plist
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>bundleid</key>
<string>li.zhu.alfred.gitlabproject</string>
<key>connections</key>
<dict>
<key>63F60794-BB56-4415-9372-BAF974C3A7E1</key>
<array>
<dict>
<key>destinationuid</key>
<string>2A7AEA9A-9C99-469D-A4E5-A4B4C951F050</string>
<key>modifiers</key>
<integer>0</integer>
<key>modifiersubtext</key>
<string></string>
</dict>
</array>
</dict>
<key>createdby</key>
<string>Leigh Zhu</string>
<key>description</key>
<string>Search GitLab project</string>
<key>disabled</key>
<false/>
<key>name</key>
<string>GitLab Projects</string>
<key>objects</key>
<array>
<dict>
<key>config</key>
<dict>
<key>plusspaces</key>
<false/>
<key>url</key>
<string>{query}</string>
<key>utf8</key>
<true/>
</dict>
<key>type</key>
<string>alfred.workflow.action.openurl</string>
<key>uid</key>
<string>2A7AEA9A-9C99-469D-A4E5-A4B4C951F050</string>
<key>version</key>
<integer>0</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>argumenttype</key>
<integer>0</integer>
<key>escaping</key>
<integer>36</integer>
<key>keyword</key>
<string>gl</string>
<key>runningsubtext</key>
<string>Retrieving search suggestions ...</string>
<key>script</key>
<string>
// your private token
$token = '';
// your gitlab's url
$gitlab = '';
$options = array(
CURLOPT_HTTPHEADER => array('PRIVATE-TOKEN: '.$token)
);
$query = urlencode( "{query}" );
require_once('workflows.php');
$url = $gitlab.'/api/v3/projects/search/'.$query;
$wf = new Workflows();
$int = 1;
$data = $wf->request( $url, $options);
$repos = json_decode($data);
if(count($repos) > 0) {
for( $i=0; $i<count($repos); $i++) {
$item = $repos[$i];
$icon = "icon.png";
$wf->result( $int++.'.'.time(), $item->web_url , $item->path_with_namespace, "", $icon );
}
}
echo $wf->toxml();</string>
<key>subtext</key>
<string>Search Projects on your GitLab</string>
<key>title</key>
<string>Search GitLab</string>
<key>type</key>
<integer>1</integer>
<key>withspace</key>
<true/>
</dict>
<key>type</key>
<string>alfred.workflow.input.scriptfilter</string>
<key>uid</key>
<string>63F60794-BB56-4415-9372-BAF974C3A7E1</string>
<key>version</key>
<integer>0</integer>
</dict>
</array>
<key>readme</key>
<string>You should change the token to yours.
Change the token in the ‘script fliter’</string>
<key>uidata</key>
<dict>
<key>2A7AEA9A-9C99-469D-A4E5-A4B4C951F050</key>
<dict>
<key>ypos</key>
<real>10</real>
</dict>
<key>63F60794-BB56-4415-9372-BAF974C3A7E1</key>
<dict>
<key>ypos</key>
<real>20</real>
</dict>
</dict>
<key>webaddress</key>
<string>zhu.li</string>
</dict>
</plist>