I need to retrieve only photos on REST API 1.1
When I call my search like this everything is fine except it gets all the tweets. How do I filter only photos?
I don’t wanna make the if else statements to control if photo exists or not, that is a not the efficient way. I need to only filter photos.
I remember there was filter:images on the old API but now it does not work?
$tag = $_GET['txtHashTag'];
$url = ‘https://api.twitter.com/1.1/search/tweets.json’;
$requestMethod = ‘GET’;
$getfield = ‘?q=’.$tag.’&result_type=recent&count=100&include_entities=true’;
// Perform the request
$twitter = new TwitterAPIExchange($settings);
$tweets= $twitter->setGetfield($getfield)
->buildOauth($url, $requestMethod)
->performRequest();
$response = json_decode($tweets);
foreach ($response->statuses as $tweet) {
echo "
"
}