diff --git a/plugins/gcalc.py b/plugins/gcalc.py deleted file mode 100755 index 2e605dd..0000000 --- a/plugins/gcalc.py +++ /dev/null @@ -1,20 +0,0 @@ -from util import hook, http - - -@hook.command("math") -@hook.command -def calc(inp): - """calc -- Calculate with Google Calc.""" - - soup = http.get_soup('http://www.google.com/search', q=inp, cookies=True, user_agent=http.ua_internetexplorer) - - result = soup.find('h2', {'class': 'r'}) - - exponent = result.find('sup') - if not result: - return "Could not calculate '{}'".format(inp) - - if not exponent: - return result.contents[0] - if exponent: - return "{}^{}".format(result.contents[0]*2) diff --git a/plugins/wolframalpha.py b/plugins/wolframalpha.py index 879b771..b86b87a 100755 --- a/plugins/wolframalpha.py +++ b/plugins/wolframalpha.py @@ -3,6 +3,8 @@ import re from util import hook, http, text, web +@hook.command('math') +@hook.command('calc') @hook.command('wa') @hook.command def wolframalpha(inp, bot=None):