2

Now that twitter has increased the number of characters from 140 to 280 how can I use my tweetpy api in order to get the whole tweet?

This is how my code is right now:

for search in Search.objects.all():
        if search.is_enabled:
            for keyword in search.keywords.all():
                results = api.search(q=keyword.name, count=100, include_entities=True)

                for result in results:
                    print ("results", dir(result))
                    print " ID: %s" % result.id
                    print " From: %s" % result.user.name.encode('utf-8')
                    print " Created : %s" % result.created_at
                    print " %s" % result.text.encode('utf-8')
                    self.loadtweet(search, result)

I tried to add this: tweet_mode='extended' in the:

results = api.search(q=keyword.name, count=100, include_entities=True)

but it returns an error of missing text attribute in Status object.

Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880
user1919
  • 3,818
  • 17
  • 62
  • 97
  • 1
    https://stackoverflow.com/questions/47211501/twitter-streaming-api-not-return-full-tweets/47214802#47214802 – Jonas Dec 06 '17 at 02:36
  • Thanks. That was the issue. As mentioned we need to use "full_text" instead of "text" in order to receive the status. – user1919 Dec 06 '17 at 07:37
  • 1
    Possible duplicate of [Twitter streaming API not return full tweets](https://stackoverflow.com/questions/47211501/twitter-streaming-api-not-return-full-tweets) – Lucas Aug 29 '18 at 15:04

0 Answers0