Skip to content

Instantly share code, notes, and snippets.

@lances101
Created January 7, 2018 18:45
Show Gist options
  • Save lances101/2f850ff04067cc0b7601d48f9e0dee1d to your computer and use it in GitHub Desktop.
Save lances101/2f850ff04067cc0b7601d48f9e0dee1d to your computer and use it in GitHub Desktop.
# -*- coding: utf-8 -*-
from wox import Wox, WoxAPI
import webbrowser
class Main(Wox):
def query(self, query):
results = []
if query[0] == "!":
url = "https://duckduckgo.com/?q=" + query
results.append({
"Title": "Bang Search",
"SubTitle": query,
"IcoPath":"duckduckgo.png",
"JsonRPCAction":{
"method": "search",
"parameters": [url]
},
"Score": "999999"
})
return results
def search(self, url):
webbrowser.open_new_tab(url)
if __name__ == "__main__":
Main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment