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
# Highlight keyword
tweet = ' '.join(tweet)
if keyword:
- roj = re.search(keyword,tweet,re.IGNORECASE)
+ roj = re.search(keyword, tweet, re.IGNORECASE)
if roj:
occur = roj.group()
ary = tweet.split(occur)