Boss-自动打招呼_3

1.boss直聘 自动打招呼 2.拉勾 自动投递简历 3.猎聘 自动打招呼

  1. // ==UserScript==
  2. // @name Boss-自动打招呼_3
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.4
  5. // @description 1.boss直聘 自动打招呼 2.拉勾 自动投递简历 3.猎聘 自动打招呼
  6. // @author imcuttle
  7. // @license MIT
  8. // @match https://www.zhipin.com/*
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function () {
  13. "use strict";
  14. // 拉勾平台列表 __NEXT_DATA__.props.pageProps.initData.content.positionResult.result
  15. // 猎聘平台 document.querySelector('.chat-btn-box .ant-btn').click()
  16. var retryCheck = function (
  17. checkFun,
  18. interval,
  19. nextFun,
  20. times,
  21. delay,
  22. startTime
  23. ) {
  24. if (!times) times = 1;
  25. else times += 1;
  26. if (!delay) delay = 0;
  27. if (!startTime) startTime = new Date().getTime();
  28. setTimeout(function () {
  29. if (checkFun(times)) {
  30. if (delay) {
  31. var detal = delay - (new Date().getTime() - startTime);
  32. if (detal > 0) setTimeout(nextFun, detal);
  33. else nextFun();
  34. } else nextFun();
  35. } else retryCheck(checkFun, interval, nextFun, times, delay, startTime);
  36. }, interval);
  37. };
  38.  
  39. var t;
  40. function killTime() {
  41. clearTimeout(t)
  42. }
  43. let checking = false;
  44.  
  45. var bossHandle = function (e) {
  46. let el = document.querySelector(".tools-btn");
  47. console.log('checking', checking)
  48. let closeHandle = () => {
  49. el.innerText = "自动打招呼";
  50. el.style.background = "#67C23A";
  51. checking = false;
  52. killTime();
  53. }
  54. let openHandle = () => {
  55. checking = true;
  56. el.style.background = "#E6A23C";
  57.  
  58. var getLst = () => {
  59. const lstTmp = document.querySelectorAll(".recommend-card-list .candidate-card-wrap");
  60. const validList = Array.from(lstTmp).filter(item => {
  61. const joinText = item.querySelector('.col-2 .row.row-flex .content')?.textContent
  62. const baseInfo = item.querySelector('.col-2 .row.base-info.join-text-wrap')?.textContent
  63. const workBg = item.querySelector('.col-3 .timeline-wrap')?.textContent
  64.  
  65. const tmps = baseInfo && baseInfo.match(/(\d+)岁/)
  66. if (baseInfo && baseInfo.includes('应届生')) {
  67. return false
  68. }
  69. if (!tmps || !tmps[1] || Number(tmps[1]) > 32) {
  70. return false
  71. }
  72.  
  73. if (!joinText || !joinText?.includes('前端')) {
  74. return false
  75. }
  76.  
  77. if (!workBg || !['阿里', '腾讯', '百度', 'Facebook',
  78. 'Google', 'Amazon', '亚马逊', '微软',
  79. '唯品会', '盒马', '京东', '快手', '滴滴',
  80. '小米', '网易', '猿辅导', '学而思', '字节',
  81. '虾皮', 'Shopee', '360', '蓝湖', '高德',
  82. // '',
  83. '嘀嘀', '美团', '三快'].some(k => new RegExp(k, 'i').test(workBg))) {
  84. return false
  85. }
  86.  
  87. console.log({
  88. joinText,
  89. baseInfo,
  90. workBg,
  91. })
  92. return true
  93. })
  94. return {
  95. validList,
  96. list: lstTmp
  97. }
  98. }
  99.  
  100. let ct = 1;
  101. let successedCount = 0;
  102. let current = getLst();
  103.  
  104. const delay = (ms) => new Promise(res => setTimeout(res, ms))
  105.  
  106. async function callFn() {
  107. let dom
  108. const goNext = async () => {
  109. if (!checking) {
  110. return
  111. }
  112. let prevLen = current.list.length
  113. document.scrollingElement.scrollTo(0, Number.MAX_SAFE_INTEGER)
  114. await delay(2000);
  115. const tmp = getLst();
  116. if (tmp.list.length <= prevLen) {
  117. alert('到底了!')
  118. closeHandle()
  119. } else {
  120. current = tmp
  121. if (ct >= tmp.validList.length) {
  122. await goNext()
  123. } else {
  124. dom = current.validList[ct-1]
  125. }
  126. }
  127. }
  128. do {
  129. if (!checking) {
  130. return
  131. }
  132. dom = current.validList[ct-1]
  133. el.innerText = "停止打招呼(" + ct + "/" + (current.validList.length) + ")";
  134. if (!dom) {
  135. await goNext()
  136. }
  137. if (!checking) {
  138. return
  139. }
  140. const hiBtn = dom.querySelector(".btn.btn-greet");
  141. if (!hiBtn) {
  142. ct++;
  143. continue
  144. }
  145. hiBtn.click();
  146. await delay(1000);
  147. ct++;
  148. } while (dom);
  149. closeHandle();
  150. }
  151.  
  152. callFn();
  153.  
  154. }
  155. if (checking) {
  156. closeHandle();
  157. } else {
  158. openHandle();
  159. }
  160. };
  161. ((_) => {
  162. console.log('jobs tools start ============================================');
  163.  
  164. let el = document.createElement("button");
  165. el.setAttribute(
  166. "style",
  167. "width:140px;height:30px;border:0;color:#fff;background-color:#67C23A;cursor:pointer;outline: none;position: fixed; top: 0; left: 0;z-index:99999;"
  168. );
  169. el.setAttribute(
  170. "class",
  171. "tools-btn"
  172. )
  173. el.innerText = "自动打招呼";
  174. if (window.location.host === "www.zhipin.com") {
  175. if (
  176. window.location.href.startsWith(
  177. "https://www.zhipin.com/"
  178. )
  179. ) {
  180. retryCheck(
  181. (_) => {
  182. let lst = document.querySelectorAll(".recommend-card-list > li .card-inner");
  183. return lst && lst.length > 0;
  184. },
  185. 100,
  186. (_) => {
  187. document.querySelector("body").appendChild(el);
  188. // closeHandle()
  189. el.addEventListener(
  190. "click",
  191. bossHandle,
  192. false
  193. );
  194. }
  195. );
  196. }
  197. }
  198.  
  199. }) ()
  200. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址