g = {}
-def unescape(s):
- p = HTMLParser()
- return p.unescape(s)
-
-
def init_cycle():
"""
Init the cycle
# Pull extended retweet text
try:
- text = 'RT @{0}: {1}'.format(t['retweeted_status']['user']['screen_name'],
- t['retweeted_status']['text'])
+ text = 'RT @' + t['retweeted_status']['user']['screen_name'] + ': ' +\
+ t['retweeted_status']['text']
except:
pass
+ # Unescape HTML character
text = unescape(text)
# Get expanded url
try:
from HTMLParser import HTMLParser
+ def unescape(s):
+ p = HTMLParser()
+ return p.unescape(s)
except:
- from html.parser import HTMLParser
+ from html import unescape
# raw_input and map functiion behaviour
if sys.version[0] == "3":