Various tweaks
This commit is contained in:
parent
6bb9819501
commit
61752baa24
3 changed files with 14 additions and 2 deletions
|
@ -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:
|
||||
|
|
Reference in a new issue