daily pastebin goal
3%
SHARE
TWEET

Untitled

a guest May 16th, 2018 93 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var isMobile = {
  2.     Android: function() {
  3.         return navigator["userAgent"]["match"](/Android/i)
  4.     },
  5.     BlackBerry: function() {
  6.         return navigator["userAgent"]["match"](/BlackBerry/i)
  7.     },
  8.     iOS: function() {
  9.         return navigator["userAgent"]["match"](/iPhone|iPad|iPod/i)
  10.     },
  11.     Opera: function() {
  12.         return navigator["userAgent"]["match"](/Opera Mini/i)
  13.     },
  14.     Windows: function() {
  15.         return navigator["userAgent"]["match"](/IEMobile/i)
  16.     },
  17.     any: function() {
  18.         return (isMobile.Android() || isMobile.BlackBerry() || isMobile["iOS"]() || isMobile.Opera() || isMobile.Windows())
  19.     }
  20. };
  21. var ini_btnShare = function() {
  22.     var variable_0 = document["querySelector"]("a[shdwsp]");
  23.     var variable_1 = document["querySelector"]("a[data-cpa]");
  24.     var variable_2 = document["querySelector"]("span[shdwsp_counter]");
  25.     var variable_3 = 0;
  26.     var variable_4 = variable_0["getAttribute"]("shared-max");
  27.     var variable_5 = "wexnchdpxix";
  28.     variable_2["innerHTML"] = variable_4;
  29.     variable_1["onclick"] = function() {
  30.         var variable_6 = variable_1["getAttribute"]("data-cpa");
  31.         if (getCookie(variable_5) == "completed") {
  32.             window["location"]["href"] = variable_6
  33.         }
  34.     };
  35.     variable_0["onclick"] = function() {
  36.         if (isMobile["any"]()) {
  37.             var variable_7 = variable_0["getAttribute"]("data-text");
  38.             var variable_8 = variable_0["getAttribute"]("data-link");
  39.             var variable_9 = encodeURIComponent(variable_7) + " - " + encodeURIComponent(variable_8);
  40.             if (variable_4 != 0) {
  41.                 var variable_10 = "whatsapp://send?text=" + variable_9;
  42.                 window["location"]["href"] = variable_10;
  43.                 variable_4--;
  44.                 setCookie(variable_5, variable_4, 5);
  45.                 variable_2["innerHTML"] = variable_4;
  46.                 if (variable_4 <= 0) {
  47.                     setCookie(variable_5, "completed", 5);
  48.                     variable_1["classList"]["add"]("btnActive")
  49.                 }
  50.             }
  51.         } else {
  52.             alert("Please share this article in mobile device")
  53.         }
  54.     }
  55. };
  56.  
  57. function setCookie(variable_11, variable_120, variable_121) {
  58.     var variable_122 = new Date();
  59.     variable_122["setTime"](variable_122["getTime"]() + (variable_121 * 24 * 60 * 60 * 1000));
  60.     var variable_123 = "expires=" + variable_122["toUTCString"]();
  61.     document["cookie"] = variable_11 + "=" + variable_120 + ";" + variable_123 + ";path=/"
  62. }
  63.  
  64. function getCookie(variable_11) {
  65.     var variable_125 = variable_11 + "=";
  66.     var variable_126 = document["cookie"]["split"](";");
  67.     for (var variable_127 = 0; variable_127 < variable_126["length"]; variable_127++) {
  68.         var variable_128 = variable_126[variable_127];
  69.         while (variable_128["charAt"](0) == " ") {
  70.             variable_128 = variable_128["substring"](1)
  71.         };
  72.         if (variable_128["indexOf"](variable_125) == 0) {
  73.             return variable_128["substring"](variable_125["length"], variable_128["length"])
  74.         }
  75.     };
  76.     return ""
  77. }
  78. window[addEventListener ? "addEventListener" : "attachEvent"](addEventListener ? "load" : "onload", ini_btnShare)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top