// ==UserScript== // @name 高级求职助手/招聘网站助手,支持前程无忧、智联招聘、BOSS直聘、拉钩网、猎聘网、百度百聘、58同城 // @namespace https://github.com/qq943260285 // @version 3.20.0626 // @description 1.快捷添加企业黑名单;2.快捷公司/企业信息查询,支持天眼查、看准、企查查、百度信誉、百度搜索3.支持全网热门招聘网站,前程无忧、智联招聘、BOSS直聘、拉钩网、猎聘网、百度百聘、58同城;4.各大网站黑名单数据连通。 // @author 小宇专属(943260285@qq.com) // @license GPL-3.0-only // @icon https://qq943260285.github.io/favicon.png // @create 2019-03-25 // @lastmodified 2020-06-26 // @home-url https://greasyfork.org/zh-TW/scripts/380848 // @supportURL https://github.com/qq943260285/tampermonkey-recruitment-tool.git // @feedback-url https://github.com/qq943260285/tampermonkey-recruitment-tool.git // @note 2020-06-26 添加公司/企业信息查询,支持天眼查、看准、企查查、百度信誉、百度搜索(感谢greasyfork用户:miracle god,意见反馈) // @match *://search.51job.com/* // @match *://sou.zhaopin.com/* // @match *://www.zhipin.com/* // @match *://www.lagou.com/* // @match *://www.liepin.com/* // @match *://*.58.com/* // @match *://zhaopin.baidu.com/quanzhi* // @require https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js // @grant GM_getValue // @grant GM.getValue // @grant GM_setValue // @grant GM.setValue // @grant GM_addStyle // @downloadURL none // ==/UserScript== "use strict"; (function($) { $.extend({ FloatingToolXYZS: function(menuItems) { if (!Array.isArray(menuItems)) return; var positionLeft = !0, isExpand = !0, body = $("body"); body.before(""); var isMobile = !1, mousedownPosition = { x: 0, y: 0 }, toolPosition = { x: 0, y: 0 }, toolRegion = $('
').mousedown(function() { toolRegion.css("pointer-events", "auto"); }).mouseup(function() { isMobile = !1, toolRegion.css("pointer-events", "none"); }).mousemove(function(e) { if (isMobile) { var mouseX = e.originalEvent.x || e.originalEvent.layerX || 0, mouseY = e.originalEvent.y || e.originalEvent.layerY || 0, Y = tool.position().top, X = tool.position().left, winH = $(window).height(), winW = $(window).width(); toolPosition.x = X, toolPosition.y = Y; var left = X + mouseX - mousedownPosition.x, bottom = winH - 50 - Y - mouseY + mousedownPosition.y; if (tool.css({ left: (left < 0 ? 0 : winW < 50 + left ? winW - 50 : left) + "px", bottom: (bottom < 0 ? 0 : winH < bottom + 50 ? winH - 50 : bottom) + "px" }), positionLeft === winW / 2 < X + 25) menu.css({ width: 50 * menuItems.length + 20 + "px", left: (winW / 2 < X + 25 ? -1 * (50 * menuItems.length + 20) : 50) + "px" }), menuItems.reverse(), createMenu(), positionLeft = !positionLeft; mousedownPosition.x = mouseX, mousedownPosition.y = mouseY; } }).css("pointer-events", "none"), tool = $('\n
\n
\n \n
\n
').mouseleave(function() { menu.hide(70); }).mouseenter(function(e) { menu.show(70); }).mousedown(function(e) { isExpand = isMobile = !0, toolRegion.css("pointer-events", "auto"), mousedownPosition.x = e.originalEvent.x || e.originalEvent.layerX || 0, mousedownPosition.y = e.originalEvent.y || e.originalEvent.layerY || 0; }).mousemove(function() { isExpand = !1; }).click(function() { if (isExpand) menu.toggle(); }).css({ left: "10px", bottom: "10px" }), menu = $("\n \n ").css({ width: 50 * menuItems.length + 20 + "px" }), createMenu = function() { menu.empty(); for (var _loop = function(i) { menu.append($('
').click(function() { menuItems[i].callback(); })); }, i = 0; i < menuItems.length; i++) _loop(i); }; createMenu(), tool.append(menu), toolRegion.append(tool), body.append(toolRegion); } }); })(jQuery), function($) { $.extend({ WindowXYZS: function() { var body = $("body"); body.before(""); var winRegion = $('
').click(function() { return win.hide(), winRegion.css({ "background-color": "", "pointer-events": "none" }), !1; }).css("pointer-events", "none"), win = $('\n
\n
\n
\n \n
\n
\n
标题
\n
\n
\n 内容\n
\n
\n
\n ').click(function() { return !1; }).css("pointer-events", "auto").hide(); return win.find(".xyzs-modal-close").click(function() { win.hide(), winRegion.css({ "background-color": "", "pointer-events": "none" }); }), winRegion.append(win), body.append(winRegion), { show: function(winTitle, winDiv) { winRegion.css({ "pointer-events": "auto", "background-color": "rgba(55,55,55,.6)" }), win.show(500), win.find(".xyzs-modal-header-inner").html(winTitle), win.find(".xyzs-modal-body").empty().append(winDiv); } }; } }); }(jQuery), function() { function blacklistRefresh() { blacklistFilter(), function() { blacklistFunction.HtmlToList().each(function(index, element) { if (0 === $(element).find(".xyzs-del-div").length) blacklistFunction.ItemToNameJq(element).after($('
').append($('
').click(function() { return function(name) { if (name += "", -1 === blacklistList.indexOf(name)) blacklistList.push(name), GM_setValue(blacklistKey, JSON.stringify(blacklistList)); blacklistFilter(); }(blacklistFunction.NameJqToNameText(blacklistFunction.ItemToNameJq(blacklistFunction.DleButtonToItem(this)))), !1; })).append(function() { var hoverTimer; return $('
').append(function() { var lists = $('
'); return $.each(searchList, function(i, o) { lists.append($('
').click(function() { return window.open(o.Host + o.SearchUrl + encodeURI(blacklistFunction.NameJqToNameText(blacklistFunction.ItemToNameJq(blacklistFunction.DleButtonToItem(this))))), !1; })); }), lists; }()).hover(function() { var _this = this; hoverTimer = setTimeout(function() { $(_this).find(".xyzs-search-div-lists").css("display", "flex"); }, 500); }, function() { clearTimeout(hoverTimer), $(this).find(".xyzs-search-div-lists").hide(); }).click(function() { return window.open(searchList[0].Host + searchList[0].SearchUrl + encodeURI(blacklistFunction.NameJqToNameText(blacklistFunction.ItemToNameJq(blacklistFunction.DleButtonToItem(this))))), !1; }); }())); }); }(); } function blacklistFilter() { blacklistFunction.HtmlToList().each(function(index, element) { var isShow = !0, name = blacklistFunction.NameJqToNameText(blacklistFunction.ItemToNameJq(element)); if (-1 < blacklistList.indexOf(name)) isShow = !1; else for (var i = 0; i < blacklistList.length; i++) if (new RegExp(blacklistList[i], "i").test(name)) { isShow = !1; break; } if (isShow) $(element).show(); else $(element).hide(); }); } var body = $("body"); body.before(''), body.before(""); var menuItems = [ { ico: "fa-eye-slash", title: "黑名单管理", callback: function() { var div = $('\n
\n '); $.each(blacklistList, function(index, item) { div.prepend($('
' + item + "
").append($('').click(function() { (function(name) { if (-1 < blacklistList.indexOf(name)) blacklistList.splice(blacklistList.indexOf(name), 1), GM_setValue(blacklistKey, JSON.stringify(blacklistList)); blacklistFilter(); })($(this).attr("item-name")), $(this).closest(".xyzs-enterprise-item").remove(); }))); }), $.WindowXYZS().show("黑名单管理 [欢迎提建议和反馈问题(点击)]", div); } }, { ico: "fa-magic", title: "支持网站", callback: function() { var div = $('\n
\n '); $.each(WebJqList, function(index, item) { div.append($('
' + item.WebName + "
").click(function() { window.open("//" + item.WebUrl, "_blank"); }).append($(''))); }), $.WindowXYZS().show("支持网站 [欢迎提建议和反馈问题(点击)]", div); } }, { ico: "fa-podcast", title: "作者博客", callback: function() { window.open("https://qq943260285.github.io"); } }, { ico: "fa-github", title: "github开源", callback: function() { window.open("https://github.com/qq943260285/tampermonkey-recruitment-tool.git"); } } ]; $.FloatingToolXYZS(menuItems); var blacklistKey = "blacklist", blacklistList = GM_getValue(blacklistKey) ? JSON.parse(GM_getValue(blacklistKey)) : [], blacklistFunction = { WebName: null, WebUrl: null, IsRefresh: null, DleButtonStyle: null, HtmlToList: function() {}, ItemToNameJq: function() {}, NameJqToNameText: function() {}, DleButtonToItem: function() {} }, WebJqList = [ { WebName: "前程无忧", WebUrl: "search.51job.com", IsRefresh: !1, DleButtonStyle: "position: absolute;left: 295px;display: inline-flex;", HtmlToList: function() { return $(".el .t2 a[title]").closest(".el"); }, ItemToNameJq: function(item) { return $(item).find(".t2 a[title]"); }, NameJqToNameText: function(item) { return $(item).attr("title"); }, DleButtonToItem: function(item) { return $(item).closest(".el"); } }, { WebName: "智联招聘", WebUrl: "sou.zhaopin.com", IsRefresh: !0, DleButtonStyle: "margin: 0 10px;display: inline-table;", HtmlToList: function() { return $("#listContent .clearfix .commpanyName a[title]").closest(".clearfix"); }, ItemToNameJq: function(item) { return $(item).find(".commpanyName a[title]"); }, NameJqToNameText: function(item) { return $(item).attr("title"); }, DleButtonToItem: function(item) { return $(item).closest(".clearfix"); } }, { WebName: "BOSS直聘", WebUrl: "www.zhipin.com", IsRefresh: !1, DleButtonStyle: "float: left;", HtmlToList: function() { return $(".company-text h3 a[ka]").closest("li"); }, ItemToNameJq: function(item) { return $(item).find(".company-text h3 a[ka]"); }, NameJqToNameText: function(item) { return $(item).text(); }, DleButtonToItem: function(item) { return $(item).closest("li"); } }, { WebName: "拉勾网", WebUrl: "www.lagou.com", IsRefresh: !0, DleButtonStyle: "float: left;", HtmlToList: function() { return $("li .company_name a[data-lg-tj-cid]").closest("li"); }, ItemToNameJq: function(item) { return $(item).find(".company_name a[data-lg-tj-cid]"); }, NameJqToNameText: function(item) { return $(item).text(); }, DleButtonToItem: function(item) { return $(item).closest("li"); } }, { WebName: "猎聘网", WebUrl: "www.liepin.com", IsRefresh: !1, DleButtonStyle: "display: inline-flex;position: absolute;right: 280px;", HtmlToList: function() { return $("li .company-name a[title]").closest("li"); }, ItemToNameJq: function(item) { return $(item).find(".company-name a[title]"); }, NameJqToNameText: function(item) { return $(item).text(); }, DleButtonToItem: function(item) { return $(item).closest("li"); } }, { WebName: "58同城", WebUrl: "58.com", IsRefresh: !1, DleButtonStyle: "background: transparent;top: 12px;position: absolute;left: -50px;", HtmlToList: function() { return $("#list_con li .comp_name a[title]").closest("li"); }, ItemToNameJq: function(item) { return $(item).find(".comp_name a[title]"); }, NameJqToNameText: function(item) { return $(item).text(); }, DleButtonToItem: function(item) { return $(item).closest("li"); } }, { WebName: "百度招聘", WebUrl: "zhaopin.baidu.com", IsRefresh: !0, DleButtonStyle: "background: transparent;top: 0;position: absolute;left: -10px;", HtmlToList: function() { return $(".listitem .single .companyname").closest(".single"); }, ItemToNameJq: function(item) { return $(item).find(".companyname"); }, NameJqToNameText: function(item) { return $(item).text(); }, DleButtonToItem: function(item) { return $(item).closest(".single"); } } ], searchList = [ { Title: "天眼查", Host: "https://tianyancha.com", SearchUrl: "/search?key=" }, { Title: "看准", Host: "https://kanzhun.com", SearchUrl: "/search/?type=company&q=" }, { Title: "企查查", Host: "https://qcc.com", SearchUrl: "/search?key=" }, { Title: "百度信誉", Host: "https://xin.baidu.com", SearchUrl: "/s?q=" }, { Title: "百度搜索", Host: "https://baidu.com", SearchUrl: "/s?wd=" } ]; (function() { for (var i = 0; i < WebJqList.length; i++) if (-1 != window.location.host.indexOf(WebJqList[i].WebUrl)) { blacklistFunction = WebJqList[i]; break; } if (blacklistRefresh(), blacklistFunction.IsRefresh) setInterval(blacklistRefresh, 3e3); })(); }();