// ==UserScript== // @name BOSS 直聘 跨境黑名单 // @namespace https://github.com/MaiXiaoMeng // @version 0.0.1 // @description 可以在 BOSS 直聘上 显示 若比邻的 黑名单,应 Facebook 群友要求,分享一下 祝大家早日找到好工作 // @author XiaoMeng Mai // @match https://www.zhipin.com/web/geek/job* // @match https://www.zhipin.com/job_detail* // @match https://www.zhipin.com/web/geek/chat* // @compatible firefox Tampermonkey // @compatible chrome Tampermonkey // @compatible edge Tampermonkey // @grant GM_xmlhttpRequest // @require https://code.jquery.com/jquery-2.2.4.min.js // @require https://greasyfork.org/scripts/448161-waitforkeyelements-jquery/code/waitForKeyElements%20-%20jQuery.js?version=1072034 // @license GPLv3 // @downloadURL none // ==/UserScript== function actionFunction_1(jNode) { var base_url = 'https://www.zhipin.com' var company_url = jNode.attr('href') if (jNode.text().indexOf('若比邻黑名单') == -1) { console.log(jNode.text() + jNode.attr('href')) console.log(base_url + company_url) GM_xmlhttpRequest({ method: 'GET', url: base_url + company_url, onload: function (response) { var response_text = $(response.responseText) if (response.responseText.indexOf('请稍后') == -1) { var company_business = response_text.find('.company-full-name > span')[0].textContent console.log(company_business) GM_xmlhttpRequest({ method: 'GET', url: `https://www.ratecompany.org/?s=${company_business}&post_type=question`, onload: function (response) { if (response.responseText.indexOf('Sorry,该公司目前还没有人评价') == -1) { // console.log(response.responseText); var response_text = $(response.responseText) var hyperlink = response_text.find('.ap-questions-hyperlink').attr('href') jNode.after($(`  若比邻黑名单  `)) jNode.find(`#${company_business}`).remove() } else { } }, onerror: function (response) { } }) } }, onerror: function (response) { } }) } } function actionFunction_2(jNode) { jNode = jNode.find('a') var base_url = 'https://www.zhipin.com' var company_url = jNode.attr('href') if (jNode.text().indexOf('若比邻黑名单') == -1 && jNode.text().indexOf('去搜索一下') == -1 && jNode.text().length > 1) { console.log('公司名称:' + jNode.text() + "URL" + jNode.attr('href')) console.log(base_url + company_url) var blacklist_search = `https://www.ratecompany.org/?s=${jNode.text()}&post_type=question` console.log(blacklist_search); GM_xmlhttpRequest({ method: 'GET', url: blacklist_search, onload: function (response) { if (response.responseText.indexOf('Sorry,该公司目前还没有人评价') == -1) { var response_text = $(response.responseText) var hyperlink = response_text.find('.ap-questions-hyperlink').attr('href') if (hyperlink == undefined) { jNode.after($(`  去搜索一下  `)) } else { jNode.after($(`  若比邻黑名单  `)) } } else { jNode.after($(`  去搜索一下  `)) } } }) } } function actionFunction_3(jNode) { var blacklist_search = `https://www.ratecompany.org/?s=${jNode.text()}&post_type=question` GM_xmlhttpRequest({ method: 'GET', url: blacklist_search, onload: function (response) { if (response.responseText.indexOf('Sorry,该公司目前还没有人评价') == -1) { var response_text = $(response.responseText) var hyperlink = response_text.find('.ap-questions-hyperlink').attr('href') if (hyperlink == undefined) { $('.detail-op > .name').append($(`  去搜索一下  `)) } else { $('.detail-op > .name').append($(`  若比邻黑名单  `)) } } else { $('.detail-op > .name').append($(`  去搜索一下  `)) } } }) } function actionFunction_4(jNode) { if (jNode.text().indexOf('加载') == -1 && jNode.text().indexOf('您可以与来自店长直聘的Boss直接沟通')) { query_quantity = query_quantity + 1 company_name = jNode.text().split(' ')[0].replace('...', '') var blacklist_search = `https://www.ratecompany.org/?s=${company_name}&post_type=question` if (query_quantity < 40) { GM_xmlhttpRequest({ method: 'GET', url: blacklist_search, onload: function (response) { if (response.responseText.indexOf('Sorry,该公司目前还没有人评价') == -1) { var response_text = $(response.responseText) var hyperlink = response_text.find('.ap-questions-hyperlink').attr('href') if (hyperlink == undefined) { jNode.parent().find('.name').append($(`  去搜索一下  `)) } else { jNode.parent().find('.name').append($(`  若比邻黑名单  `)) } } else { jNode.parent().find('.name').append($(`  去搜索一下  `)) } } }) } } } function actionFunction_5(jNode) { $(".article_child").remove() if (jNode.text().indexOf('加载') == -1 && jNode.text().indexOf('您可以与来自店长直聘的Boss直接沟通')) { query_quantity = query_quantity + 1 company_name = jNode.text().replace('...', '') var blacklist_search = `https://www.ratecompany.org/?s=${company_name}&post_type=question` GM_xmlhttpRequest({ method: 'GET', url: blacklist_search, onload: function (response) { if (response.responseText.indexOf('Sorry,该公司目前还没有人评价') == -1) { var response_text = $(response.responseText) var hyperlink = response_text.find('.ap-questions-hyperlink').attr('href') if (hyperlink == undefined) { jNode.after($(`  去搜索一下  `)) } else { jNode.after($(`  若比邻黑名单  `)) } } else { jNode.after($(`  去搜索一下  `)) } } }) } } waitForKeyElements('.company-name', actionFunction_2); waitForKeyElements('.job-sec > .name', actionFunction_3); waitForKeyElements('.gray', actionFunction_4); waitForKeyElements('#container > div > div > div:nth-child(2) > div.article > p > span:nth-child(2)', actionFunction_5); waitForKeyElements('.info-company > div > h3', actionFunction_2); query_quantity = 0