My goal is it to in an automated way get the banner art and profile pictures (avatar) of twitter accounts using only the URL to the twitter users account.
I'll give an example, unit's twitter account URL is:
https://twitter.com/unitygames
When clicking on the profile picture, it enlarges it and the URL changes to:
https://twitter.com/unitygames/photo
This however isn't enough to use the avatar on my html site.
When inspecting the element via web console of right click opening it in a new tab, the URL is:
https://pbs.twimg.com/profile_images/1659581335898562560/nX0yGpYD_400x400.jpg
This is exactly what I'm looking for, but there is no way of of dynamically getting to this image URL.
Maybe there is some library that can figure this out?
I could also use the twitter API https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/user-profile-images-and-banners
But that would come with a new set of issues, like needing the users auth token, so I would like to try to avoid that until there is no other option.
The framework I'm using for the website is Astro.