scottsweb / wp-instagram-widget

❌ A WordPress widget for showing your latest Instagram photos.
115 stars 62 forks source link

Instagram has returned invalid data. #122

Closed lyrathemes closed 4 years ago

lyrathemes commented 4 years ago

Using version 2.0.4

print_r($remote) resulted in the following:

remote.txt

vivekudayan commented 4 years ago

Same Issue here

Mainframe101 commented 4 years ago

Same issue here for a few days now

goodwinpress commented 4 years ago

Sorry, but same problem with version 2.0.4. wpiw_proxy doesn't help (

scottsweb commented 4 years ago

Please see https://github.com/scottsweb/wp-instagram-widget/issues/118

The plugin is no longer maintained.

vchabal commented 4 years ago

my workaround, I replaced plugin with custom html, short example:

<div id="instasidebar"></div>
<script>
var insta_username = 'username_goes_here'
jQuery.getJSON({
    url: 'https://www.instagram.com/'+insta_username+'/?__a=1',
    success: function(data) {
        var posts = data.graphql.user.edge_owner_to_timeline_media.edges.slice(0, 9), 
            html = [];
        for (var i = 0; i < posts.length; i++) {
            html.push('<a href="https://www.instagram.com/p/' + posts[i].node.shortcode + '"><img src="' + posts[i].node.thumbnail_src + '" width=33.33% /></a>')
        }
        document.getElementById('instasidebar').innerHTML = html.join('');
    }
});
</script>
scottsweb commented 4 years ago

I don't recommend the jQuery approach. Every page load will require a new request to Instagram which will be slow and increase your chances of getting blocked. Any request needs to be cached.