! function(e) { 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 }, t = { 150: 0, 240: 1, 320: 2, 480: 3, 640: 4 }; e.instagramFeed = function(r) { var i = e.fn.extend({}, a, r); if ("" == i.username && "" == i.tag) return console.error("Instagram Feed: Error, no username or tag found."), !1; if (void 0 !== i.get_raw_json && (console.warn("Instagram Feed: get_raw_json is deprecated. See use get_data instead"), i.get_data = i.get_raw_json), !i.get_data && "" == i.container) return console.error("Instagram Feed: Error, no container found."), !1; if (i.get_data && null == i.callback) return console.error("Instagram Feed: Error, no callback defined to get the raw json"), !1; var s = "" == i.username, n = s ? i.host + "explore/tags/" + i.tag + "/" : i.host + i.username + "/"; return e.get(n, function(a) { try { a = a.split("window._sharedData = ")[1].split("<\/script>")[0] } catch (e) { return void console.error("Instagram Feed: It looks like the profile you are trying to fetch is age restricted. See https://github.com/jsanahuja/InstagramFeed/issues/26") } if (void 0 !== (a = (a = JSON.parse(a.substr(0, a.length - 1))).entry_data.ProfilePage || a.entry_data.TagPage)) if (a = a[0].graphql.user || a[0].graphql.hashtag, i.get_data) i.callback(a); else { var r = { profile_container: "", profile_image: "", profile_name: "", profile_biography: "", gallery_image: "" }; if (i.styling) { r.profile_container = " style='text-align:center;'", r.profile_image = " style='border-radius:10em;width:15%;max-width:125px;min-width:50px;'", r.profile_name = " style='font-size:1.2em;'", r.profile_biography = " style='font-size:1em;'"; var n = (100 - 2 * i.margin * i.items_per_row) / i.items_per_row; r.gallery_image = " style='margin:" + i.margin + "% " + i.margin + "%;width:" + n + "%;float:left;'" } var o = ""; i.display_profile && (o += "
", o += "" + (s ? a.name + " tag pic" : a.username + " profile pic") + "", o += s ? "

#" + i.tag + "

" : "

@" + a.full_name + " (@" + i.username + ")

", !s && i.display_biography && (o += "

" + a.biography + "

"), o += "
"); var l = void 0 !== t[i.image_size] ? t[i.image_size] : t[640]; if (i.display_gallery) if (void 0 !== a.is_private && !0 === a.is_private) o += "

This profile is private

"; else { var g = (a.edge_owner_to_timeline_media || a.edge_hashtag_to_media).edges; h = g.length > i.items ? i.items : g.length, o += "", o += ""; for (var d = 0; d < h; d++) { var m, _, p = "https://www.instagram.com/p/" + g[d].node.shortcode; switch (g[d].node.__typename) { case "GraphSidecar": _ = "sidecar", m = g[d].node.thumbnail_resources[l].src; break; case "GraphVideo": _ = "video", m = g[d].node.thumbnail_src; break; default: _ = "image", m = g[d].node.thumbnail_resources[l].src } void 0 !== g[d].node.edge_media_to_caption.edges[0] && void 0 !== g[d].node.edge_media_to_caption.edges[0].node && void 0 !== g[d].node.edge_media_to_caption.edges[0].node.text && null !== g[d].node.edge_media_to_caption.edges[0].node.text ? g[d].node.edge_media_to_caption.edges[0].node.text : void 0 !== g[d].node.accessibility_caption && null !== g[d].node.accessibility_caption ? g[d].node.accessibility_caption : (s ? a.name : a.username) + " image " + d, o += "
", o += "", o += "", o += "", o += "
" } o += "", o += "" } if (i.display_igtv && void 0 !== a.edge_felix_video_timeline) { var c = a.edge_felix_video_timeline.edges, h = c.length > i.items ? i.items : c.length; if (c.length > 0) { o += "
"; for (d = 0; d < h; d++) o += "", o += "" + i.username + " instagram image " + d + "", o += ""; o += "
" } } e(i.container).html(o) } else 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") }).fail(function(e) { console.error("Instagram Feed: Unable to fetch the given user/tag. Instagram responded with the status code: ", e.status) }), !0 } }(jQuery);