Skip to content

Commit

Permalink
[search] Fix google search in Python 3
Browse files Browse the repository at this point in the history
I wonder when it broke
  • Loading branch information
Elad Alfassa committed May 2, 2014
1 parent 31c17fd commit b04af29
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 @@ -13,6 +13,7 @@
from willie import web
from willie.module import commands, example
import json
import sys
import time


Expand All @@ -21,6 +22,8 @@ def google_ajax(query):
uri = 'http://ajax.googleapis.com/ajax/services/search/web'
args = '?v=1.0&safe=off&q=' + query
bytes = web.get(uri + args)
if sys.version_info.major >= 3:
bytes = bytes.decode()
return json.loads(bytes)


Expand Down

0 comments on commit b04af29

Please sign in to comment.