-
Notifications
You must be signed in to change notification settings - Fork 234
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
Profile image mobile issue #176
Comments
So I don't have any mobile detection code right now. You would have to add that yourself as I cant control Twitter's redirects unfortunately. If you want to find a snippet of code that is minimal and does a good job of detecting if on mobile and changing the prefix of the URL in Twitter fetcher feel free to make a pull request but I probably wont get around to this for a while. |
OK I found this code snippet that should work for mobile but do you know the equivellent URL for mobile to get profile image?
|
Sorry, I was in a bit of a rush before and didn't do a great job of explaining the issue. Here's a (hopefully) better breakdown of what I'm noticing. I'm using dataOnly mode for what it's worth. tweet.author_data.profile_image = https://twitter.com/[user]/profile_image?size=bigger tweet.author = valid HTML using the correct https://pbs.twimg.com image for both desktop and mobile I guess my thought was to see if we could somehow use the https://pbs.twimg.com image from the tweet.author HTML for the tweet.author_data.profile_image value. That would avoid any redirects since the value would be the actual image URL, but I assume that would require parsing the HTML string and extracting the image source. Does that sound like it would work? Happy to take a crack at a PR if it's something you'd be interested in adding. |
Sure if you make a PR that works cross browser and is reliable I can merge it. :-) Indeed probably need some string parsing to get that out. |
When I use tweet.author_data.profile_image it returns the URL: https://twitter.com/twitter/profile_image?size=bigger
This works correctly for desktop, but on mobile devices it's redirecting to the following which gives a 404: https://mobile.twitter.com/twitter/profile_image?size=bigger
It looks like the correct images appear in the HTML when using tweet.profile however. Is that the intended behavior, or are those images being determined differently from the author_data ones?
Thanks for the great script!
The text was updated successfully, but these errors were encountered: