_find() method (using ajax api) added to google module
This commit is contained in:
parent
e01af3fdd7
commit
bb8db87d02
1 changed files with 26 additions and 19 deletions
|
@ -7,6 +7,8 @@ import urllib2
|
||||||
import weakref
|
import weakref
|
||||||
import threading
|
import threading
|
||||||
import Queue
|
import Queue
|
||||||
|
import simplejson
|
||||||
|
|
||||||
|
|
||||||
import oxlib
|
import oxlib
|
||||||
from oxlib import stripTags
|
from oxlib import stripTags
|
||||||
|
@ -48,3 +50,8 @@ def find(query, max_results=DEFAULT_MAX_RESULTS):
|
||||||
results = results[:max_results]
|
results = results[:max_results]
|
||||||
return results
|
return results
|
||||||
|
|
||||||
|
def _find(query):
|
||||||
|
url = 'http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=%s' % quote_plus(query)
|
||||||
|
results = simplejson.loads(getUrlUnicode(url))['responseData']['results']
|
||||||
|
return results
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue