Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get real URLs from t.co links in profile bio #22

Open
thewh1teagle opened this issue Oct 12, 2024 · 3 comments · May be fixed by #24
Open

Get real URLs from t.co links in profile bio #22

thewh1teagle opened this issue Oct 12, 2024 · 3 comments · May be fixed by #24

Comments

@thewh1teagle
Copy link

While fetching followers or following, the user profile includes a bio, which contains the user's description.
When the bio has URLs, they are often shortened to t.co links instead of displaying the full URLs.
Typically, twitter provides the expanded URLs in other fields in the response, but I couldn't find any related field in the profile struct. Could you check if it's possible to add the missing metadata, if such fields exist?

Thanks!

P.S: I'm pretty sure I used that fields previously in the library x-api-rs. the metadata was stored in legacy object field.

@cmj
Copy link

cmj commented Oct 12, 2024

Just adding to this, it seems they are now expanded in a character range of indices for account description (bio).

Example for CNN: https://0x0.st/X6Of.json

@thewh1teagle
Copy link
Author

thewh1teagle commented Oct 12, 2024

@cmj

Exactly. where did you get this json from? Does twitter scraper get the same response internally?

@cmj
Copy link

cmj commented Oct 12, 2024

This is from the v1.1 users/lookup.json, which is the basic user lookup. I'm not seeing this internally, but I'm just noticing it is possible to expand.

You can play with it using this script https://github.com/cmj/twitter-tools/blob/main/user.sh

@thewh1teagle thewh1teagle linked a pull request Oct 13, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants