Is it possible to just take a user's media (photos, specifically)?


#1

Using the API V1.1 is it possible to just retrieve the photos that a user has posted?

I can see that one way to do this is to pull a user’s timeline with include_entities=true and search for the photos that way. But that seems like an extremely cumbersome way around, and prone to problems?

For example, we can pull the last 15 tweets and display them, and we know, for sure, that we will always get 15 tweets.

But for just photos, if we were to even pull 100 tweets at a time, we can not be guaranteed that it will contain, say, 15 photos, or even that it will contain any photos at all.

So perhaps I’m clutching at straws here hoping that there is some way to do this? I’ve searched around and there doesn’t seem to be an answer.

I’m looking for a PHP example, preferably.


#2

There is no dedicated method for it – you would need to retrieve their user timeline and filter for the tweets you’re interested in by extracting entities as you’ve surmised.