Skip to content

Commit c345d26

Browse files
committed
fixed #4
1 parent eef7f06 commit c345d26

2 files changed

Lines changed: 19 additions & 42 deletions

File tree

README.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,27 +23,27 @@ Alfred search suggest workflow for various popular websites. Inspired by the off
2323

2424
### Google
2525

26-
Support basic suggestions. Proxy settings are available in the workflow environment variables.
26+
Support basic suggestions. [Proxy setting](#proxy-setting) is available in the workflow environment variables.
2727

2828
![google](screenshots/google.png)
2929

3030
### Wikipedia
3131

32-
Support direct term suggestions and preview, language can be specified with [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) code in the first arg. Proxy settings are available in the workflow environment variables.
32+
Support direct term suggestions and preview, language can be specified with [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) code in the first arg. [Proxy setting](#proxy-setting) is available in the workflow environment variables.
3333

3434
![wikipedia-en](screenshots/wikipedia-en.png)
3535

3636
![wikipedia-zh](screenshots/wikipedia-zh.png)
3737

3838
### Wolfram|Alpha
3939

40-
Support direct term suggestions. Proxy settings are available in the workflow environment variables.
40+
Support direct term suggestions. [Proxy setting](#proxy-setting) is available in the workflow environment variables.
4141

4242
![wolframalpha](screenshots/wolframalpha.png)
4343

4444
### Pixiv
4545

46-
Support basic suggestions. Proxy settings are available in the workflow environment variables.
46+
Support basic suggestions. [Proxy setting](#proxy-setting) is available in the workflow environment variables.
4747

4848
![pixiv](screenshots/pixiv.png)
4949

@@ -87,7 +87,7 @@ Support basic suggestions.
8787

8888
Support direct term suggestions and preview, type can be specified in the first arg.
8989

90-
注:共支持 6 种条目类型的搜索,分别为全部(all)、动画(anime)、书籍(book)、音乐(music)、游戏(game)、三次元(real);对于每一条搜索结果,副标题默认显示该条目的类型(如果当前搜索类型为全部)和中文名称(若有),按 可显示其简介(若有),按 可显示其排名与评分(若有)。
90+
注:共支持 6 种条目类型的搜索,分别为全部(all)、动画(anime)、书籍(book)、音乐(music)、游戏(game)、三次元(real);对于每一条搜索结果,副标题默认显示该条目的类型(如果当前搜索类型为全部)和中文名称(若有),按 **** 可显示其简介(若有),按 **** 可显示其排名与评分(若有)。
9191

9292
![bangumi-all](screenshots/bangumi-all.png)
9393

@@ -118,12 +118,11 @@ If you want an alternative to search exactly what you typed, you can add custom
118118
* Bangumi: `http://bangumi.tv/subject_search/{query}`
119119
* Moegirlpedia: `https://zh.moegirl.org/?search={query}`
120120

121-
### Proxy Settings
121+
### Proxy Setting
122122

123-
Proxy settings are avaliable in the workflow environment variables, here's an example setting:
123+
Proxy setting is avaliable in the workflow environment variables as `proxy`, here's some example settings:
124124

125-
```text
126-
proxy_address: 127.0.0.1
127-
proxy_port: 1087
128-
proxy_type: CURLPROXY_HTTP // or CURLPROXY_SOCKS5 if you use a Socks5 proxy
129-
```
125+
* If you use an HTTP proxy at `127.0.0.1:1087` without credentials, set `proxy` to `http://127.0.0.1:1087`
126+
* If you use a SOCKS5 proxy at `127.0.0.1:1086` with username `user` and password `pass`, set `proxy` to `socks5://user:pass@127.0.0.1:1086`
127+
128+
For more details, check the [libcurl doc](https://curl.haxx.se/libcurl/c/CURLOPT_PROXY.html).

src/info.plist

Lines changed: 8 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,7 @@
202202
<string>Retrieving search suggestions ...</string>
203203
<key>script</key>
204204
<string>$query = "{query}";
205-
$opt = array(
206-
CURLOPT_PROXYTYPE =&gt; getenv('proxy_type'),
207-
CURLOPT_PROXY =&gt; getenv('proxy_address'),
208-
CURLOPT_PROXYPORT =&gt; getenv('proxy_port')
209-
);
205+
$opt[CURLOPT_PROXY] = getenv('proxy');
210206
211207
require_once('google.php');</string>
212208
<key>scriptargtype</key>
@@ -290,11 +286,7 @@ require_once('google.php');</string>
290286
<string>Retrieving search suggestions ...</string>
291287
<key>script</key>
292288
<string>$query = "{query}";
293-
$opt = array(
294-
CURLOPT_PROXYTYPE =&gt; getenv('proxy_type'),
295-
CURLOPT_PROXY =&gt; getenv('proxy_address'),
296-
CURLOPT_PROXYPORT =&gt; getenv('proxy_port')
297-
);
289+
$opt[CURLOPT_PROXY] = getenv('proxy');
298290
299291
require_once('wikipedia.php');</string>
300292
<key>scriptargtype</key>
@@ -344,11 +336,7 @@ require_once('wikipedia.php');</string>
344336
<string>Retrieving asking suggestions ...</string>
345337
<key>script</key>
346338
<string>$query = "{query}";
347-
$opt = array(
348-
CURLOPT_PROXYTYPE =&gt; getenv('proxy_type'),
349-
CURLOPT_PROXY =&gt; getenv('proxy_address'),
350-
CURLOPT_PROXYPORT =&gt; getenv('proxy_port')
351-
);
339+
$opt[CURLOPT_PROXY] = getenv('proxy');
352340
353341
require_once('wolframalpha.php');</string>
354342
<key>scriptargtype</key>
@@ -432,11 +420,7 @@ require_once('wolframalpha.php');</string>
432420
<string>Retrieving search suggestions ...</string>
433421
<key>script</key>
434422
<string>$query = "{query}";
435-
$opt = array(
436-
CURLOPT_PROXYTYPE =&gt; getenv('proxy_type'),
437-
CURLOPT_PROXY =&gt; getenv('proxy_address'),
438-
CURLOPT_PROXYPORT =&gt; getenv('proxy_port')
439-
);
423+
$opt[CURLOPT_PROXY] = getenv('proxy');
440424
441425
require_once('pixiv.php');</string>
442426
<key>scriptargtype</key>
@@ -1179,21 +1163,15 @@ require_once('moegirlpedia.php');</string>
11791163
</dict>
11801164
<key>variables</key>
11811165
<dict>
1182-
<key>proxy_address</key>
1183-
<string>127.0.0.1</string>
1184-
<key>proxy_port</key>
1185-
<string>1087</string>
1186-
<key>proxy_type</key>
1187-
<string>CURLPROXY_HTTP</string>
1166+
<key>proxy</key>
1167+
<string></string>
11881168
</dict>
11891169
<key>variablesdontexport</key>
11901170
<array>
1191-
<string>proxy_port</string>
1192-
<string>proxy_type</string>
1193-
<string>proxy_address</string>
1171+
<string>proxy</string>
11941172
</array>
11951173
<key>version</key>
1196-
<string>1.7</string>
1174+
<string>1.8</string>
11971175
<key>webaddress</key>
11981176
<string>https://github.com/AkikoZ/alfred-web-search-suggest</string>
11991177
</dict>

0 commit comments

Comments
 (0)