mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-01 17:48:15 +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
29 lines
974 B
JavaScript
29 lines
974 B
JavaScript
const got = require('@/utils/got');
|
|
const cheerio = require('cheerio');
|
|
const { parseDate } = require('@/utils/parse-date');
|
|
|
|
module.exports = async (ctx) => {
|
|
const link = 'http://cs.ccnu.edu.cn/xwzx/tzgg.htm';
|
|
const response = await got(link);
|
|
const $ = cheerio.load(response.data);
|
|
const list = $('.list_box_07 li');
|
|
|
|
ctx.state.data = {
|
|
title: '华中师范大学计算机学院',
|
|
link,
|
|
description: '华中师范大学计算机学院通知公告',
|
|
item:
|
|
list &&
|
|
list.toArray().map((item) => {
|
|
item = $(item);
|
|
const a = item.find('a');
|
|
return {
|
|
title: a.attr('title'),
|
|
description: item.find('.overfloat-dot-2').text(),
|
|
link: new URL(a.attr('href'), link).href,
|
|
pubDate: parseDate(item.find('.time').text(), 'DDYYYY-MM'),
|
|
};
|
|
}),
|
|
};
|
|
};
|