Ubuntu

­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­ (function(){var t,i,e;t=function(){function t(t,i){var e,o;if(this.options={target:"instafeed",get:"popular",resolution:"thumbnail",sortBy:"none",links:!0,mock:!1,useHttp:!1,afterLoad:null,api:"old",overlay:"",filter:"show"},"object"==typeof t)for(e in t)o=t[e],this.options[e]=o;this.context=null!=i?i:this,this.unique=this._genKey()}return t.prototype.hasNext=function(){return"string"==typeof this.context.nextUrl&&this.context.nextUrl.length>0},t.prototype.next=function(){return!!this.hasNext()&&this.run(this.context.nextUrl)},t.prototype.run=function(t){return this.parse(this.options.feed),!0},t.prototype.parse=function(t){var i,e,o,n,s,r,a,p,l,c,h,u,d,f,m,y,g,v,_,w;if("object"!=typeof t){if(null!=this.options.error&&"function"==typeof this.options.error)return this.options.error.call(this,"Invalid JSON data"),!1;throw new Error("Invalid JSON response")}var k=this.options.filter;if(0===t.data.length){if(null!=this.options.error&&"function"==typeof this.options.error)return this.options.error.call(this,"No images were returned from Instagram"),!1;throw new Error("No images were returned from Instagram")}if(null!=this.options.success&&"function"==typeof this.options.success&&this.options.success.call(this,t),this.context.nextUrl="",null!=t.pagination&&(this.context.nextUrl=t.pagination.next_url),"none"!==this.options.sortBy)switch(g="least"===(v="random"===this.options.sortBy?["","random"]:this.options.sortBy.split("-"))[0],v[1]){case"random":t.data.sort(function(){return.5-Math.random()});break;case"recent":t.data=this._sortBy(t.data,"created_time",g);break;case"liked":t.data=this._sortBy(t.data,"likes.count",g);break;case"commented":t.data=this._sortBy(t.data,"comments.count",g);break;default:throw new Error("Invalid option for sortBy: '"+this.options.sortBy+"'.")}if("undefined"!=typeof document&&null!==document&&!1===this.options.mock){for(c=t.data,y=parseInt(this.options.limit,10),null!=this.options.limit&&c.length>y&&(c=c.slice(0,y)),s=document.createDocumentFragment(),null!=this.options.filter&&"function"==typeof this.options.filter&&(c=this._filter(c,this.options.filter)),r="","",u="",w=document.createElement("div"),a=0,d=c.length;a=0&&!this.options.useHttp&&(l=l.replace(/https?:\/\//,"//"));var x=[!0];p.tags=this._extractTags(p.caption),""!==this.options.tagName&&this.options.tagName.forEach(function(t,i){t=t.toLowerCase(),-1===p.tags.indexOf(t)?x[i]=!1:x[i]=!0,"hide"===k&&(x[i]=!x[i])});var b=p.caption;p.caption&&""!==this.options.words&&(b=p.caption.split(/\s+/).slice(0,this.options.words).join(" "),b+="..."),-1!==x.indexOf(!0)&&(r+=this._makeTemplate({model:p,id:p.id,link:"old"===this.options.api?p.link:p.permalink,type:p.media_type,image:l,video:u,orientation:h,caption:b,likes:"old"===this.options.api&&p.likes.count,comments:"old"===this.options.api&&p.comments.count,location:this._getObjectProperty(p,"location.name")}))}for(w.innerHTML=r,o=[],e=0,i=w.childNodes.length;e\?,\./|\\\s]+/i,o=[];if("string"==typeof t)for(;null!==(match=i.exec(t));)!1===e.test(match[1])&&o.push(match[1].toLowerCase());return o},t.prototype._genKey=function(){var t;return""+(t=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)})()+t()+t()+t()},t.prototype._makeTemplate=function(t){var i,e,o,n,s;e=/(?:\{{2})([\w\[\]\.]+)(?:\}{2})/;var r=this.options.templateData;for(i='
',"VIDEO"===t.type&&(i+="",["click","hover"].includes(this.options.videos)&&(i+='')),i+="
",this.options.overlay&&""!=this.options.overlay&&(i+='
'),""!=r.description&&(i+='
'+r.likes+r.comments+r.description+"
"),this.options.overlay&&""!=this.options.overlay&&(i+="
"),"redirect"!==this.options.videos&&"VIDEO"===t.type&&(r.link=""),i+=r.link+"
"+r.share+"
";e.test(i);)n=i.match(e)[1],s=null!=(o=this._getObjectProperty(t,n))?o:"",i=i.replace(e,function(){return""+s});return i},t.prototype._getObjectProperty=function(t,i){var e,o;for(o=(i=i.replace(/\[(\w+)\]/g,".$1")).split(".");o.length;){if(e=o.shift(),!(null!=t&&e in t))return null;t=t[e]}return t},t.prototype._sortBy=function(t,i,e){var o;return o=function(t,o){var n,s;return n=this._getObjectProperty(t,i),s=this._getObjectProperty(o,i),e?n>s?1:-1:n