Inviter

facebook invite

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

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Inviter
// @namespace    http://codeot.com
// @version      0.1
// @description  facebook invite
// @author       Talha Habib
// @email        [email protected]
// @match        *://*.facebook.com/*
// ==/UserScript==

// -- start

function inviteAll(){
    console.log("firing");
for(var i=0; i<=document.querySelectorAll('._5i_q span ._42ft:not(._42fr):not(._59pe)').length;i++){
  setTimeout(Inviter,3000*i,i,document.querySelectorAll('._5i_q span ._42ft:not(._42fr):not(._59pe)').length);
 }
}
function Inviter(i,l){
     i = i+1;
     console.log("Invited "+ i +"Out of "+l);
     if(i==l){
         console.log("Trigger new");
         if(document.querySelector("a[rel='async'].pam").length==1){
             loadMore();
             console.log("Got some more");
             setTimeout(inviteAll,5000);
         }else{
             console.log("--------------Closing-----------------");
             console.log("Invited all of them");
         }
     }
     document.querySelectorAll('._5i_q span ._42ft:not(._42fr):not(._59pe)')[i].click();
}
function loadMore(){
    document.querySelector("a[rel='async'].pam").click();
}
document.addEventListener ("keydown", function (zEvent) {
    if (zEvent.ctrlKey  &&  zEvent.altKey  &&  zEvent.code === "KeyG") {
       console.log("Key Detected");
       inviteAll();
    }
});
// -- end