mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-12 08:10:32 +08:00
* feat(route): add 北京大学学生就业指导服务中心 * fix(route): get content from sript tag request content in script tag to get full text * fix(doc): fix parameter description * fix(route): fix header and selector * add test request and wait * docs: fix warning * refactor: migrate to v2 * fix: eecs refactor: legacy url.resolve refactor: use parseDate from utils * docs: fix recruit path Co-authored-by: TonyRL <TonyRL@users.noreply.github.com>
30 lines
1.0 KiB
JavaScript
30 lines
1.0 KiB
JavaScript
const got = require('@/utils/got');
|
|
const cheerio = require('cheerio');
|
|
const { parseDate } = require('@/utils/parse-date');
|
|
|
|
module.exports = async (ctx) => {
|
|
const link = 'https://admission.pku.edu.cn/zsxx/sszs/index.htm';
|
|
const response = await got(link);
|
|
const $ = cheerio.load(response.data);
|
|
const list = $('.zsxx_cont_list li');
|
|
|
|
ctx.state.data = {
|
|
title: `${$('.twostage_title_C').text()} - ${$('title').text()}`,
|
|
link,
|
|
description: '北京大学研究生院通知公告',
|
|
item:
|
|
list &&
|
|
list
|
|
.map((index, item) => {
|
|
item = $(item);
|
|
return {
|
|
title: item.find('li a').text(),
|
|
description: item.find('li a').text(),
|
|
link: item.find('li a').attr('href'),
|
|
pubDate: parseDate(item.find('.zsxxCont_list_time').text()),
|
|
};
|
|
})
|
|
.get(),
|
|
};
|
|
};
|