9b395f5cc3
E2E Headed Chrome / e2e-headed (macos-15) (push) Has been cancelled
E2E Headed Chrome / e2e-headed (ubuntu-latest) (push) Has been cancelled
E2E Headed Chrome / e2e-headed (windows-latest) (push) Has been cancelled
CI / build (macos-latest) (push) Has been cancelled
CI / build (ubuntu-latest) (push) Has been cancelled
CI / build (windows-latest) (push) Has been cancelled
CI / unit-test (push) Has been cancelled
CI / bun-test (push) Has been cancelled
CI / adapter-test (push) Has been cancelled
CI / smoke-test (macos-latest) (push) Has been cancelled
CI / smoke-test (ubuntu-latest) (push) Has been cancelled
Security Audit / audit (push) Has been cancelled
Build Chrome Extension / build (push) Has been cancelled
Trigger Website Rebuild (Docs Updated) / dispatch (push) Has been cancelled
32 lines
1.1 KiB
JavaScript
32 lines
1.1 KiB
JavaScript
/**
|
|
* BOSS直聘 job list — list my published jobs via boss API.
|
|
*/
|
|
import { cli, Strategy } from '@jackwener/opencli/registry';
|
|
import { requirePage, navigateToChat, bossFetch, verbose } from './utils.js';
|
|
cli({
|
|
site: 'boss',
|
|
name: 'joblist',
|
|
access: 'read',
|
|
description: 'BOSS直聘查看我发布的职位列表',
|
|
domain: 'www.zhipin.com',
|
|
strategy: Strategy.COOKIE,
|
|
navigateBefore: false,
|
|
browser: true,
|
|
args: [],
|
|
columns: ['job_name', 'salary', 'city', 'status', 'encrypt_job_id'],
|
|
func: async (page, kwargs) => {
|
|
requirePage(page);
|
|
verbose('Fetching job list...');
|
|
await navigateToChat(page);
|
|
const data = await bossFetch(page, 'https://www.zhipin.com/wapi/zpjob/job/chatted/jobList');
|
|
const jobs = data.zpData || [];
|
|
return jobs.map((j) => ({
|
|
job_name: j.jobName || '',
|
|
salary: j.salaryDesc || '',
|
|
city: j.address || '',
|
|
status: j.jobOnlineStatus === 1 ? '在线' : '已关闭',
|
|
encrypt_job_id: j.encryptJobId || '',
|
|
}));
|
|
},
|
|
});
|