Dear I'm trying to download images associated to tweets but I have a lot of problem.
Firstly I found that entities->media[0]->media_url
contains the image Url but it is not the same in every tweet.
Now I see a tweet with associated urls for photo on YFROG.com be in entities->urls
I can't find the right documentation or example code: can you please help me? thanks A
You can get the media entities as explained in this doc https://dev.twitter.com/docs/tweet-entities
to get the image , u can use file_get_contents($image)
so ur code would something look like
<?php
$value = file_get_contents($image);
$fp = fopen('path_to_filename.png', 'w');
fwrite($fp, $value);
fclose($fp);
?>
Hope this helps
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.