instagram-user-feed: No results anymore, how to debug this? No exception, was working fine for months.
Hi,
ran into this issue that since today I don’t get any results anymore, even though I didn’t change anything. I checked and the handle is fine and also there is no exception thrown. Then I updated composer packages just to be sure, but nothing changed.
Is this package still working or did Instagram block it?
I am using the default ^5 example code and current release.
$cache = new Instagram\Storage\CacheManager(__DIR__ . '/../../../cache/');
$api = new Instagram\Api($cache);
$api->setUserName(get_sub_field( 'instagram_handle' ));
$instagram_html = "";
try {
$feed = $api->getFeed();
$max_count = get_sub_field( 'amount_of_posts' );
$i = 0;
$instagram_html .= '<div class="row">';
$medias = $feed->getMedias();
foreach ($medias as $media) {
$i++;
$instagram_html .= '<div class="col';
if($i>3) {
$instagram_html .= ' d-none d-lg-block';
} else if($i>2) {
$instagram_html .= ' d-none d-md-block';
}
$instagram_html .= '"><a href="'.$media->getLink().'" target="_blank" title="'.$media->getCaption().'" alt="'.$media->getCaption().'">
<img class="dshadow" src="/wp-content/themes/understrap-child/img/Rectangle.png" width="100%" style="background-repeat: no-repeat;background-size: cover;background-image:url('.$media->displaySrc.');" /></a></div>';
if($max_count<=$i) break;
}
$instagram_html .= '</div>';
} catch (Exception $exception) {
print_r($exception->getMessage());
} catch (\GuzzleHttp\Exception\GuzzleException $e) {
print_r($exception->getMessage());
}
echo $instagram_html;
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 21 (6 by maintainers)
Hi @pgrimaud , i had a same problem with ProfilePage : I debug and find that entry_data did not include ProfilePage $newCache->setUserId($data->entry_data->ProfilePage[0]->graphql->user->id); ( file HtmlTransportFeed.php) Can you help me ? What can i do ?
I’ve recently experienced the same issue from shared hosting and have managed to work round it by specifying the IP address to use via the cURL config supplied to Guzzle.
N.B This works since I have a dedicated IP address attached to the shared hosting account in this instance, therefore we can access Instagram outwith the shared host’s IP address which is likely being blocked.
I use an environment variable to force the outbound IP if required, otherwise we’ll just let the package instantiate Guzzle as normal.