// ==UserScript==
// @name 高级求职助手/招聘网站助手,支持前程无忧、智联招聘、BOSS直聘、拉钩网、猎聘网、58同城
// @namespace https://github.com/qq943260285
// @version 4.23.12.23
// @description 1.快捷添加企业黑名单;2.快捷公司/企业信息查询,支持天眼查、看准、企查查、爱企查、百度信誉、百度搜索;3.支持全网热门招聘网站,前程无忧、智联招聘、BOSS直聘、拉钩网、猎聘网、58同城;4.各大网站黑名单数据连通。
// @author 小宇专属
// @license GPL-3.0-only
// @icon https://raw.githubusercontent.com/qq943260285/tampermonkey-recruitment-tool/master/assets/logo_ico.png
// @create 2019-03-25
// @lastmodified 2023-12-23
// @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 2023-12-23 1.修复前程无忧失效问题 2.修复企业查询失效问题
// @match *://*.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 https://update.greasyfork.icu/scripts/380848/%E9%AB%98%E7%BA%A7%E6%B1%82%E8%81%8C%E5%8A%A9%E6%89%8B%E6%8B%9B%E8%81%98%E7%BD%91%E7%AB%99%E5%8A%A9%E6%89%8B%EF%BC%8C%E6%94%AF%E6%8C%81%E5%89%8D%E7%A8%8B%E6%97%A0%E5%BF%A7%E3%80%81%E6%99%BA%E8%81%94%E6%8B%9B%E8%81%98%E3%80%81BOSS%E7%9B%B4%E8%81%98%E3%80%81%E6%8B%89%E9%92%A9%E7%BD%91%E3%80%81%E7%8C%8E%E8%81%98%E7%BD%91%E3%80%8158%E5%90%8C%E5%9F%8E.user.js
// @updateURL https://update.greasyfork.icu/scripts/380848/%E9%AB%98%E7%BA%A7%E6%B1%82%E8%81%8C%E5%8A%A9%E6%89%8B%E6%8B%9B%E8%81%98%E7%BD%91%E7%AB%99%E5%8A%A9%E6%89%8B%EF%BC%8C%E6%94%AF%E6%8C%81%E5%89%8D%E7%A8%8B%E6%97%A0%E5%BF%A7%E3%80%81%E6%99%BA%E8%81%94%E6%8B%9B%E8%81%98%E3%80%81BOSS%E7%9B%B4%E8%81%98%E3%80%81%E6%8B%89%E9%92%A9%E7%BD%91%E3%80%81%E7%8C%8E%E8%81%98%E7%BD%91%E3%80%8158%E5%90%8C%E5%9F%8E.meta.js
// ==/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(left) {
if (isMobile) {
var mouseX = left.originalEvent.x || left.originalEvent.layerX || 0, mouseY = left.originalEvent.y || left.originalEvent.layerY || 0, bottom = tool.position().top, X = tool.position().left, winH = $(window).height(), winW = $(window).width();
toolPosition.x = X, toolPosition.y = bottom;
left = X + mouseX - mousedownPosition.x, bottom = winH - 50 - bottom - 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 ').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
\n ").css({
width: 50 * menuItems.length + 20 + "px"
}), createMenu = function() {
menu.empty();
for (var i = 0; i < menuItems.length; i++) (function(i) {
menu.append($('').click(function() {
menuItems[i].callback();
}));
})(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 ').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 saveSearchList() {
for (var arr = [], i = 0; i < searchList.length; i++) {
var item = searchList[i];
arr.push({
Id: item.Id,
Title: item.Title,
Host: item.Host,
SearchUrl: item.SearchUrl,
Ico: item.Ico,
Show: item.Show
});
}
if ("function" == typeof GM_setValue) GM_setValue(searchListKey, JSON.stringify(arr));
}
function blacklistRefresh() {
blacklistFilter(), function(status) {
status = status || "1", blacklistFunction.HtmlToList().filter("[xyzs!='" + status + "']").each(function(index, element) {
if ($(element).attr("xyzs", "1"), 0 === $(element).find(".xyzs-del-div").length) blacklistFunction.ItemToNameJq(element).after($('').append($('
').click(function() {
return $(blacklistFunction.DleButtonToItem(this)).attr("xyzs", "0"), 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) {
if (o.Show) {
var icoUrl = o.Ico || o.Host + "/favicon.ico";
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(status) {
status = status || "1", blacklistFunction.HtmlToList().filter("[xyzs!='" + status + "']").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++) {
for (var re = blacklistList[i], j = 0; j < regExpCharacter.length; j++) re = re.replace(new RegExp("\\" + regExpCharacter[j], "g"), "\\" + regExpCharacter[j]);
if (new RegExp(re, "i").test(name)) {
isShow = !1;
break;
}
}
if (isShow) $(element).show(); else $(element).hide();
});
}
var body = $("body");
body.before(''),
body.before(""), $.FloatingToolXYZS([ {
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("0");
})($(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-search",
title: "搜索引擎管理",
callback: function() {
var div = $('');
$.each(searchList, function(index, item) {
var icoUrl = item.Ico || item.Host + "/favicon.ico";
item.div = $('
' + item.Title + " ");
var i1 = $('').click(function() {
var index = Number($(i1).parent().attr("index"));
if (0 != index) {
var this_tmp = searchList[index], tmp = searchList[index - 1];
tmp.div.insertAfter(this_tmp.div), tmp.div.attr("index", index), this_tmp.div.attr("index", index - 1),
searchList[index - 1] = this_tmp, searchList[index] = tmp, saveSearchList();
}
});
item.div.append(i1);
var i2 = $('').click(function() {
var index = Number($(i2).parent().attr("index"));
if (index != searchList.length - 1) {
var this_tmp = searchList[index], tmp = searchList[index + 1];
tmp.div.insertBefore(this_tmp.div), tmp.div.attr("index", index), this_tmp.div.attr("index", index + 1),
searchList[index + 1] = this_tmp, searchList[index] = tmp, saveSearchList();
}
});
item.div.append(i2);
var i3 = $('').click(function() {
var index = Number($(i3).parent().attr("index"));
searchList[index].Show = !searchList[index].Show, i3.toggleClass("fa-eye"), i3.toggleClass("fa-eye-slash"),
saveSearchList();
});
item.div.append(i3), div.append(item.div);
}), $.WindowXYZS().show("搜索引擎管理", div);
}
}, {
ico: "fa-exclamation",
title: "关于",
callback: function() {
var div = $('');
div.append('高级求职助手/招聘网站助手
支持前程无忧、智联招聘、BOSS直聘、拉钩网、猎聘网、百度百聘、58同城
'),
div.append($("").append($('开源项目:,感谢您的捐赠及支持
').click(function() {
window.open("https://github.com/qq943260285/tampermonkey-recruitment-tool.git", "_blank");
})).append('')),
$.WindowXYZS().show("关于", div);
}
} ]);
var regExpCharacter = [ "\\", "$", "(", ")", "{", "}", "*", "+", ".", "[", "]", "?", "^", "|" ], blacklistKey = "blacklist", searchListKey = "searchList", blacklistList = "function" == typeof GM_getValue ? 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: "we.51job.com",
IsRefresh: !0,
DleButtonStyle: "display: inherit;",
HtmlToList: function() {
return $(".joblist>.joblist-item");
},
ItemToNameJq: function(item) {
return $(item).find(".cname");
},
NameJqToNameText: function(item) {
return $(item).attr("title");
},
DleButtonToItem: function(item) {
return $(item).closest(".joblist-item");
}
}, {
WebName: "智联招聘",
WebUrl: "sou.zhaopin.com",
IsRefresh: !0,
DleButtonStyle: "margin: 0 10px;display: inline-table;",
HtmlToList: function() {
return $(".positionlist>.joblist-box__item");
},
ItemToNameJq: function(item) {
return $(item).find(".iteminfo__line1__compname__name");
},
NameJqToNameText: function(item) {
return $(item).attr("title");
},
DleButtonToItem: function(item) {
return $(item).closest(".joblist-box__item");
}
}, {
WebName: "BOSS直聘",
WebUrl: "www.zhipin.com",
IsRefresh: !0,
DleButtonStyle: "float: left;",
HtmlToList: function() {
return $(".company-name a[ka]").closest("li");
},
ItemToNameJq: function(item) {
return $(item).find(".company-name 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 $("#jobList").children("div").eq(0).children("div");
},
ItemToNameJq: function(item) {
return $(item).children("div").eq(0).children("div").eq(1).children("div").eq(0).children("a").eq(0);
},
NameJqToNameText: function(item) {
return $(item).text();
},
DleButtonToItem: function(item) {
return $(item).closest("div[xyzs]");
}
}, {
WebName: "猎聘网",
WebUrl: "www.liepin.com",
IsRefresh: !0,
DleButtonStyle: "display: inline-flex;position: absolute;right: 280px;",
HtmlToList: function() {
return $("div .job-card-pc-container");
},
ItemToNameJq: function(item) {
return $(item).find(".company-name");
},
NameJqToNameText: function(name) {
name = $(name).text();
return name;
},
DleButtonToItem: function(item) {
return $(item).closest("div[xyzs]");
}
}, {
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");
}
} ], searchList = 0 ? JSON.parse(GM_getValue(searchListKey) || "[]") : [], defaultSearchList = [ {
Id: 1,
Title: "天眼查",
Host: "https://tianyancha.com",
SearchUrl: "/search?key=",
Show: !0
}, {
Id: 2,
Title: "爱企查",
Host: "https://aiqicha.baidu.com",
SearchUrl: "/s?t=0&q=",
Ico: "http://xinpub.cdn.bcebos.com/static/favicon.ico",
Show: !0
}, {
Id: 3,
Title: "看准",
Host: "https://www.kanzhun.com",
SearchUrl: "/search/?type=0&query=",
Show: !0
}, {
Id: 4,
Title: "企查查",
Host: "https://www.qcc.com",
SearchUrl: "/web/search?key=",
Ico: "https://qcc-static.qcc.com/resources/web/omaterial/favicon.png",
Show: !0
}, {
Id: 5,
Title: "百度搜索",
Host: "https://baidu.com",
SearchUrl: "/s?wd=",
Show: !0
} ];
(function() {
for (var i = 0; i < WebJqList.length; i++) if (-1 != window.location.host.indexOf(WebJqList[i].WebUrl)) {
blacklistFunction = WebJqList[i];
break;
}
for (var _i = 0; _i < defaultSearchList.length; _i++) {
for (var exist = !1, item = defaultSearchList[_i], j = 0; j < searchList.length; j++) if (searchList[j].Id === item.Id) {
exist = !0;
break;
}
if (!exist) searchList.push(item), saveSearchList();
}
if (blacklistRefresh(), blacklistFunction.IsRefresh) setInterval(blacklistRefresh, 3e3);
})();
}();