RSSHub/lib/v2/hnu/careers.js

34 lines
1.5 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

const got = require('@/utils/got');
module.exports = async (ctx) => {
const rootUrl = 'http://scc.hnu.edu.cn/';
// 校园招聘的路由为/module/getcareers但该页面默认仅加载整体框架具体的招聘信息在页面加载完成后再交易获取。
// 具体的交易可以通过f12网络栏进行查看项目中仅保留了必须携带的参数。
// 其中有用的参数为count为获取招聘信息的数量。
const currentRoute = `${rootUrl}module/getcareers`;
const currentUrl = `${currentRoute}?start_page=1&type=inner&day=&count=20&start=1`;
const response = await got({
method: 'get',
url: currentUrl,
});
const company_list = response.data.data;
ctx.state.data = {
title: '校园招聘',
link: currentRoute,
item: company_list.map((company_info) => {
const ret = {
// 标题:公司名称
title: company_info.company_name,
// 链接:公司招聘简章链接
link: `${rootUrl}detail/career?id=${company_info.career_talk_id}`,
// 描述:校招教室+时间+专业
description: company_info.address + ' - ' + company_info.meet_time + ' - ' + company_info.professionals,
// 分类:公司类型(私营、国企)+ 工作城市
category: company_info.company_property + ' - ' + company_info.city_name,
};
return ret;
}),
};
};