// ==UserScript== // @name bosshelper // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author Cherokee // @match https://www.zhipin.com/vue/index/* // @grant none // @downloadURL none // ==/UserScript== (function() { 'use strict'; var retryCheck = function(checkFun,interval,nextFun,times,delay,startTime){ if(!times)times = 1; else times += 1; if(!delay)delay = 0; if(!startTime)startTime = (new Date()).getTime(); setTimeout(function(){ if(checkFun(times)){ if(delay){ var detal = delay - ((new Date()).getTime() - startTime); if(detal>0)setTimeout(nextFun,detal); else nextFun(); }else nextFun(); }else retryCheck(checkFun,interval,nextFun,times,delay,startTime); },interval); } window.addEventListener('load',_=>{ if(window.location.href.startsWith('https://www.zhipin.com/vue/index/#/dashboard/candidate/recommend')){ retryCheck(_=>{ let lst = document.querySelectorAll('#recommend-list li'); return lst && lst.length>0; },500,_=>{ let checking = null; let el = document.createElement('button'); el.setAttribute('style','width:80px;height:30px;color:white;background-color:red'); el.innerText = '自动撩人'; document.querySelector('.op-filter').appendChild(el); el.addEventListener('click',function(e){ if(checking){ window.clearInterval(checking); el.innerText = '自动撩人'; }else{ let keyword = window.prompt('请输入关键词','行业研究'); let lst = document.querySelector('#recommend-list li'); let ct = 1; checking = window.setInterval(_=>{ if(lst){ el.innerText = '停止撩人'; lst.scrollIntoView(true); if(lst.querySelector('.col-3').innerText.includes(keyword)){ lst.querySelector('button.btn-greet').click(); lst.style.backgroundColor = 'green'; }else{ lst.style.backgroundColor = 'red'; } lst = lst.nextSibling; ct++; }else{ window.clearInterval(checking); el.innerText = '自动撩人'; } },2000); } },false); }); } },false); })();