Advertisement
clickio

cusquices.com Clickio/AdSense rotation

Nov 30th, 2020
752
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 6.41 KB | None | 0 0
  1. <!-- Code for HEAD -->
  2. <script type="text/javascript">
  3. /* Minified universal Clickio rotating code. Unminified version with comments you can find here https://adexchange.clickio.com/public/clickio_universal_rotating_code */
  4. /* src: 2018-10-23 21:09:40 */
  5. (function(){function E(a){var c=null,b=F("ClickioRotator");b&&e(a[b])&&(!e(a[b].condition)||a[b].condition())&&(c=""+b);if(!c){var d=0;l(a,function(a,b){if(e(b.condition)&&b.condition()||!e(b.condition))a=b.weight,d+=""===a?0:parseInt(a,10)});if(0<d){var m=Math.floor(Math.random()*(Math.round(d)-1+1))+1,g=0;l(a,function(a,b){if(e(b.condition)&&b.condition()||!e(b.condition))if(g+=parseInt(b.weight,10),g>=m)return c=a,!1})}}return c}function y(a,c,b,d){d=d||!1;if(!e(a)||!e(a.ownerDocument))return!1;
  6. var m=a.ownerDocument;if(!G(a,a.ownerDocument.defaultView))return!1;if(c){var g=[];if(b||d){b=a.firstChild;var f=n("div",m);for(f.innerHTML=c;f.firstChild;)p(f.firstChild)?g.push(f.firstChild):r(f.firstChild.childNodes,function(a){p(f.firstChild.childNodes[a])&&g.push(f.firstChild.childNodes[a])}),d?a.insertBefore(f.firstChild,b):a.appendChild(f.firstChild)}else a.innerHTML=c,r(a.childNodes,function(b){p(a.childNodes[b])?g.push(a.childNodes[b]):r(a.childNodes[b].childNodes,function(c){p(a.childNodes[b].childNodes[c])&&
  7. g.push(a.childNodes[b].childNodes[c])})});g.length&&l(g,function(b){var c=g[b].parentNode;c?c.removeChild(g[b]):c=a;b=g[b];var d=m;d=d||k;c=c||H;var f=n("script",d);f.type="text/javascript";if(e(b.src)&&b.src)f.src=b.src,f.className=b.className;else{var h=b.text||b.textContent||b.innerHTML||"";f.className=b.className;f.appendChild(d.createTextNode(h))}c.appendChild(f)})}}function F(a,c){var b=z(q.location.search),d=null;e(b[a])?d=b[a]:(b=z(q.location.hash),e(b[a])?d=b[a]:d=c||null);return d}function A(){e(k.body)&&
  8. k.body||setTimeout(A,10)}function B(a,c){return e(c)?(c=Math.pow(10,c),Math.round(a*c)/c):Math.round(a)}function I(a){a=a||10;if(10<a){for(var c="",b=10;0<a;)c+=Math.round(Math.pow(36,b+1)-Math.random()*Math.pow(36,b)).toString(36).slice(1),a-=b,a<b&&(b=a);return c}return Math.round(Math.pow(36,a+1)-Math.random()*Math.pow(36,a)).toString(36).slice(1)}function e(a){return"undefined"!=typeof a}function C(a,c){c=e(c)?c:!1;return e(a)?a:c}function D(a,c,b){b=b||k;return c?b.getElementsByTagName(a):b.getElementsByTagName(a)[0]}
  9. function l(a,c){for(var b in a)if(a.hasOwnProperty(b)&&"length"!==b&&!1===c.call(a[b],b,a[b]))break}function r(a,c){for(var b=0;b<a.length&&(!a.hasOwnProperty(b)||"length"===b||!1!==c.call(a[b],b,a[b]));b++);}function z(a){if(!e(t[a])){a=a.split("+").join(" ");for(var c={},b=("?"===a[0]||"#"===a[0]?a.substr(1):a).split("&"),d=0;d<b.length;d++){var m=b[d].split("=");c[decodeURIComponent(m[0])]=decodeURIComponent(m[1]||"")}t[a]=c}return t[a]}function n(a,c){c=c||k;return c.createElement(a)}function u(a,
  10. c){if(null==a||"object"!==typeof a)return a;if(void 0==c)c=[];else{var b,d=c.length;for(b=0;b<d;b++)if(a===c[b])return a}c.push(a);if("function"==typeof a.clone)return a.clone(!0);if("[object Array]"==Object.prototype.toString.call(a)){d=a.slice();for(b=d.length;b--;)d[b]=u(d[b],c);return d}if(a instanceof Date)return new Date(a.getTime());if(a instanceof RegExp)return new RegExp(a);if(a.nodeType&&"function"==typeof a.cloneNode)return a.cloneNode(!0);b=Object.getPrototypeOf?Object.getPrototypeOf(a):
  11. a.__proto__;b||(b=a.constructor.prototype);d=v(b);for(var e in a)d[e]=u(a[e],c);return d}function G(a,c){c=c||q;return e(a)?a instanceof c.HTMLElement:!1}function p(a){return e(a)&&a.nodeName&&"script"===a.nodeName.toLowerCase()&&(!a.type||"text/javascript"===a.type.toLowerCase())}var k=document,q=window,H=function(a){a=a||k;var c=a.documentElement,b=D("head",!1,a);if(b)return b;for(b=c.firstChild;b&&"#text"==b.nodeName.toLowerCase();)b=b.nextSibling;if(b&&"#text"!=b.nodeName.toLowerCase())return b;
  12. a=n("head",a);c.appendChild(a);return a}();A();var t={},v=Object.create;"function"!==typeof v&&(v=function(a){function c(){}c.prototype=a;return new c});var w=Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)},x=!1;"complete"!==k.readyState&&(x=!0,k.addEventListener("readystatechange",function(){"complete"==k.readyState&&(x=!1)},!1));q.ClickioRotator=function(a){a=u(a);var c=E(a),b=I(15)+((new Date).getTime()%1E7*100+B(99*Math.random()));return c?(e(a[c].head)&&
  13. y(D("head"),a[c].head,!0),{getSession:function(){return b},getChosenVariantId:function(){return c},install:function(){var a=null,b=null;2==arguments.length?(b=arguments[0],a=arguments[1]):a=arguments[0];a&&e(a[c])&&(w(a[c])||(a[c]=[[a[c]]]),l(a[c],function(d){d=a[c][d];w(d)||(d=[d]);var e=C(d[0]),h=C(d[1]);!h&&e&&(h=e,e="html");w(h)||(h=[h]);if("track"==e)l(h,function(a){n("img").src=h[a]+"&_lxrnd_="+((new Date).getTime()%1E7*100+B(99*Math.random()))});else if(x&&!b)l(h,function(a){k.write(h[a])});
  14. else if(b){var g=k.querySelector(b);g&&l(h,function(a){y(g,h[a],!0)})}}))}}):null}})();
  15.  
  16. var config = {
  17. 'clickio': {
  18.    'weight': 50
  19.    },
  20. 'adsense': {
  21.    'weight': 50
  22.    }
  23. };
  24.  
  25. var ClickioRotatorEntity = new ClickioRotator(config);
  26.  
  27. </script>
  28.  
  29.  
  30. <!-- Code for BODY, insert to needed place -->
  31. <div id="rotator_wrapper">
  32.     <script>
  33.         ClickioRotatorEntity.install("#rotator_wrapper" ,{
  34.             'clickio':   [
  35.                 ["html",  "<scr" + "ipt async type='text/javascript' src='//s.clickiocdn.com/t/219850/360_light.js'><\/scr" + "ipt>" +
  36.                           "<scr" + "ipt class='__lxGc__' type='text/javascript'>" +
  37.                           "((__lxGc__=window.__lxGc__||{'s':{},'b':0})['s']['_219850']=__lxGc__['s']['_219850']||{'b':{}})['b']['_664705']={'i':__lxGc__.b++};" +
  38.                           "<\/scr" + "ipt>"]
  39.             ],
  40.             'adsense':   [
  41.                 ["html", "<scr" + "ipt async src=\"https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js\"><\/scr" + "ipt>" +
  42.                          "<ins class=\"adsbygoogle\" " +
  43.                         "style=\"display:block; text-align:center;\" " +
  44.                         "data-ad-layout=\"in-article\" "+
  45.                         "data-ad-format=\"fluid\" " +
  46.                         "data-ad-client=\"ca-pub-4939064447941922\" " +
  47.                         "data-ad-slot=\"7064664978\"></ins>" +
  48.                          "<scr" + "ipt>" +
  49.                          "(adsbygoogle = window.adsbygoogle || []).push({});" +
  50.                          "<\/scr" + "ipt>"]
  51.             ],                
  52.            
  53.         });
  54.     </script>
  55. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement