From e769da6e9c65ea9b8f4f58d5d5f0e0ef31643797 Mon Sep 17 00:00:00 2001 From: Matthew Vernon Date: Thu, 17 Nov 2016 16:19:03 +0000 Subject: [PATCH 1/1] Updates for newer version of python-twitter (new twitter API) These are changes to support what will eventually be version 3.2 of python-twitter; for the time being we are running of a git clone of the devel branch, which supports the newer twitter API (so e.g. tweets quoting other tweets work properly); it doesn't look like an upstream release of 3.2 is going to happen any time soon. Author: Adam Bernard Signed-off-by: Matthew Vernon --- Servus-chiark.py | 3 ++- commands.py | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Servus-chiark.py b/Servus-chiark.py index 76fafd1..15ff6b5 100755 --- a/Servus-chiark.py +++ b/Servus-chiark.py @@ -190,7 +190,8 @@ try: twitapi = twitter.Api(consumer_key = twoaapck, consumer_secret = twoaapcs, access_token_key = twoapat, - access_token_secret = twoapats) + access_token_secret = twoapats, + tweet_mode = "extended") except IOError: # non-authenticated twitter api instance twitapi = twitter.Api() diff --git a/commands.py b/commands.py index 491ab3c..86d0d23 100755 --- a/commands.py +++ b/commands.py @@ -521,7 +521,7 @@ def getTweet(urlstring,twitapi,inclusion=False): else: tweeter_screen = "[not returned]" ; tweeter_name = "[not returned]" tweeter_name = tweeter_name + " RTing " + status.user.name #.encode('UTF-8', 'replace') - tweetText = status.text + tweetText = status.full_text if status.media: replacements = defaultdict( list ) for medium in status.media: @@ -593,5 +593,4 @@ def getTweet(urlstring,twitapi,inclusion=False): stringout = "Error: %s" % terror[1].__str__() if inclusion: return stringout # don't want to double-encode it, so just pass it on for now and encode later - print stringout.encode('UTF-8', 'replace') return stringout.encode('UTF-8', 'replace') -- 2.30.2