From 606def7ec2238dc677e67b329587bae89f5497ae Mon Sep 17 00:00:00 2001 From: Benjamin Rubin Date: Sat, 19 Jul 2014 20:12:24 -0400 Subject: [PATCH] Grab full text for retweeted statuses --- rainbowstream/draw.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/rainbowstream/draw.py b/rainbowstream/draw.py index 66c2483..f23e4ca 100644 --- a/rainbowstream/draw.py +++ b/rainbowstream/draw.py @@ -152,7 +152,7 @@ def draw(t, iot=False, keyword=None, check_semaphore=False, fil=[], ig=[]): check_theme() # 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'] @@ -161,6 +161,15 @@ def draw(t, iot=False, keyword=None, check_semaphore=False, fil=[], ig=[]): date = date - datetime.timedelta(seconds=time.timezone) clock = date.strftime('%Y/%m/%d %H:%M:%S') + # Pull extended retweet text + try: + text = 'RT @{0}: {1}'.format(t['retweeted_status']['user']['screen_name'], + t['retweeted_status']['text']) + except: + pass + + text = unescape(text) + # Get expanded url try: expanded_url = [] -- 2.25.1