disabled many plugins
This commit is contained in:
parent
0ba2001b62
commit
7cce9bf27e
119 changed files with 0 additions and 20 deletions
19
disabled_stuff/suggest.py
Normal file
19
disabled_stuff/suggest.py
Normal file
|
@ -0,0 +1,19 @@
|
|||
from util import hook, http, text
|
||||
from bs4 import BeautifulSoup
|
||||
|
||||
|
||||
@hook.command
|
||||
def suggest(inp):
|
||||
"""suggest <phrase> -- Gets suggested phrases for a google search"""
|
||||
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 (might not be needed now, but I'll keep it)
|
||||
soup = BeautifulSoup(out)
|
||||
out = soup.get_text()
|
||||
|
||||
return text.truncate_str(out, 200)
|
Reference in a new issue