Skip to content
This repository has been archived by the owner on May 3, 2021. It is now read-only.

Commit

Permalink
Added network ban detection. Related to #54 #53 #51 #50 #49 #42 #25
Browse files Browse the repository at this point in the history
  • Loading branch information
jsanahuja committed Apr 4, 2020
1 parent cfe63e3 commit 72c3f25
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 12 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!--
* jquery.instagramFeed
*
* @version 1.2.3
* @version 1.2.4
*
* @author Javier Sanahuja Liebana <bannss1@gmail.com>
* @contributor csanahuja <csanahuja@gmail.com>
Expand Down
9 changes: 7 additions & 2 deletions jquery.instagramFeed.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
* jquery.instagramFeed
*
* @version 1.2.3
* @version 1.2.4
*
* @author Javier Sanahuja Liebana <bannss1@gmail.com>
* @contributor csanahuja <csanahuja@gmail.com>
Expand Down Expand Up @@ -76,6 +76,10 @@
data = data.split("window._sharedData = ")[1].split("<\/script>")[0];
data = JSON.parse(data.substr(0, data.length - 1));
data = data.entry_data.ProfilePage || data.entry_data.TagPage;
if(typeof data === "undefined"){
console.error("Instagram Feed: It looks like YOUR network has been temporary banned because of too many requests. See https://github.com/jsanahuja/jquery.instagramFeed/issues/25");
return;
}
data = data[0].graphql.user || data[0].graphql.hashtag;

if(options.get_data){
Expand Down Expand Up @@ -185,7 +189,8 @@
$(options.container).html(html);
}).fail(function(e){
console.error("Instagram Feed: Unable to fetch the given user/tag. Instagram responded with the status code: ", e.status);
})
});

return true;
};

Expand Down
16 changes: 8 additions & 8 deletions jquery.instagramFeed.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "jquery.instagramFeed",
"description": "Instagram Feed without access token. Not using the Instagram API",
"homepage": "https://github.com/jsanahuja/jquery.instagramFeed",
"version": "1.2.3",
"version": "1.2.4",
"keywords": [
"instagram",
"feed",
Expand Down

0 comments on commit 72c3f25

Please sign in to comment.