diff --git a/lib/v2/cqwu/index.js b/lib/v2/cqwu/index.js index c46c91353..cf6ed42ac 100644 --- a/lib/v2/cqwu/index.js +++ b/lib/v2/cqwu/index.js @@ -4,8 +4,8 @@ const { parseDate } = require('@/utils/parse-date'); const host = 'https://www.cqwu.edu.cn'; const map = { - notify: '/channel_7721.html', - academiceve: '/channel_7722.html', + notify: '/channel_24894.html', + academiceve: '/channel_24895.html', }; const titleMap = { notify: '通知', @@ -18,22 +18,25 @@ module.exports = async (ctx) => { const title = '重文理' + titleMap[type] + '公告'; const response = await got.get(link); const $ = cheerio.load(response.data); - const list = $('ul[class="list-unstyled news-uls"]').find('li'); + const list = $('div[class="list"] ul').find('li'); const items = await Promise.all( - list.map(async (_, item) => { + list.map(async (i, item) => { const pageUrl = host + $(item).find('a').attr('href'); - const desc = await ctx.cache.tryGet(pageUrl, async () => { + const { desc, pubDate } = await ctx.cache.tryGet(pageUrl, async () => { const page = await got.get(pageUrl); const $ = cheerio.load(page.data); - return $('.news-info').html(); + return { + desc: $('.contentAtice').html(), + pubDate: parseDate($('.abs span:nth-child(1)').text().replace('发布时间:', '')), + }; }); return { - title: $(item).find('a').text(), + title: $(item).find('.title').text(), link: pageUrl, description: desc, - pubDate: parseDate($(item).find('span').text()), + pubDate, }; }) ); diff --git a/lib/v2/cqwu/radar.js b/lib/v2/cqwu/radar.js index 5b79dcac8..94e1459d6 100644 --- a/lib/v2/cqwu/radar.js +++ b/lib/v2/cqwu/radar.js @@ -7,7 +7,7 @@ module.exports = { docs: 'https://docs.rsshub.app/routes/university#chong-qing-wen-li-xue-yuan', source: '/:type', target: (params) => { - if (params.type === 'channel_7721.html') { + if (params.type === 'channel_24894.html') { return '/cqwu/news/notify'; } }, @@ -17,7 +17,7 @@ module.exports = { docs: 'https://docs.rsshub.app/routes/university#chong-qing-wen-li-xue-yuan', source: '/:type', target: (params) => { - if (params.type === 'channel_7722.html') { + if (params.type === 'channel_24895.html') { return '/cqwu/news/academiceve'; } },