Add support for extended tweets in twitter.statuses calls
authorMaxence Groine <mgroine@fiefmanage.ch>
Fri, 10 Nov 2017 11:40:51 +0000 (12:40 +0100)
committerMaxence Groine <mgroine@fiefmanage.ch>
Tue, 14 Nov 2017 10:11:10 +0000 (11:11 +0100)
Conflicts:
rainbowstream/rainbow.py

rainbowstream/draw.py
rainbowstream/rainbow.py

index 75e7577..fcc976c 100644 (file)
@@ -184,7 +184,7 @@ def draw(t, keyword=None, humanize=True, noti=False, fil=[], ig=[]):
 
     # Retrieve tweet
     tid = t['id']
-    text = t['text']
+    text = t.get('full_text', t.get('text'))
     screen_name = t['user']['screen_name']
     name = t['user']['name']
     created_at = t['created_at']
index a499f95..a0ba2af 100644 (file)
@@ -330,7 +330,7 @@ def home():
     num = c['HOME_TWEET_NUM']
     if g['stuff'].isdigit():
         num = int(g['stuff'])
-    for tweet in reversed(t.statuses.home_timeline(count=num)):
+    for tweet in reversed(t.statuses.home_timeline(count=num, tweet_mode='extended')):
         draw(t=tweet)
     printNicely('')
 
@@ -399,7 +399,7 @@ def view():
         except:
             num = c['HOME_TWEET_NUM']
         for tweet in reversed(
-                t.statuses.user_timeline(count=num, screen_name=user[1:])):
+                t.statuses.user_timeline(count=num, screen_name=user[1:], tweet_mode='extended')):
             draw(t=tweet)
         printNicely('')
     else:
@@ -416,7 +416,7 @@ def view_my_tweets():
     except:
         num = c['HOME_TWEET_NUM']
     for tweet in reversed(
-            t.statuses.user_timeline(count=num, screen_name=g['original_name'])):
+            t.statuses.user_timeline(count=num, screen_name=g['original_name'], tweet_mode='extended')):
         draw(t=tweet)
     printNicely('')