diff --git a/lib/v2/nbd/article.js b/lib/v2/nbd/article.js deleted file mode 100644 index 0cba9f757..000000000 --- a/lib/v2/nbd/article.js +++ /dev/null @@ -1,50 +0,0 @@ -const cheerio = require('cheerio'); -const got = require('@/utils/got'); -const timezone = require('@/utils/timezone'); -const { parseDate } = require('@/utils/parse-date'); -module.exports = async (ctx) => { - const url = 'https://www.nbd.com.cn/columns/332'; - const response = await got({ - method: 'get', - url, - headers: { - Referer: 'https://www.nbd.com.cn', - }, - }); - - const $ = cheerio.load(response.data); - const $list = $('li.u-news-title').slice(0, 15).get(); - const description = $('head title').text().trim(); - - const resultItem = await Promise.all( - $list.map(async (item) => { - const title = $(item).find('a').text().trim(); - const itemUrl = 'https:' + $(item).find('a').attr('href'); - - const single = await ctx.cache.tryGet(itemUrl, async () => { - const detail = await got({ - method: 'get', - url: itemUrl, - headers: { - Referer: 'https://www.nbd.com.cn', - }, - }); - const $ = cheerio.load(detail.data); - return { - title, - link: itemUrl, - pubDate: timezone(parseDate(detail.data.match(/"pubDate": "(.*)"/)[1]), +8), - description: $('div.g-article').html(), - }; - }); - return single; - }) - ); - - ctx.state.data = { - title: '重磅原创-每经网', - link: url, - item: resultItem, - description, - }; -}; diff --git a/lib/v2/nbd/index.js b/lib/v2/nbd/index.js index 506649ddf..fd4ac7c2e 100644 --- a/lib/v2/nbd/index.js +++ b/lib/v2/nbd/index.js @@ -34,6 +34,9 @@ module.exports = async (ctx) => { method: 'get', url: item.link, }); + if (!detailResponse.url.startsWith(`${rootUrl}/`)) { + return item; + } const content = cheerio.load(detailResponse.data); item.description = content('.g-articl-text').html(); @@ -45,7 +48,7 @@ module.exports = async (ctx) => { ); ctx.state.data = { - title: `${$('h1').text()} - 每经网`, + title: `${$('h1').text() || $('.u-channelname').text()} - 每经网`, link: currentUrl, item: items, }; diff --git a/lib/v2/nbd/maintainer.js b/lib/v2/nbd/maintainer.js index 3fe5eb51a..b5b235e80 100644 --- a/lib/v2/nbd/maintainer.js +++ b/lib/v2/nbd/maintainer.js @@ -1,4 +1,4 @@ module.exports = { - '/daily': ['MeXunco'], + '/daily': ['yuuow'], '/:id?': ['nczitzk'], }; diff --git a/lib/v2/nbd/radar.js b/lib/v2/nbd/radar.js index 943acc6c4..4e45ac94b 100644 --- a/lib/v2/nbd/radar.js +++ b/lib/v2/nbd/radar.js @@ -5,13 +5,13 @@ module.exports = { { title: '分类', docs: 'https://docs.rsshub.app/routes/finance#mei-jing-wang', - source: '/', - target: '/nbd', + source: ['/', '/columns/:id?'], + target: '/nbd/:id?', }, { title: '重磅原创', docs: 'https://docs.rsshub.app/routes/finance#mei-jing-wang', - source: '/', + source: ['/', '/columns/332'], target: '/nbd/daily', }, ], diff --git a/lib/v2/nbd/router.js b/lib/v2/nbd/router.js index 3e38f7de9..b982c3ca5 100644 --- a/lib/v2/nbd/router.js +++ b/lib/v2/nbd/router.js @@ -1,4 +1,4 @@ module.exports = (router) => { - router.get('/daily', require('./article')); + router.redirect('/daily', '/nbd/332'); router.get('/:id?', require('./index')); }; diff --git a/lib/v2/zcool/maintainer.js b/lib/v2/zcool/maintainer.js index 4fc7ea28e..642ae9090 100644 --- a/lib/v2/zcool/maintainer.js +++ b/lib/v2/zcool/maintainer.js @@ -2,6 +2,6 @@ module.exports = { '/discover/:type?': ['junbaor', 'nczitzk'], '/discover/:query?': ['nczitzk'], '/discover/:query?/:subCate?/:hasVideo?/:city?/:college?/:recommendLevel?/:sort?': ['nczitzk'], - '/top/:type': ['mexunco'], + '/top/:type': ['yuuow'], '/user/:uid': ['junbaor'], }; diff --git a/website/docs/routes/design.mdx b/website/docs/routes/design.mdx index 3463288f2..7ed7a96e3 100644 --- a/website/docs/routes/design.mdx +++ b/website/docs/routes/design.mdx @@ -387,7 +387,7 @@ UI 17 ### 作品总榜单 {#zhan-ku-zuo-pin-zong-bang-dan} - + 榜单类型 diff --git a/website/docs/routes/finance.mdx b/website/docs/routes/finance.mdx index 40fcae870..cb01f734c 100644 --- a/website/docs/routes/finance.mdx +++ b/website/docs/routes/finance.mdx @@ -589,7 +589,7 @@ See filters in [Report](https://www.weforum.org/reports) for Year and Platform t ### 重磅原创 {#mei-jing-wang-zhong-bang-yuan-chuang} - + ## 前瞻网 {#qian-zhan-wang} diff --git a/website/docs/routes/shopping.mdx b/website/docs/routes/shopping.mdx index 6c23204c0..700622a76 100644 --- a/website/docs/routes/shopping.mdx +++ b/website/docs/routes/shopping.mdx @@ -407,7 +407,7 @@ For instance, in `https://www.zagg.com/en_us/new-arrivals?brand=164&cat=3038%2C3 ### 最新商品 {#jiu-yun-wang-zui-xin-shang-pin} - + | 全部 | 闪购 | 秒发 | 跨境 | 尾货专场 | | ---- | ------- | ------ | -------- | -------- |