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
Browse files Browse the repository at this point in the history
  • Loading branch information
jsanahuja committed Apr 4, 2020
1 parent c5a46d5 commit 3bb882d
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion dist/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 index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!--
* InstagramFeed
*
* @version 1.3.4
* @version 1.3.5
*
* @author Javier Sanahuja Liebana <[email protected]>
* @contributor csanahuja <[email protected]>
Expand Down
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": "@jsanahuja/instagramfeed",
"description": "Instagram Feed without access token. Not using the Instagram API",
"homepage": "https://github.com/jsanahuja/InstagramFeed",
"version": "1.3.4",
"version": "1.3.5",
"keywords": [
"instagram",
"feed",
Expand Down
15 changes: 7 additions & 8 deletions src/InstagramFeed.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* InstagramFeed
*
* @version 1.3.4
* @version 1.3.5
*
* @author Javier Sanahuja Liebana <[email protected]>
* @contributor csanahuja <[email protected]>
Expand Down Expand Up @@ -87,14 +87,13 @@
if (xhr.status === 200) {
var data = xhr.responseText.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 || null;
if (data === null) {
console.log(url);
console.error("InstagramFeed: Request error. No data retrieved: " + xhr.statusText);
} else {
data = data[0].graphql.user || data[0].graphql.hashtag;
callback(data, _this);
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;
callback(data, _this);
} else {
console.error("InstagramFeed: Request error. Response: " + xhr.statusText);
}
Expand Down
2 changes: 1 addition & 1 deletion test/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!--
* InstagramFeed
*
* @version 1.3.4
* @version 1.3.5
*
* @author Javier Sanahuja Liebana <[email protected]>
* @contributor csanahuja <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion test/requirejs.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!--
* InstagramFeed
*
* @version 1.3.4
* @version 1.3.5
*
* @author Javier Sanahuja Liebana <[email protected]>
* @contributor csanahuja <[email protected]>
Expand Down

0 comments on commit 3bb882d

Please sign in to comment.