manage multiple pictures #227
Unanswered
misterpatate
asked this question in
Q&A
Replies: 2 comments
-
Unfortunately, you can't fetch all pictures with several pictures when using the media feed. You have to fetch the post to retrieve all pictures of a post. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I found such a solution for myself. Maybe something better can be done. function albumGetir($url,$api)
{
$a = [];
$media = new Media();
$media->setLink("https://instagram.com/p/".$url);
$mediaDetailed = $api->getMediaDetailed($media);
$count = count($mediaDetailed->getSideCarItems());
for($i = 1; $i<=$count;$i++)
{
$test = $mediaDetailed->getSideCarItems()[$i-1]->getVideoUrl();
if(!$test)
$a += [$i => ["url" => end($mediaDetailed->getSideCarItems()[$i-1]->getDisplayResources())->src]];
else
$a += [$i => ["url" =>$mediaDetailed->getSideCarItems()[$i-1]->getVideoUrl()]];
}
return json_encode($a);
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I may have missed it in the API but I can't find a way to manage posts with several pictures.
Thank you for your API.
Beta Was this translation helpful? Give feedback.
All reactions