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
35 lines
955 B
JavaScript
35 lines
955 B
JavaScript
const got = require('@/utils/got');
|
|
const cheerio = require('cheerio');
|
|
const { parseDate } = require('@/utils/parse-date');
|
|
|
|
module.exports = async (ctx) => {
|
|
const link = 'http://biddingoffice.sustech.edu.cn';
|
|
const response = await got({
|
|
method: 'get',
|
|
url: link,
|
|
});
|
|
|
|
const data = response.data;
|
|
|
|
const $ = cheerio.load(data);
|
|
|
|
const list = $('.index-wrap.index-2 ul li');
|
|
|
|
ctx.state.data = {
|
|
title: '南方科技大学采购与招标管理部',
|
|
link,
|
|
item:
|
|
list &&
|
|
list.toArray().map((item) => {
|
|
item = $(item);
|
|
const itemPubdate = item.find('li > span').text();
|
|
const a = item.find('li > a');
|
|
return {
|
|
pubDate: parseDate(itemPubdate, 'YYYY-MM-DD'),
|
|
title: a.text(),
|
|
link: a.attr('href'),
|
|
};
|
|
}),
|
|
};
|
|
};
|