From a29fee006e88a38c359b3fcd60b5d8636078a841 Mon Sep 17 00:00:00 2001 From: jsanahuja Date: Thu, 6 Feb 2020 23:43:04 +0100 Subject: [PATCH] hotfix --- dist/InstagramFeed.min.js | 2 +- index.html | 2 +- package.json | 2 +- src/InstagramFeed.js | 5 ++--- test/index.html | 2 +- test/requirejs.html | 2 +- 6 files changed, 7 insertions(+), 8 deletions(-) diff --git a/dist/InstagramFeed.min.js b/dist/InstagramFeed.min.js index 6529a13..e1df86e 100644 --- a/dist/InstagramFeed.min.js +++ b/dist/InstagramFeed.min.js @@ -1 +1 @@ -"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}(function(a,b){"function"==typeof define&&define.amd?define([],b):"object"===("undefined"==typeof exports?"undefined":_typeof(exports))?module.exports=b():a.InstagramFeed=b()})(void 0,function(){var a={host:"https://www.instagram.com/",username:"",tag:"",container:"",display_profile:!0,display_biography:!0,display_gallery:!0,display_igtv:!1,get_data:!1,callback:null,styling:!0,items:8,items_per_row:4,margin:.5,image_size:640},b={150:0,240:1,320:2,480:3,640:4};return function(c){this.options=Object.assign({},a),this.options=Object.assign(this.options,c),this.is_tag=""==this.options.username,this.valid=!0,""==this.options.username&&""==this.options.tag?(console.error("InstagramFeed: Error, no username or tag defined."),this.valid=!1):this.options.get_data||""!=this.options.container?this.options.get_data&&"function"!=typeof this.options.callback&&(console.error("InstagramFeed: Error, invalid or undefined callback for get_data"),this.valid=!1):(console.error("InstagramFeed: Error, no container found."),this.valid=!1),this.get=function(a){var b=this.is_tag?this.options.host+"explore/tags/"+this.options.tag:this.options.host+this.options.username,c=new XMLHttpRequest,d=this;c.onload=function(){if(4===c.readyState)if(200===c.status){var e=c.responseText.split("window._sharedData = ")[1].split("")[0];e=JSON.parse(e.substr(0,e.length-1)),e=e.entry_data.ProfilePage||e.entry_data.TagPage||null,null===e?(console.log(b),console.error("InstagramFeed: Request error. No data retrieved: "+c.statusText)):(e=e[0].graphql.user||e[0].graphql.hashtag,a(e,d))}else console.error("InstagramFeed: Request error. Response: "+c.statusText)},c.open("GET",b,!0),c.send()},this.parse_caption=function(a,b){return"undefined"!=typeof a.node.edge_media_to_caption.edges[0]&&0!=a.node.edge_media_to_caption.edges[0].node.text.length?a.node.edge_media_to_caption.edges[0].node.text:"undefined"!=typeof a.node.title&&0!=a.node.title.length?a.node.title:"undefined"!=typeof a.node.accessibility_caption&&0!=a.node.accessibility_caption.length?a.node.accessibility_caption:(this.is_tag?b.name:b.username)+" image "},this.display=function(a){if(this.options.styling)var c=(100-2*this.options.margin*this.options.items_per_row)/this.options.items_per_row,d={profile_container:" style='text-align:center;'",profile_image:" style='border-radius:10em;width:15%;max-width:125px;min-width:50px;'",profile_name:" style='font-size:1.2em;'",profile_biography:" style='font-size:1em;'",gallery_image:" style='margin:"+this.options.margin+"% "+this.options.margin+"%;width:"+c+"%;float:left;'"};else var d={profile_container:"",profile_image:"",profile_name:"",profile_biography:"",gallery_image:""};var e="";if(this.options.display_profile&&(e+="
",e+=""+(this.is_tag?a.name+" tag pic":a.username+" profile pic")+" profile pic",e+=this.is_tag?"

#"+this.options.tag+"

":"

@"+a.full_name+" (@"+this.options.username+")

",!this.is_tag&&this.options.display_biography&&(e+="

"+a.biography+"

"),e+="
"),this.options.display_gallery){var f="undefined"==typeof b[this.options.image_size]?b[640]:b[this.options.image_size];if("undefined"!=typeof a.is_private&&!0===a.is_private)e+="

This profile is private

";else{var g=(a.edge_owner_to_timeline_media||a.edge_hashtag_to_media).edges;o=g.length>this.options.items?this.options.items:g.length,e+=""}}if(this.options.display_igtv&&"undefined"!=typeof a.edge_felix_video_timeline){var n=a.edge_felix_video_timeline.edges,o=n.length>this.options.items?this.options.items:n.length;if(0";for(var h=0;h",e+=""+m+"",e+=""}e+=""}}this.options.container.innerHTML=e},this.run=function(){this.get(function(a,b){b.options.get_data?b.options.callback(a):b.display(a)})},this.valid&&this.run()}}); +"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}(function(a,b){"function"==typeof define&&define.amd?define([],b):"object"===("undefined"==typeof exports?"undefined":_typeof(exports))?module.exports=b():a.InstagramFeed=b()})(window,function(){var a={host:"https://www.instagram.com/",username:"",tag:"",container:"",display_profile:!0,display_biography:!0,display_gallery:!0,display_igtv:!1,get_data:!1,callback:null,styling:!0,items:8,items_per_row:4,margin:.5,image_size:640},b={150:0,240:1,320:2,480:3,640:4};return function(c){this.options=Object.assign({},a),this.options=Object.assign(this.options,c),this.is_tag=""==this.options.username,this.valid=!0,""==this.options.username&&""==this.options.tag?(console.error("InstagramFeed: Error, no username or tag defined."),this.valid=!1):this.options.get_data||""!=this.options.container?this.options.get_data&&"function"!=typeof this.options.callback&&(console.error("InstagramFeed: Error, invalid or undefined callback for get_data"),this.valid=!1):(console.error("InstagramFeed: Error, no container found."),this.valid=!1),this.get=function(a){var b=this.is_tag?this.options.host+"explore/tags/"+this.options.tag:this.options.host+this.options.username,c=new XMLHttpRequest,d=this;c.onload=function(){if(4===c.readyState)if(200===c.status){var e=c.responseText.split("window._sharedData = ")[1].split("")[0];e=JSON.parse(e.substr(0,e.length-1)),e=e.entry_data.ProfilePage||e.entry_data.TagPage||null,null===e?(console.log(b),console.error("InstagramFeed: Request error. No data retrieved: "+c.statusText)):(e=e[0].graphql.user||e[0].graphql.hashtag,a(e,d))}else console.error("InstagramFeed: Request error. Response: "+c.statusText)},c.open("GET",b,!0),c.send()},this.parse_caption=function(a,b){return"undefined"!=typeof a.node.edge_media_to_caption.edges[0]&&0!=a.node.edge_media_to_caption.edges[0].node.text.length?a.node.edge_media_to_caption.edges[0].node.text:"undefined"!=typeof a.node.title&&0!=a.node.title.length?a.node.title:"undefined"!=typeof a.node.accessibility_caption&&0!=a.node.accessibility_caption.length?a.node.accessibility_caption:(this.is_tag?b.name:b.username)+" image "},this.display=function(a){if(this.options.styling)var c=(100-2*this.options.margin*this.options.items_per_row)/this.options.items_per_row,d={profile_container:" style='text-align:center;'",profile_image:" style='border-radius:10em;width:15%;max-width:125px;min-width:50px;'",profile_name:" style='font-size:1.2em;'",profile_biography:" style='font-size:1em;'",gallery_image:" style='margin:"+this.options.margin+"% "+this.options.margin+"%;width:"+c+"%;float:left;'"};else var d={profile_container:"",profile_image:"",profile_name:"",profile_biography:"",gallery_image:""};var e="";if(this.options.display_profile&&(e+="
",e+=""+(this.is_tag?a.name+" tag pic":a.username+" profile pic")+" profile pic",e+=this.is_tag?"

#"+this.options.tag+"

":"

@"+a.full_name+" (@"+this.options.username+")

",!this.is_tag&&this.options.display_biography&&(e+="

"+a.biography+"

"),e+="
"),this.options.display_gallery){var f="undefined"==typeof b[this.options.image_size]?b[640]:b[this.options.image_size];if("undefined"!=typeof a.is_private&&!0===a.is_private)e+="

This profile is private

";else{var g=(a.edge_owner_to_timeline_media||a.edge_hashtag_to_media).edges;o=g.length>this.options.items?this.options.items:g.length,e+=""}}if(this.options.display_igtv&&"undefined"!=typeof a.edge_felix_video_timeline){var n=a.edge_felix_video_timeline.edges,o=n.length>this.options.items?this.options.items:n.length;if(0";for(var h=0;h",e+=""+m+"",e+=""}e+=""}}this.options.container.innerHTML=e},this.run=function(){this.get(function(a,b){b.options.get_data?b.options.callback(a):b.display(a)})},this.valid&&this.run()}}); diff --git a/index.html b/index.html index 7e02644..a91146e 100644 --- a/index.html +++ b/index.html @@ -1,7 +1,7 @@