Port to python3, fix ssl support

This commit is contained in:
mutantmonkey
2011-09-22 14:17:27 -04:00
parent 8d601d52bd
commit 50fe275870
41 changed files with 628 additions and 622 deletions

View File

@@ -7,8 +7,7 @@ author: mutantmonkey <mutantmonkey@mutantmonkey.in>
import random
from urllib import quote as urlquote
from urllib2 import HTTPError
from urllib.error import HTTPError
import web
import lxml.html
@@ -16,7 +15,7 @@ def fml(phenny, input):
""".fml"""
try:
req = web.get("http://www.fmylife.com/random")
except HTTPError, IOError:
except (HTTPError, IOError):
phenny.say("I tried to use .fml, but it was broken. FML")
return
@@ -29,7 +28,7 @@ def mlia(phenny, input):
""".mlia - My life is average."""
try:
req = web.get("http://mylifeisaverage.com/")
except HTTPError, IOError:
except (HTTPError, IOError):
phenny.say("I tried to use .mlia, but it wasn't loading. MLIA")
return
@@ -43,7 +42,7 @@ def mliarab(phenny, input):
""".mliarab - My life is Arabic."""
try:
req = web.get("http://mylifeisarabic.com/random/")
except HTTPError, IOError:
except (HTTPError, IOError):
phenny.say("The site you requested, mylifeisarabic.com, has been banned \
in the UAE. You will be reported to appropriate authorities")
return
@@ -59,7 +58,7 @@ def mlib(phenny, input):
""".mlib - My life is bro."""
try:
req = web.get("http://mylifeisbro.com/random")
except HTTPError, IOError:
except (HTTPError, IOError):
phenny.say("MLIB is out getting a case of Natty. It's chill.")
return
@@ -72,7 +71,7 @@ def mlic(phenny, input):
""".mlic - My life is creepy."""
try:
req = web.get("http://mylifeiscreepy.com/random")
except HTTPError, IOError:
except (HTTPError, IOError):
phenny.say("Error: Have you checked behind you?")
return
@@ -86,7 +85,7 @@ def mlid(phenny, input):
""".mlib - My life is Desi."""
try:
req = web.get("http://www.mylifeisdesi.com/random")
except HTTPError, IOError:
except (HTTPError, IOError):
phenny.say("MLID is busy at the hookah lounge, be back soon.")
return
@@ -99,7 +98,7 @@ def mlig(phenny, input):
""".mlig - My life is ginger."""
try:
req = web.get("http://www.mylifeisginger.org/random")
except HTTPError, IOError:
except (HTTPError, IOError):
phenny.say("Busy eating your soul. Be back soon.")
return
@@ -112,7 +111,7 @@ def mlih(phenny, input):
""".mlih - My life is ho."""
try:
req = web.get("http://mylifeisho.com/random")
except HTTPError, IOError:
except (HTTPError, IOError):
phenny.say("MLIH is giving some dome to some lax bros.")
return
@@ -125,7 +124,7 @@ def mlihp(phenny, input):
""".mlihp - My life is Harry Potter."""
try:
req = web.get("http://www.mylifeishp.com/random")
except HTTPError, IOError:
except (HTTPError, IOError):
phenny.say("This service is not available to Muggles.")
return
@@ -138,7 +137,7 @@ def mlit(phenny, input):
""".mlit - My life is Twilight."""
try:
req = web.get("http://mylifeistwilight.com/random")
except HTTPError, IOError:
except (HTTPError, IOError):
phenny.say("Error: Your life is too Twilight. Go outside.")
return
@@ -148,5 +147,5 @@ def mlit(phenny, input):
mlit.commands = ['mlit']
if __name__ == '__main__':
print __doc__.strip()
print(__doc__.strip())