mylife: add my life is Harry Potter

master
mutantmonkey 2011-09-17 21:35:08 -04:00
parent bd69dcfed4
commit 6897760ab7
1 changed files with 13 additions and 0 deletions

View File

@ -106,6 +106,19 @@ def mlih(phenny, input):
phenny.say(quote) phenny.say(quote)
mlih.commands = ['mlih'] mlih.commands = ['mlih']
def mlihp(phenny, input):
""".mlihp - My life is Harry Potter."""
try:
req = urlopen("http://www.mylifeishp.com/random")
except HTTPError:
phenny.say("This service is not available to Muggles.")
return
doc = lxml.html.parse(req)
quote = doc.getroot().find_class('oldlink')[0][0].text_content()
phenny.say(quote)
mlihp.commands = ['mlihp']
def mlit(phenny, input): def mlit(phenny, input):
""".mlit - My life is Twilight.""" """.mlit - My life is Twilight."""
try: try: