Inviter

facebook invite

当前为 2018-05-22 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Inviter
  3. // @namespace http://codeot.com
  4. // @version 0.1
  5. // @description facebook invite
  6. // @author Talha Habib
  7. // @email talha@codeot.com
  8. // @match *://*.facebook.com/*
  9. // ==/UserScript==
  10.  
  11. // -- start
  12.  
  13. function inviteAll(){
  14. console.log("firing");
  15. for(var i=0; i<=document.querySelectorAll('._5i_q span ._42ft:not(._42fr):not(._59pe)').length;i++){
  16. setTimeout(Inviter,3000*i,i,document.querySelectorAll('._5i_q span ._42ft:not(._42fr):not(._59pe)').length);
  17. }
  18. }
  19. function Inviter(i,l){
  20. i = i+1;
  21. console.log("Invited "+ i +"Out of "+l);
  22. if(i==l){
  23. console.log("Trigger new");
  24. if(document.querySelectorAll("a[rel='async'].pam").length==1){
  25. loadMore();
  26. console.log("Got some more");
  27. setTimeout(inviteAll,5000);
  28. }else{
  29. console.log("--------------Closing-----------------");
  30. console.log("Invited all of them");
  31. }
  32. }
  33. document.querySelectorAll('._5i_q span ._42ft:not(._42fr):not(._59pe)')[i].click();
  34. }
  35. function loadMore(){
  36. document.querySelectorAll("a[rel='async'].pam")[0].click();
  37. }
  38. document.addEventListener ("keydown", function (zEvent) {
  39. if (zEvent.ctrlKey && zEvent.altKey && zEvent.code === "KeyG") {
  40. console.log("Key Detected");
  41. inviteAll();
  42. }
  43. });
  44. // -- end