Skip to content

Commit

Permalink
Add support for Naver.com
Browse files Browse the repository at this point in the history
  • Loading branch information
deanishe committed Mar 22, 2015
1 parent be27418 commit d6d294b
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 2 deletions.
Binary file added Naver.acorn
Binary file not shown.
Binary file not shown.
Binary file added src/C0D55C1A-F608-45EF-8DD8-8983FE98EA29.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icons/naver.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 49 additions & 0 deletions src/info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,17 @@
<string></string>
</dict>
</array>
<key>C0D55C1A-F608-45EF-8DD8-8983FE98EA29</key>
<array>
<dict>
<key>destinationuid</key>
<string>1133DEAA-5A8F-4E7D-9E9C-A76CB82D9F92</string>
<key>modifiers</key>
<integer>0</integer>
<key>modifiersubtext</key>
<string></string>
</dict>
</array>
<key>C7678A85-DE2F-43A9-B8A3-6F7BECDA4608</key>
<array>
<dict>
Expand Down Expand Up @@ -1088,6 +1099,39 @@
<key>version</key>
<integer>0</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>argumenttype</key>
<integer>0</integer>
<key>escaping</key>
<integer>102</integer>
<key>queuedelaycustom</key>
<integer>1</integer>
<key>queuedelayimmediatelyinitially</key>
<false/>
<key>queuedelaymode</key>
<integer>0</integer>
<key>queuemode</key>
<integer>1</integer>
<key>runningsubtext</key>
<string>Fetching results…</string>
<key>script</key>
<string>/usr/bin/python search.py -e naver "{query}"</string>
<key>title</key>
<string>Naver.com Search</string>
<key>type</key>
<integer>0</integer>
<key>withspace</key>
<true/>
</dict>
<key>type</key>
<string>alfred.workflow.input.scriptfilter</string>
<key>uid</key>
<string>C0D55C1A-F608-45EF-8DD8-8983FE98EA29</string>
<key>version</key>
<integer>0</integer>
</dict>
</array>
<key>readme</key>
<string></string>
Expand Down Expand Up @@ -1178,6 +1222,11 @@
<key>ypos</key>
<real>810</real>
</dict>
<key>C0D55C1A-F608-45EF-8DD8-8983FE98EA29</key>
<dict>
<key>ypos</key>
<real>2490</real>
</dict>
<key>C7678A85-DE2F-43A9-B8A3-6F7BECDA4608</key>
<dict>
<key>ypos</key>
Expand Down
20 changes: 20 additions & 0 deletions src/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,26 @@ def _suggest(self):
return results


class Naver(Suggest):
"""Get search suggestions from Naver.com"""

id_ = 'naver'
name = 'Naver.com'
_suggest_url = 'http://ac.search.naver.com/nx/ac'
_search_url = 'http://search.naver.com/search.naver?ie=utf-8&query={query}'

def _suggest(self):
response = web.get(self.suggest_url, {
'q': self.options['query'],
'of': 'os',
'ie': 'utf-8',
'oe': 'utf-8',
})
response.raise_for_status()
results = response.json()[1]
return results


class Google(Suggest):
"""Get search suggestions from Google"""

Expand Down
2 changes: 1 addition & 1 deletion src/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.6.1
1.7.0
2 changes: 1 addition & 1 deletion src/workflow/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.11.0
1.11.1

0 comments on commit d6d294b

Please sign in to comment.