question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot get tweet url

See original GitHub issue

I ran this code

for tweet in tweepy.Cursor(api.search, q='sample', count=100,tweet_mode='extended').items():
    print(tweet.url)
    print(tweet.text)

but cannot get url. Now Status objects doesn’t have url attribute and text attribute ? How can I get tweet url ?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

10reactions
Harmon758commented, Apr 14, 2019

url has never been an attribute of the Tweet object. Instead, you can simply reconstruct a link to the Tweet by using the id/id_str attribute and the screen_name of the User object/attribute. e.g. f"https://twitter.com/{tweet.user.screen_name}/status/{tweet.id}" The text attribute still exists for Tweet objects, although you might want to use full_text instead since you’re using the extended Tweet mode.

5reactions
Ivancacommented, Oct 26, 2019

For what is word you don’t need the screen name, the id is enough because Twitter automatically redirects to the full url.

url = f"https://twitter.com/user/status/{tweet.id}"
Read more comments on GitHub >

github_iconTop Results From Across the Web

7 Ways to Troubleshoot When You Can't Open Twitter Links
There are several ways to fix Twitter links when they won't open in the app or website. Here's what you need to know....
Read more >
How to link to a Tweet, Moment, List, or Twitter Space by URL
Navigate to the Tweet you'd like the URL of. Click the icon located within the Tweet. From the pop-up menu, select Copy link...
Read more >
Get tweet url having only tweet id - Stack Overflow
First, I assume you have to do a query and search after the tweet id obtaining the user name, and after that build...
Read more >
How to Find Your Twitter URL to Share on Instagram ...
How to find my Twitter URL on the app? · In your Twitter app, tap your profile pic in the top-left and tap...
Read more >
Why i am not able to get tweet that contains third-party image ...
I want tweets detail that contains third party image sites URL like i.e. 500px This API not returning many more images third-party sites...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found