mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-11 23:59:56 +08:00
fix(route): nbd (#11847)
This commit is contained in:
@@ -7,7 +7,7 @@ module.exports = async (ctx) => {
|
||||
const id = ctx.params.id ?? '3';
|
||||
|
||||
const rootUrl = 'https://www.nbd.com.cn';
|
||||
const currentUrl = `${rootUrl}/columns/${id}`;
|
||||
const currentUrl = `${rootUrl}/columns/${id}/`;
|
||||
|
||||
const response = await got({
|
||||
method: 'get',
|
||||
@@ -17,15 +17,15 @@ module.exports = async (ctx) => {
|
||||
const $ = cheerio.load(response.data);
|
||||
|
||||
const list = $('.u-news-title a')
|
||||
.map((_, item) => {
|
||||
.toArray()
|
||||
.map((item) => {
|
||||
item = $(item);
|
||||
|
||||
return {
|
||||
title: item.text(),
|
||||
link: 'https:' + item.attr('href'),
|
||||
link: item.attr('href'),
|
||||
};
|
||||
})
|
||||
.get();
|
||||
});
|
||||
|
||||
const items = await Promise.all(
|
||||
list.map((item) =>
|
||||
@@ -45,7 +45,7 @@ module.exports = async (ctx) => {
|
||||
);
|
||||
|
||||
ctx.state.data = {
|
||||
title: `${$('.u-channelname').text()} - 每经网`,
|
||||
title: `${$('h1').text()} - 每经网`,
|
||||
link: currentUrl,
|
||||
item: items,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user