-
Notifications
You must be signed in to change notification settings - Fork 409
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from slowmove/master
IMDB plugin and Yelp plugin
- Loading branch information
Showing
8 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
imdb ~imdbquery(query here) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"name": "imdb", | ||
"displayName": "IMDB", | ||
"examples": ["imdb Phantom of the opera"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import urllib, json | ||
|
||
def results(parsed, original_query): | ||
search_specs = [ | ||
["IMDB", "~imdbquery", "http://m.imdb.com/find?q="] | ||
] | ||
for name, key, url in search_specs: | ||
if key in parsed: | ||
search_url = url + urllib.quote_plus(parsed[key]) | ||
return { | ||
"title": "Search {0} for '{1}'".format(name, parsed[key]), | ||
"run_args": [search_url], | ||
"html": """ | ||
<script> | ||
setTimeout(function() { | ||
window.location = %s | ||
}, 100); | ||
</script> | ||
"""%(json.dumps(search_url)), | ||
"webview_user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 7_0 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A465 Safari/9537.53", | ||
"webview_links_open_in_browser": True | ||
} | ||
|
||
def run(url): | ||
import os | ||
os.system('open "{0}"'.format(url)) |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
yelp ~yelpquery(query here) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"name": "yelp", | ||
"displayName": "Yelp", | ||
"examples": ["yelp pizza"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import urllib, json | ||
|
||
def results(parsed, original_query): | ||
search_specs = [ | ||
["Yelp", "~yelpquery", "http://m.yelp.com/search?find_desc="] | ||
] | ||
for name, key, url in search_specs: | ||
if key in parsed: | ||
search_url = url + urllib.quote_plus(parsed[key]) | ||
return { | ||
"title": "Search {0} for '{1}'".format(name, parsed[key]), | ||
"run_args": [search_url], | ||
"html": """ | ||
<script> | ||
setTimeout(function() { | ||
window.location = %s | ||
}, 100); | ||
</script> | ||
"""%(json.dumps(search_url)), | ||
"webview_user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 7_0 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A465 Safari/9537.53", | ||
"webview_links_open_in_browser": True | ||
} | ||
|
||
def run(url): | ||
import os | ||
os.system('open "{0}"'.format(url)) |
Binary file not shown.