diff --git a/plugins/recipe.py b/plugins/recipe.py index ff35894..53ec1de 100644 --- a/plugins/recipe.py +++ b/plugins/recipe.py @@ -15,7 +15,7 @@ phrases = [ u"YOU WON'T NOT MAKE SOME FUCKING \x02{}\x02", u"HOW ABOUT SOME FUCKING \x02{}?\x02", u"WHY DON'T YOU EAT SOME FUCKING \x02{}?\x02", - u"MAKE SOME FUCKING \x02{}\x02", + u"MAKE SOME FUCKING \x02{}\x02", v u"INDUCE FOOD COMA WITH SOME FUCKING \x02{}\x02" ] diff --git a/plugins/suggest.py b/plugins/suggest.py index 0e02210..ec66144 100644 --- a/plugins/suggest.py +++ b/plugins/suggest.py @@ -1,5 +1,3 @@ -import json - from util import hook, http, text from bs4 import BeautifulSoup @@ -7,20 +5,14 @@ from bs4 import BeautifulSoup @hook.command def suggest(inp): """suggest -- Gets suggested phrases for a google search""" - - page = http.get('http://google.com/complete/search', - output='json', client='hp', q=inp) - page_json = page.split('(', 1)[1][:-1] - - suggestions = json.loads(page_json)[1] - suggestions = [suggestion[0] for suggestion in suggestions] + suggestions = http.get_json('http://suggestqueries.google.com/complete/search', client='firefox', q=inp)[1] if not suggestions: return 'no suggestions found' out = u", ".join(suggestions) - # defuckify text + # defuckify text (might not be needed now, but I'll keep it) soup = BeautifulSoup(out) out = soup.get_text()