-
Notifications
You must be signed in to change notification settings - Fork 69
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
Twitter not working #121
Comments
It seems Twitter changed a lot of stuff today. The scraping code is not working anymore. |
@Kikobeats seems that fix doesn't work( |
Looks like a problem related to Twitter detecting requests are coming from production servers and they respond with different HTML markup, being not possible get the avatar URL. That could be resolved to perform the Twitter request through a proxy server. Perhaps that means we need to set up a proxy server or using enough good free service (not sure about that) In the middle time, you can get Twitter avatar using Microlink API
|
if it helps, I've been using Luminati's Super Proxy successfully for months... |
Images are now pulled from the YouTube API instead of using a third party such as unavatar.now.sh This choice is made because previously the images were pulled from unavatar.now.sh which takes images from different sources (YouTube, Twitter, Instagram and more). Since with the latest Twitter API updates unavatar broke and doesn't function anymore (microlinkhq/unavatar#121). So I made a solution by myself: pulling images from YouTube with the YouTube API and saving the URLs of the images inside the channels.csv file
Hey maintainers! I am curious if you are working on some solution to fix the last changes by twitter or you recommend switching to some other services/fetching images natively via twitter api? Thanks a lot for your work! |
@d-ivashchuk if you self-hosted your own version (e.g., using Heroku) it should be working since the current problem is because the version is hosted on Vercel (AWS) and they detect the IP address is coming from their servers, serving different HTML markup, being not possible get the image because is not present |
Likewise, I need to investigate a different hosting alternative; suggestions (and sponsorship) are very welcome |
Please be aware that Heroku is deployed to AWS as well.
|
I am curios if it's possible to self host it using docker? |
hum, what about https://workers.cloudflare.com? |
@d-ivashchuk Yes it is, I am currently using it that way. Here's a simple
The application listens on port 3000. |
@Bobface is it working now run in docker? Where are you running a machine? |
@d-ivashchuk Yes it is working. I am running a machine with one of the more "old school" server providers (dedicated, year contract, etc.). I had this server already before these problems occured though. |
Deployed with docker image on GCP and Twitter still does not work. |
A potential solution could be to use DuckDuckGo's Twitter API proxy, eg: |
Alright, I've just submitted a pull request that does that! @Kikobeats let me know what you think. |
Not working for me, it just returns: {"user":"kikobeats","description":"","profile_image":"","location":"","current_status":null,"status":"","friends_count":"","entities":null,"name":"","followers_count":""} |
Ah true, I just tested it behind a VPN and it seems they don't accept requests from IP addresses of common VPNs, Vercel, etc. Disregard the pull request then, sorry! |
It also wasn't working from my home connection, but interestingly Ctrl+Shift+R makes it work. |
Actually, that's really weird, it seems to be working all of a sudden. Maybe it's due to a temporary IP block or something? Demo: |
Something that works up until your limits on Cloudinary is their Social Media Profile Pictures API: https://cloudinary.com/documentation/social_media_profile_pictures Just switch out the https://res.cloudinary.com/demo/image/twitter_name/BillClinton.jpg |
Thanks @Kikobeats for fixing! 👏 |
very low quality for the moment but let me figure out if I can improve it 🙂 |
For people reading this issue: high res Twitter avatar resolution is back! https://unavatar.io/twitter/kikobeats (also with a new fresh unavatar.io domain) It's using Microlink under the hood since the service has the prerendering capabilities for getting the right avatar URL. Microlink API has some free quota, but in case you have a high demand for this, consider buy a pro plan and just pass the API key as |
Hm, I guess I shouldn't be using this for |
Yeap, same results. |
The Twitter integration is getting hard due a headless browser is used for getting the avatar, and the Twitter site perf is terrible these days. When an avatar is not resolved is because Twitter timed out, working on it to find a sweet spot, that also implies upgrade the unavatar.io infrastructure to have better vCPUs. |
The sample twitter link: https://unavatar.now.sh/twitter/kikobeats doesn't work, nor do any requests I make!
EDIT: Seems like 'got' is getting a 400 error from Twitter, maybe they are blocking this type of request? I tried using 'request' package to scrape the HTML but it returns an incompatible browser page.
I've just decided to sign up for the Twitter API and create my own script to fetch the profile images. It's rate limited at 900 rq/15min so I don't know if that's a viable solution for this project.
The text was updated successfully, but these errors were encountered: