mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-10-13 00:35:19 +08:00
* refactor: fix scut namespace * refactor: fix gzhu namespace * refactor: fix scnu namespace * refactor: fix hust namespace * refactor: fix ccnu namespace * refactor: fix sustech namespace * refactor: fix szu namespace remove `/szuyjs` since it's a duplicate of `/szu/yz/:type?` * refactor: fix tongji namespace * refactor: fix ocu namespace * refactor: fix upc namespace * refactor: fix ucas namespace * refactor: fix cas namespace * refactor: fix cau namespace * refactor: remove `/cucyjs` since `/cuc/yz` existed well before that * refactor: fix bit namespace * refactor: fix **undocumented** scau namespace * fix: typo * fix: code scan
34 lines
939 B
JavaScript
34 lines
939 B
JavaScript
const got = require('@/utils/got');
|
|
const cheerio = require('cheerio');
|
|
const { parseDate } = require('@/utils/parse-date');
|
|
|
|
/* 研究生招生网通知公告*/
|
|
|
|
module.exports = async (ctx) => {
|
|
const host = 'https://yz.cuc.edu.cn';
|
|
const link = `${host}/8549/list.htm`;
|
|
const response = await got({
|
|
method: 'get',
|
|
url: link,
|
|
});
|
|
const $ = cheerio.load(response.data);
|
|
|
|
const content = $('.news_list li');
|
|
const items = content.toArray().map((elem) => {
|
|
elem = $(elem);
|
|
const a = elem.find('a');
|
|
return {
|
|
link: new URL(a.attr('href'), host).href,
|
|
title: a.attr('title'),
|
|
pubDate: parseDate(elem.find('.news_meta').text(), 'YYYY-MM-DD'),
|
|
};
|
|
});
|
|
|
|
ctx.state.data = {
|
|
title: $('title').text(),
|
|
link,
|
|
description: '中国传媒大学研究生招生网 通知公告',
|
|
item: items,
|
|
};
|
|
};
|