// ==UserScript== // @name BOSS海投助手 // @namespace https://github.com/yangshengzhou03 // @version 1.2.3.1 // @description 🚀 求职者自己的神器!🧑‍💻Yangshengzhou,提升BOSS直聘的简历投递效率,自动批量发送简历,高效求职 💼 // @author Yangshengzhou // @match https://www.zhipin.com/web/* // @grant GM_xmlhttpRequest // @run-at document-idle // @supportURL https://github.com/yangshengzhou03 // @homepageURL https://gitee.com/yangshengzhou // @license AGPL-3.0-or-later // 更多详情请参见: https://www.gnu.org/licenses/agpl-3.0.html // @icon https://static.zhipin.com/favicon.ico // @connect zhipin.com // @connect spark-api-open.xf-yun.com // @noframes // @require https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.1.1/crypto-js.min.js // @require https://gitee.com/Yangshengzhou/boss_helper/raw/Boss/config.js // @require https://gitee.com/Yangshengzhou/boss_helper/raw/Boss/state.js // @require https://gitee.com/Yangshengzhou/boss_helper/raw/Boss/utils.js // @require https://gitee.com/Yangshengzhou/boss_helper/raw/Boss/ui.js // @require https://gitee.com/Yangshengzhou/boss_helper/raw/Boss/core.js // ==/UserScript== (function () { 'use strict'; // 初始化应用 function init() { try { Core.log('初始化BOSS海投助手...'); // 初始化定时任务 - 每天零点重置计数 const now = new Date(); const night = new Date(now.getFullYear(), now.getMonth(), now.getDate() + 1, 0, 0, 0); const msToMidnight = night - now; setTimeout(() => { // 重置每日计数器 localStorage.removeItem('aiReplyCount'); localStorage.removeItem('lastAiDate'); localStorage.removeItem('hasShownLetterToday'); localStorage.removeItem('letterLastShown'); Core.log('每日计数器已重置'); }, msToMidnight); // 创建UI组件 UI.init(); // 设置body样式 - 确保UI定位基准 document.body.style.position = 'relative'; // 根据当前页面路径执行不同操作 if (location.pathname.includes('/jobs')) { // 职位列表页面 Core.log('海投助手会遍历当前职位列表,并依次自动沟通显示的职位'); } else if (location.pathname.includes('/chat')) { // 聊天页面 // 检查是否今天已显示过信件 const today = new Date().toISOString().split('T')[0]; const lastShown = localStorage.getItem('letterLastShown'); if (lastShown !== today) { localStorage.setItem('letterLastShown', today); } // 提示用户聊天页面功能 Core.log('海投插件将自动发送您的自我介绍和简历,并使用AI智能回复HR的消息'); } } catch (error) { console.error('初始化失败:', error); showCustomAlert(`插件初始化失败: ${error.message}`); } } // 增强兼容性的确认对话框 function showConfirmDialog(message, confirmCallback, cancelCallback) { try { const confirmed = confirm(message); if (confirmed && typeof confirmCallback === 'function') { confirmCallback(); } else if (!confirmed && typeof cancelCallback === 'function') { cancelCallback(); } } catch (error) { console.error('显示确认对话框失败:', error); alert(`操作确认失败: ${error.message}`); } } // 增强兼容性的提示对话框 function showCustomAlert(message = '欢迎使用BOSS海投助手!') { try { alert(message); } catch (error) { console.error('显示提示框失败:', error); } } // 当页面加载完成后调用 init 函数 window.addEventListener('load', init); })();