Created
November 23, 2012 18:01
-
-
Save Zettt/4136671 to your computer and use it in GitHub Desktop.
Search DuckDuckGo in Google Chrome for iOS
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
import webbrowser | |
import urllib | |
# http://duckduckgo.com/?q=asdf | |
ddg_url = "googlechromes://duckduckgo.com/?" | |
query_url = "q=" | |
# input | |
prompt = "> " | |
query = raw_input("Query: \n" + prompt) | |
# url encode | |
query = urllib.quote(query) | |
# open in chrome | |
webbrowser.open(ddg_url + query_url + query) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment