How to search only for media


#1

Hi!

On my site, the user have a photo album, and when the user upload a new pick will be abble to share on twitter. Now, on his album, there are two zones. One with the uploaded photos on my site, and other, where he can see the twitter pics (media).

Now, i access with php with this sentence:

$connection->get(“https://api.twitter.com/1.1/search/tweets.json?q=".$search."&count=".$notweets."&result_type=recent&include_entities=true&src=typd&mode=photos”);

I tried with “mode=photos” only and other ways, but the pics i recieve are the same always. Only recieve the pics of latest tweets or retweets filtering when “media_url” is not empty.

How can i recieve ONLY the MEDIA results? Like this: https://twitter.com/HotDivines/media

Thanks!


#2

This is not a feature directly offered in the API. For a specific user, use their statuses/user_timeline and sift out the tweets you are interested in – in this case, those that contain media.


#3

Is there any chance of these content filters being available through the API?


#4

currently you can use the filter: option to apply a filter for just photos, videos, Vines etc.

For example

twurl “/1.1/search/tweets.json?q=andypiper%20filter:vine”


#5

filter:vine works but what about photos?

the below url doesn’t work?

$getfield = '?q=kitty+filter:photos&result_type=recent&count=100&include_entities=true';

#6

Sorry my mistake, it should be images instead of photos

$getfield = '?q=kitty+filter:images&result_type=recent&count=100&include_entities=true';