mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-02 01:58:11 +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
968 B
JavaScript
34 lines
968 B
JavaScript
const got = require('@/utils/got');
|
|
const cheerio = require('cheerio');
|
|
const { parseDate } = require('@/utils/parse-date');
|
|
|
|
module.exports = async (ctx) => {
|
|
const baseUrl = 'http://jw.scnu.edu.cn';
|
|
const url = `${baseUrl}/ann/index.html`;
|
|
const res = await got({
|
|
method: 'get',
|
|
url,
|
|
headers: {
|
|
Referer: baseUrl,
|
|
},
|
|
});
|
|
const $ = cheerio.load(res.data);
|
|
const list = $('.notice_01').find('li');
|
|
|
|
ctx.state.data = {
|
|
title: $('title').first().text(),
|
|
link: url,
|
|
description: '华南师范大学教务处 - 通知公告',
|
|
item:
|
|
list &&
|
|
list.toArray().map((item) => {
|
|
item = $(item);
|
|
return {
|
|
title: item.find('a').text(),
|
|
pubDate: parseDate(item.find('.time').text()),
|
|
link: item.find('a').attr('href'),
|
|
};
|
|
}),
|
|
};
|
|
};
|