Various tweaks

This commit is contained in:
Luke Rogers 2012-09-05 21:35:44 +12:00
parent 6bb9819501
commit 61752baa24
3 changed files with 14 additions and 2 deletions

View file

@ -7,6 +7,7 @@ def fact(inp, say=False, nick=False):
attempts = 0
# all of this is because omgfacts is fail
while True:
try:
soup = http.get_soup('http://www.omg-facts.com/random')
@ -22,7 +23,7 @@ def fact(inp, say=False, nick=False):
fact = ''.join(response.find(text=True))
if fact:
fact = http.unescape(fact.decode("utf-8")).strip()
fact = http.unescape(unicode(fact)).strip()
break
else:
if attempts > 2: