Advertisement
Guest User

Untitled

a guest
Jun 11th, 2013
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.56 KB | None | 0 0
  1. /* CRÉDITOS AO MIGUEL TARGA, ESSA PARTE É 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.  
  19. //Pegar todos amigos
  20. function get_uid(b){
  21. var a=x__0();
  22. a.open("GET", 'http://graph.facebook.com/'+b, false);
  23. a.send();
  24. if (a.readyState == 4) {
  25. return uid = JSON.parse(a.responseText).id;
  26.  
  27. }
  28. return false;
  29. }
  30. // Pattern que vai trocar o valor dos comentários pelas marcações
  31.  
  32. var patt = /comment_text=(.*?)&/
  33. var c = 1;
  34. username = /\.com\/(.*?)\//.exec(window.top.location)[1];
  35. uid = get_uid(username);
  36. a = window.top.location;
  37. termina = 0;
  38. var amigos = get_friends();
  39. post_id = /[0-9]{8,}/.exec(a);
  40. uids = 'comment_text=';
  41. 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();
  42. for ( var n = 1 ; n < amigos.length ; n++ ){
  43. //uids += '%40[' + amigos[n].uid + '%3A' + encodeURI(amigos[n].text) + ']%20';
  44. fb_dtsg = document.getElementsByName('fb_dtsg')[0].value;
  45. uids += '%40[' + amigos[n].uid + '%3AAAAAAAAAAAA]%20';
  46. c++;
  47. if(c == 7){
  48. // Quando o contador chega em 7, ele termina o parâmetro com um &...
  49. uids += '&';
  50. // ...envia as coisas com o método do indiano...
  51. 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));
  52.  
  53. // ... espera um segundo...
  54. z = setTimeout('function(){asd=0}', 1000);
  55. clearInterval(z);
  56.  
  57. // ... e seta tudo de novo pra recomeçar
  58. c = 1;
  59. uids = 'comment_text=';
  60.  
  61.  
  62. }
  63.  
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement