api.user_timeline not grabbing full tweet
See original GitHub issueHello,
I am having an issue with not grabbing a full tweet when using the api.user_timeline
method. Was wondering if anyone could help me out with it? Tweepy code is below:
twitter_name = input("Enter a Twitter Handle: ")
for name in twitter_name:
try:
stuff = api.user_timeline(screen_name = twitter_name, count = 100, include_rts = False)
except tweepy.TweepError as e:
twitter_name = input("The handle you entered was invalid, please try again: ")
catchcount = 0
This returns the tweet followed by ‘…’ then a link. Ideally I would like to return the full tweet. Is there a way to do that while still using the api.user_timeline method
? Or another method that allows specified tweet count and returns a list of Status
objects without specifying a tweet ID number? like in the api.get_status
method with param tweet_mode = 'extended'
but for returning multiple tweets at a time.
Other info regarding similar issues see: #935 Much appreciated!!
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
api.user_timeline not grabbing full tweet - Stack Overflow
1 Answer 1 · I tried but it returns the following message: failed on_status, 'Status' object has no attribute 'full_text' Out[21]: · Try...
Read more >Extended Tweets — tweepy 4.12.1 documentation
API methods is replaced by a full_text attribute, which contains the entire untruncated text of the Tweet. The truncated attribute of the Status...
Read more >Trying to fetch 3200 Tweets with user_timeline
With the python code below I tried to fetch 3200 tweets from a public twitter profile, but so far I am always getting...
Read more >GET statuses/user_timeline | Docs | Twitter Developer Platform
Returns a collection of the most recent Tweets posted by the user indicated by the screen_name or user_id parameters.
Read more >How to get Tweets using Python and Twitter API
Getting Twitter data using Twitter API and the Tweepy library. ... So, some of the functionalities from v1.1 may not work with v2....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You can include the
tweet_mode = 'extended'
param with most of the API calls, user_timeline included.Should return the full tweet. Keep in mind, the response object is slightly different, and you’ll want to look for
full_text
instead of justtext
.I’ve added a section in the documentation that covers extended Tweets to supplement Twitter’s Tweet updates documentation.
@kamalikap What error are you referring to? It’s impossible to determine what your issue is without more information, such as a traceback and/or any relevant code. However, when using extended mode, the
text
attribute of the Status object is replaced with afull_text
attribute, notfull-text
, which would be an invalid attribute name.@puntofisso When using extended mode, the
text
attribute of the Status object is replaced with afull_text
attribute.For code block usage, see https://help.github.com/articles/creating-and-highlighting-code-blocks/.
@Nahaj That is not related to this issue.
If you’re using
API.user_timeline
, the maximum number of Tweets to try and retrieve per distinct request is 200, as specified for the documentation for thecount
parameter of the GET statuses/user_timeline endpoint that the method uses.To retrieve more than 200, you’ll need to perform multiple requests and iterate through the pages. Tweepy provides a Cursor to facilitate pagination. See the Cursor Tutorial documentation.