V
V
Vadim Sheshunov2019-12-20 12:35:18
Twitter
Vadim Sheshunov, 2019-12-20 12:35:18

How to extract images from tweets?

I'm using the Standard Twitter API to extract images from tweets. For this I use the construct

$utimeline = $connection->get("statuses/user_timeline", ["screen_name" => "$_GET[q]", "count" => COUNT_TWITTS]); 
$utimeline=json_decode(json_encode($utimeline), TRUE);

from the twitteroauth library for php. It is noteworthy that if the image is located in https://pbs.twimg.com/media/, then it is in the subarrays of the $utimeline array. And if the picture is in https://pbs.twimg.com/ad_img/, then it is not in any subarray. By the way, direct parsing of tweets in php gives a similar result.
Question: Which Twitter API should I use to solve the problem of retrieving images?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question