Calling Images From Instagram in PHP
I am trying to call the images from instagram account. I am using Custom PHP. I need to do without API and Access Token I have this code with me
<?php $otherPage = 'nasa'; $profileUrl = "https://www.instagram.com/$otherPage/?__a=1"; $iterationUrl = $profileUrl; $tryNext = true; $limit = 100; $found = 0; while ($tryNext) { $tryNext = false; $response = file_get_contents($iterationUrl); if ($response === false) { break; } $data = json_decode($response, true); if ($data === null) { break; } $media = $data['user']['media']; $found += count($media['nodes']); var_dump($media['nodes']); if ($media['page_info']['has_next_page'] && $found < $limit) { $iterationUrl = $profileUrl . '&max_id=' . $media['page_info']['end_cursor']; $tryNext = true; } } ?>
I have to call them on my HTML. HTML code is below
<div class="col-md-4 col-sm-6 p-0"> <div class="box7"> <img src="./images/insta-image01.jpg" alt=""> <div class="box-content"> <ul class="icon"> <li><a href="#"> <i class="fab fa-instagram "></i> </a> </li> </ul> <h3 class="title">Respira profundo y...</h3> </div> </div> </div>