mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
fix: outdated route DoNews (#6522)
This commit is contained in:
+3
-3
@@ -164,9 +164,9 @@ pageClass: routes
|
||||
|
||||
<Route author="HenryQW" example="/donews" path="/donews/:column?" :paramsDesc="['栏目代码, 默认为首页.']">
|
||||
|
||||
| 首页 | 商业 | 创业 | 互娱 | 科技 | 专栏 |
|
||||
| ---- | ------- | -------- | ---- | ---------- | ------- |
|
||||
| (空) | company | business | ent | technology | idonews |
|
||||
| 首页 | 商业 | 创业 | 互娱 | 科技 | 专栏 |
|
||||
| ---- | ------- | -------- | ---- | ------- | ------- |
|
||||
| (空) | company | business | ent | digital | idonews |
|
||||
|
||||
</Route>
|
||||
|
||||
|
||||
@@ -28,8 +28,7 @@ module.exports = async (ctx) => {
|
||||
switch (column) {
|
||||
case '':
|
||||
// 首页轮播
|
||||
list = $('.focues.hide > ul > li > a').get();
|
||||
list = list.concat($('.fl.w840 > .block > dl > dd > h3 > a').slice(0, 7).get());
|
||||
list = $('a.news-item').get();
|
||||
|
||||
break;
|
||||
case 'ent':
|
||||
|
||||
@@ -1,19 +1,15 @@
|
||||
const cheerio = require('cheerio');
|
||||
const got = require('@/utils/got');
|
||||
const date = require('@/utils/date');
|
||||
|
||||
const ProcessFeed = async (link) => {
|
||||
const response = await got.get(link);
|
||||
|
||||
const $ = cheerio.load(response.data);
|
||||
|
||||
const meta = $($('#main .fl')[0]);
|
||||
|
||||
return {
|
||||
title: $('h1').text() || $($('h2')[1]).text(),
|
||||
author: meta.find('span:nth-child(1)').text(),
|
||||
title: $('.detail-con h1').text() || $('.detail-con h2').text().replace('{{news.title}}', ''),
|
||||
author: $('.tag > .fl > span:nth-child(2)').text().replace('{{news.author}}', ''),
|
||||
description: $('.article-con').html(),
|
||||
pubDate: date(meta.find('span:nth-child(2)').text(), 8),
|
||||
pubDate: new Date($('.tag > .fl > span:nth-child(1)').text().replace('{{news.timeFormat}}', '')),
|
||||
link,
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user