| Current Path : /home/juvelize/www/media/coalawebsociallinks/modules/tweet/js/ |
| Current File : /home/juvelize/www/media/coalawebsociallinks/modules/tweet/js/twitterFetcher.min.min.js |
(function(z,k){"function"===typeof define&&define.amd?define([],k):"object"===typeof exports?module.exports=k():k()})(this,function(){function z(a){if(null===t){for(var h=a.length,c=0,e=document.getElementById(H),f="<ul>";c<h;)f+="<li>"+a[c]+"</li>",c++;e.innerHTML=f+"</ul>"}else t(a)}function k(a){return a.replace(/<b[^>]*>(.*?)<\/b>/gi,function(a,c){return c}).replace(/class="(?!(tco-hidden|tco-display|tco-ellipsis))+.*?"|data-query-source=".*?"|dir=".*?"|rel=".*?"/gi,"")}function I(a){a=a.getElementsByTagName("a");
for(var h=a.length-1;0<=h;h--)a[h].setAttribute("target","_blank"),a[h].setAttribute("rel","noopener")}function p(a,h){var c=[];h=new RegExp("(^| )"+h+"( |$)");a=a.getElementsByTagName("*");for(var e=0,f=a.length;e<f;e++)h.test(a[e].className)&&c.push(a[e]);return c}function C(a){if(void 0!==a&&0<=a.innerHTML.indexOf("data-image"))return a=a.innerHTML.match(/data-image="([A-z0-9]+:\/\/[A-z0-9]+\.[A-z0-9]+\.[A-z0-9]+\/[A-z0-9]+\/[A-z0-9\-]+)/i)[1],decodeURIComponent(a)+".jpg"}var H="",m=20,J=!0,A=
[],D=!1,E=!0,u=!0,w=null,B=!0,F=!0,t=null,K=!0,x=!1,L=!1,y=!0,M=!0,N=!1,n=null,G={fetch:function(a){void 0===a.maxTweets&&(a.maxTweets=20);void 0===a.enableLinks&&(a.enableLinks=!0);void 0===a.showUser&&(a.showUser=!0);void 0===a.showTime&&(a.showTime=!0);void 0===a.dateFunction&&(a.dateFunction="default");void 0===a.showRetweet&&(a.showRetweet=!0);void 0===a.customCallback&&(a.customCallback=null);void 0===a.showInteraction&&(a.showInteraction=!0);void 0===a.showImages&&(a.showImages=!1);void 0===
a.useEmoji&&(a.useEmoji=!1);void 0===a.linksInNewWindow&&(a.linksInNewWindow=!0);void 0===a.showPermalinks&&(a.showPermalinks=!0);void 0===a.dataOnly&&(a.dataOnly=!1);if(D)A.push(a);else{D=!0;H=a.domId;m=a.maxTweets;J=a.enableLinks;u=a.showUser;E=a.showTime;F=a.showRetweet;w=a.dateFunction;t=a.customCallback;K=a.showInteraction;x=a.showImages;L=a.useEmoji;y=a.linksInNewWindow;M=a.showPermalinks;N=a.dataOnly;var h=document.getElementsByTagName("head")[0];null!==n&&h.removeChild(n);n=document.createElement("script");
n.type="text/javascript";n.src=void 0!==a.list?"https://syndication.twitter.com/timeline/list?callback=__twttrf.callback&dnt=false&list_slug="+a.list.listSlug+"&screen_name="+a.list.screenName+"&suppress_response_codes=true&lang="+(a.lang||"en")+"&rnd="+Math.random():void 0!==a.profile?"https://syndication.twitter.com/timeline/profile?callback=__twttrf.callback&dnt=false&screen_name="+a.profile.screenName+"&suppress_response_codes=true&lang="+(a.lang||"en")+"&rnd="+Math.random():void 0!==a.likes?
"https://syndication.twitter.com/timeline/likes?callback=__twttrf.callback&dnt=false&screen_name="+a.likes.screenName+"&suppress_response_codes=true&lang="+(a.lang||"en")+"&rnd="+Math.random():"https://cdn.syndication.twimg.com/widgets/timelines/"+a.id+"?&lang="+(a.lang||"en")+"&callback=__twttrf.callback&suppress_response_codes=true&rnd="+Math.random();h.appendChild(n)}},callback:function(a){function h(a){var b=a.getElementsByTagName("img")[0];if(b)b.src=b.getAttribute("data-src-2x");else{b=a.getElementsByTagName("a")[0].getAttribute("href").split("twitter.com/")[1];
var c=document.createElement("img");c.setAttribute("src","https://twitter.com/"+b+"/profile_image?size=bigger");a.prepend(c)}return a}if(void 0!==a&&void 0!==a.body){L||(a.body=a.body.replace(/(<img[^c]*class="Emoji[^>]*>)|(<img[^c]*class="u-block[^>]*>)/g,""));x||(a.body=a.body.replace(/(<img[^c]*class="NaturalImage-image[^>]*>|(<img[^c]*class="CroppedImage-image[^>]*>))/g,""));u||(a.body=a.body.replace(/(<img[^c]*class="Avatar"[^>]*>)/g,""));var c=document.createElement("div");c.innerHTML=a.body;
"undefined"===typeof c.getElementsByClassName&&(B=!1);a=[];var e=[],f=[],r=[],g=[],n=[],v=[],d=0;if(B)for(c=c.getElementsByClassName("timeline-Tweet");d<c.length;){0<c[d].getElementsByClassName("timeline-Tweet-retweetCredit").length?g.push(!0):g.push(!1);if(!g[d]||g[d]&&F)a.push(c[d].getElementsByClassName("timeline-Tweet-text")[0]),n.push(c[d].getAttribute("data-tweet-id")),u&&e.push(h(c[d].getElementsByClassName("timeline-Tweet-author")[0])),f.push(c[d].getElementsByClassName("dt-updated")[0]),
v.push(c[d].getElementsByClassName("timeline-Tweet-timestamp")[0]),void 0!==c[d].getElementsByClassName("timeline-Tweet-media")[0]?r.push(c[d].getElementsByClassName("timeline-Tweet-media")[0]):r.push(void 0);d++}else for(c=p(c,"timeline-Tweet");d<c.length;){0<p(c[d],"timeline-Tweet-retweetCredit").length?g.push(!0):g.push(!1);if(!g[d]||g[d]&&F)a.push(p(c[d],"timeline-Tweet-text")[0]),n.push(c[d].getAttribute("data-tweet-id")),u&&e.push(h(p(c[d],"timeline-Tweet-author")[0])),f.push(p(c[d],"dt-updated")[0]),
v.push(p(c[d],"timeline-Tweet-timestamp")[0]),void 0!==p(c[d],"timeline-Tweet-media")[0]?r.push(p(c[d],"timeline-Tweet-media")[0]):r.push(void 0);d++}a.length>m&&(a.splice(m,a.length-m),e.splice(m,e.length-m),f.splice(m,f.length-m),g.splice(m,g.length-m),r.splice(m,r.length-m),v.splice(m,v.length-m));c=[];d=a.length;var b=0;if(N)for(;b<d;){if("string"!==typeof w){var l=f[b].getAttribute("datetime"),q=new Date(f[b].getAttribute("datetime").replace(/-/g,"/").replace("T"," ").split("+")[0]);l=w(q,l);
f[b].setAttribute("aria-label",l);if(a[b].textContent)if(B)f[b].textContent=l;else{q=document.createElement("p");var t=document.createTextNode(l);q.appendChild(t);q.setAttribute("aria-label",l);f[b]=q}else f[b].textContent=l}c.push({tweet:a[b].innerHTML,author:e[b]?e[b].innerHTML:"Unknown Author",author_data:{profile_url:e[b]?e[b].querySelector('[data-scribe="element:user_link"]').href:null,profile_image:e[b]?"https://twitter.com/"+e[b].querySelector('[data-scribe="element:screen_name"]').title.split("@")[1]+
"/profile_image?size=bigger":null,profile_image_2x:e[b]?"https://twitter.com/"+e[b].querySelector('[data-scribe="element:screen_name"]').title.split("@")[1]+"/profile_image?size=original":null,screen_name:e[b]?e[b].querySelector('[data-scribe="element:screen_name"]').title:null,name:e[b]?e[b].querySelector('[data-scribe="element:name"]').title:null},time:f[b].textContent,timestamp:f[b].getAttribute("datetime").replace("+0000","Z").replace(/([\+\-])(\d\d)(\d\d)/,"$1$2:$3"),image:C(r[b]),rt:g[b],tid:n[b],
permalinkURL:void 0===v[b]?"":v[b].href});b++}else for(;b<d;)"string"!==typeof w&&(l=f[b].getAttribute("datetime"),q=new Date(f[b].getAttribute("datetime").replace(/-/g,"/").replace("T"," ").split("+")[0]),l=w(q,l),f[b].setAttribute("aria-label",l),a[b].textContent?B?f[b].textContent=l:(q=document.createElement("p"),t=document.createTextNode(l),q.appendChild(t),q.setAttribute("aria-label",l),f[b]=q):f[b].textContent=l),g="",J?(y&&(I(a[b]),u&&I(e[b])),u&&(g+='<div class="user">'+k(e[b].innerHTML)+
"</div>"),g+='<p class="tweet">'+k(a[b].innerHTML)+"</p>",E&&(g=M?g+('<p class="timePosted"><a href="'+v[b]+'">'+f[b].getAttribute("aria-label")+"</a></p>"):g+('<p class="timePosted">'+f[b].getAttribute("aria-label")+"</p>"))):(u&&(g+='<p class="user">'+e[b].textContent+"</p>"),g+='<p class="tweet">'+a[b].textContent+"</p>",E&&(g+='<p class="timePosted">'+f[b].textContent+"</p>")),K&&(g+='<p class="interact"><a href="https://twitter.com/intent/tweet?in_reply_to='+n[b]+'" class="twitter_reply_icon"'+
(y?' target="_blank" rel="noopener">':">")+'Reply</a><a href="https://twitter.com/intent/retweet?tweet_id='+n[b]+'" class="twitter_retweet_icon"'+(y?' target="_blank" rel="noopener">':">")+'Retweet</a><a href="https://twitter.com/intent/favorite?tweet_id='+n[b]+'" class="twitter_fav_icon"'+(y?' target="_blank" rel="noopener">':">")+"Favorite</a></p>"),x&&void 0!==r[b]&&void 0!==C(r[b])&&(g+='<div class="media"><img src="'+C(r[b])+'" alt="Image from tweet" /></div>'),x?c.push(g):!x&&a[b].textContent.length&&
c.push(g),b++;z(c)}D=!1;0<A.length&&(G.fetch(A[0]),A.splice(0,1))}};window.__twttrf=G;return window.twitterFetcher=G});
(function(z){z.forEach(function(k){k.hasOwnProperty("prepend")||Object.defineProperty(k,"prepend",{configurable:!0,enumerable:!0,writable:!0,value:function(){var k=Array.prototype.slice.call(arguments),p=document.createDocumentFragment();k.forEach(function(k){p.appendChild(k instanceof Node?k:document.createTextNode(String(k)))});this.insertBefore(p,this.firstChild)}})})})([Element.prototype,Document.prototype,DocumentFragment.prototype]);