-
-
Notifications
You must be signed in to change notification settings - Fork 404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Google search API used by willie is deprecated #650
Comments
1: It works as it it currently, so I would assume your problem is elsewhere. Try it on a Digital Ocean Droplet and see. 2: You have to pay for the custom search api queries past 100 uses per day. 3: It requires Google CSE/Google Dev accounts I used with with willie but it involves a unique identifiers per user from Google CSE/Google Dev accounts and in the end it didn't actually work as expected, but here is what I use (modified for relevance) You can add this to your trigger =
Note: It is just showing how I modified the existing code to work with CSE. def google_cse(query):
uri = 'https://www.googleapis.com/customsearch/v1'
args = '?key=MYKEY&cx=MYCSEID&googlehost=https://google.co.uk&num=1&lr=lang_en&q=' + query
bytes = web.get(uri + args)
return json.loads(bytes)
def google_search_cse(query):
results = google_cse(query)
try:
if results['queries']['request'][0]['totalResults'] == '0':
results = ''
else:
return results['items'][0]['link']
except IndexError:
return None
except TypeError:
return False
@commands('cse')
@example('.cse swhack')
def cse(bot, trigger):
"""Queries Google for the specified input."""
query = trigger.group(2)
if not query:
return bot.reply('.cse what?')
uri = google_search_cse(query)
if uri:
bot.reply(uri)
if 'last_seen_url' in bot.memory:
bot.memory['last_seen_url'][trigger.sender] = uri
elif uri is False:
bot.reply("Problem getting data from Google.")
else:
bot.reply("No results found for '%s'." % query) I had better results with https://swiftype.com/ for custom searches |
This seems to be an IPv6 issue, at least for me. Upon disabling IPv6 I could use the Google module without any problems. Enabled IPv6 and it gave me the same error, I even tried it out on several servers -- all of them gave me the same error. They were all Linode servers. |
Google removed their deprecated API we used for searching. Since their new API requires API keys (and sometimes money), it's simply not worth the hassle to support. Duck Duck Go should be good enough. This fixes issue #650, in a way.
Google finally killed off their old api. I wouldn't want to force users to register API keys to use such basic functionaltity, so I aliased .g to .ddg instead. Feel free to submit your |
Google removed their deprecated API we used for searching. Since their new API requires API keys (and sometimes money), it's simply not worth the hassle to support. Duck Duck Go should be good enough. This fixes issue #650, in a way.
Google removed their deprecated API we used for searching. Since their new API requires API keys (and sometimes money), it's simply not worth the hassle to support. Duck Duck Go should be good enough. This fixes issue sopel-irc#650, in a way.
The search API willie is used is deprecated and does not work. See: https://developers.google.com/web-search/docs/
I'm not sure for who it does and doesn't work, but for me it doesn't. And apparently for other people as well, judging by the conversations on IRC.
The text was updated successfully, but these errors were encountered: