Skip to content

Commit

Permalink
[search] Make .ddg !bang return full URL
Browse files Browse the repository at this point in the history
It had been returning just bangs.html
  • Loading branch information
embolalia committed Feb 21, 2013
1 parent f7a81be commit b9614d9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions search.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ def duck_search(query):
if m: return web.decode(m.group(1))

def duck_api(query):
if '!bang' in query.lower():
return 'https://duckduckgo.com/bang.html'

uri = web.quote(query)
uri = 'http://api.duckduckgo.com/?q=%s&format=json&no_html=1&no_redirect=1'%query
results = json.loads(web.get(uri))
Expand Down

0 comments on commit b9614d9

Please sign in to comment.