Skip to content

Instantly share code, notes, and snippets.

@b1naryth1ef
Created May 8, 2011 08:16
Show Gist options
  • Save b1naryth1ef/961220 to your computer and use it in GitHub Desktop.
Save b1naryth1ef/961220 to your computer and use it in GitHub Desktop.
A simple bot built on jenni
import re
import web
import wolframalpha
import urllib
def search(query):
surch = wolframalpha.WolframAlpha(query)
for rs in surch.results:
uri = /?i="+query
uri2 = urllib.quote(uri)
uri3 = "http://www.wolframalpha.com/input"+uri2
msg = "Found: "+str(len(surch.results))+" results | "+uri3
return msg
def wolf(jenni, input):
query = input.group(2)
x = search(query)
jenni.say(x)
wolf.commands = ['wolf']
wolf.priority = 'high'
wolf.example = '.wolf y=|x|'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment