Is there a way to pull someone's profile picture from Twitter and display it on my site without Auth or Twitter API?
I think it was possible with API v1.1 but support for that has been stopped.
Any suggestions or advice?
Is there a way to pull someone's profile picture from Twitter and display it on my site without Auth or Twitter API?
I think it was possible with API v1.1 but support for that has been stopped.
Any suggestions or advice?
There's the easy way, or the hard way :-)
The easy way is to use a service like http://avatars.io/
Simply call http://avatars.io/twitter/edent
to get my avatar.
The hard way?
You can scrape it directly off the Twitter site. It's not pretty - but it works.
If you look at the source for my Twitter page - https://twitter./edent - you will see this block of HTML.
<a href="/settings/profile"
class="account-summary account-summary-small"
data-nav="edit_profile">
<div class="content">
<div class="account-group js-mini-current-user" data-user-id="14054507" data-screen-name="edent">
<img class="avatar size32" src="https://pbs.twimg./profile_images/417381475101593601/UUi48hOg_normal.jpeg" alt="" data-user-id="14054507">
<b class="fullname">Terence Eden</b>
<span class="screen-name hidden" dir="ltr">@edent</span>
<small class="metadata">
Edit profile
</small>
</div>
</div>
</a>
You can look for the first instance of <img class="avatar size32"
and grab the src
from that.