From c8fe22190cd7ab549d329cded557ef2ad7ff98cd Mon Sep 17 00:00:00 2001 From: mutantmonkey Date: Sat, 17 Sep 2011 21:46:42 -0400 Subject: [PATCH] mylife: add my life is creepy --- modules/mylife.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/modules/mylife.py b/modules/mylife.py index 560d713..490eb68 100644 --- a/modules/mylife.py +++ b/modules/mylife.py @@ -67,6 +67,20 @@ def mlib(phenny, input): phenny.say(quote) mlib.commands = ['mlib'] +def mlic(phenny, input): + """.mlic - My life is creepy.""" + try: + req = urlopen("http://mylifeiscreepy.com/random") + except HTTPError: + phenny.say("Error: Have you checked behind you?") + return + + doc = lxml.html.parse(req) + quote = doc.getroot().find_class('oldlink')[0].text_content() + quote = quote.strip() + phenny.say(quote) +mlic.commands = ['mlic'] + def mlid(phenny, input): """.mlib - My life is Desi.""" try: