pythontwitterweb-scrapingsocial-networkingtwython

Twython with 140 character limitation of twitter


I am trying to search in twitter using Tython, but it seems that the library has a limitation on 140 characters. With the new feature of python, i.e. 280 characters length, what can one do?


Solution

  • This is not a limitation of Twython. The Twitter API by default returns the old 140-character limited tweet. In order to see the newer extended tweet you just need to supply this parameter to your search query:

    tweet_mode=extended

    Then, you will find the 280-character extended tweet in the full_text field of the returned tweet.

    I use another library (TwitterAPI), but I think you would do something like this using Twython:

    results = api.search(q='pizza',tweet_mode='extended')
    for result in results['statuses']:
        print(result['full_text'])