Files
RSSHub/lib/v2/scut/scet/notice.js
Tony 8699b4c9d3 fix(route): fix namespace mess from #4283 (#12353)
* 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
2023-04-20 09:32:13 +08:00

32 lines
892 B
JavaScript

const got = require('@/utils/got');
const cheerio = require('cheerio');
module.exports = async (ctx) => {
const link = 'https://www2.scut.edu.cn/jtxs/24241/list.htm';
const response = await got({
method: 'get',
url: link,
});
const data = response.data;
const $ = cheerio.load(data);
const list = $('#wp_news_w5 li');
ctx.state.data = {
title: '华南理工大学土木与交通学院 - 学工通知',
link,
item:
list &&
list.toArray().map((item) => {
item = $(item);
return {
title: item.find('li a').text(),
description: item.find('li a').text(),
link: item.find('li a').attr('href'),
pubDate: item.find('.Article_PublishDate').text(),
};
}),
};
};