g = {}
-def unescape(s):
- p = HTMLParser()
- return p.unescape(s)
-
-
def init_cycle():
"""
Init the cycle
printNicely(' '.join(ary))
+def check_config():
+ """
+ Check if config is changed
+ """
+ changed = False
+ data = get_all_config()
+ for key in data:
+ if data[key] != c[key]:
+ changed = True
+ if changed:
+ reload_config()
+
+
def check_theme():
"""
Check current theme and update if necessary
"""
check_theme()
+ check_config()
# Retrieve tweet
tid = t['id']
- text = unescape(t['text'])
+ text = t['text']
screen_name = t['user']['screen_name']
name = t['user']['name']
created_at = t['created_at']
date = date - datetime.timedelta(seconds=time.timezone)
clock = date.strftime('%Y/%m/%d %H:%M:%S')
+ # Pull extended retweet text
+ try:
+ text = 'RT @' + t['retweeted_status']['user']['screen_name'] + ': ' +\
+ t['retweeted_status']['text']
+ except:
+ pass
+
+ # Unescape HTML character
+ text = unescape(text)
+
# Get expanded url
try:
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)