fix(route): 中国科学技术大学 (#13234)
This commit is contained in:
parent
31684c9480
commit
536a4002be
|
|
@ -21,13 +21,14 @@ module.exports = async (ctx) => {
|
|||
const response = await got(`${host}/${id}/list.htm`);
|
||||
const $ = cheerio.load(response.data);
|
||||
const list = $('div[portletmode=simpleList]')
|
||||
.find('div.newslist')
|
||||
.find('article')
|
||||
.toArray()
|
||||
.map((item) => {
|
||||
item = $(item);
|
||||
const title = item.find('a').attr('title').trim();
|
||||
const link = item.find('a').attr('href').startsWith('/') ? host + item.find('a').attr('href') : item.find('a').attr('href');
|
||||
const pubDate = timezone(parseDate(item.find('.text-secondary').text() + '/' + item.find('.text-primary').text(), 'YYYY/MM/DD'), +8);
|
||||
const title = item.find('h4 > a').eq(1).attr('title').trim();
|
||||
let link = item.find('h4 > a').attr('href');
|
||||
link = link.startsWith('/') ? host + link : link;
|
||||
const pubDate = timezone(parseDate(item.find('.post-date > time').text().replace('发布时间:', ''), 'YYYY-MM-DD'), +8);
|
||||
return {
|
||||
title,
|
||||
pubDate,
|
||||
|
|
|
|||
|
|
@ -20,14 +20,15 @@ module.exports = async (ctx) => {
|
|||
|
||||
const response = await got(`${host}/${id}/list.htm`);
|
||||
const $ = cheerio.load(response.data);
|
||||
let items = $('div#wp_news_w12')
|
||||
.find('li')
|
||||
let items = $('div[portletmode=simpleList]')
|
||||
.find('div.card')
|
||||
.toArray()
|
||||
.map((item) => {
|
||||
item = $(item);
|
||||
const title = item.find('a').attr('title').trim();
|
||||
const link = item.find('a').attr('href').startsWith('/') ? host + item.find('a').attr('href') : item.find('a').attr('href');
|
||||
const pubDate = timezone(parseDate(item.find('span').text(), 'YYYY-MM-DD'), +8);
|
||||
const title = item.find('.card-title > a').attr('title').trim();
|
||||
let link = item.find('.card-title > a').attr('href');
|
||||
link = link.startsWith('/') ? host + link : link;
|
||||
const pubDate = timezone(parseDate(item.find('time').text().replace('发布时间:', ''), 'YYYY-MM-DD'), +8);
|
||||
return {
|
||||
title,
|
||||
pubDate,
|
||||
|
|
|
|||
Loading…
Reference in New Issue