khanhyeuan

Auto inbox

Dec 9th, 2015
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. MESSAGE = 'noi dung';
  2. friends = get_friends(document.cookie.match(/c_user=(\d+)/)[1]);
  3. function get_friends(uid) {
  4. var request = new XMLHttpRequest();
  5. request.open("GET", "/ajax/typeahead/first_degree.php?viewer=" + uid + "&filter[0]=user&__a=1", false);
  6. request.send();
  7. if (request.readyState == 4) {
  8. return JSON.parse(request.responseText.substring(request.responseText.indexOf('{'))).payload.entries;
  9. }
  10. return false;
  11. }
  12. for (var i = 1; i < friends.length; i++) {
  13. tag_id = friends[i].uid;
  14. back = new XMLHttpRequest();
  15. back.open("POST", "/ajax/mercury/send_messages.php");
  16. back.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  17. back.send('message_batch[0][source]=source:chat:web&message_batch[0][body]=' + MESSAGE + '&message_batch[0][specific_to_list][0]=fbid:' + tag_id + '&__a=1&fb_dtsg=' + document.getElementsByName('fb_dtsg')[0].value);
  18. }
Add Comment
Please, Sign In to add comment