mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
fix: latest comments from lowendtalk discussions (#6437)
This commit is contained in:
@@ -4,12 +4,19 @@ const cheerio = require('cheerio');
|
||||
module.exports = async (ctx) => {
|
||||
const rootUrl = 'https://www.lowendtalk.com';
|
||||
const currentUrl = `${rootUrl}/discussion/${ctx.params.id}`;
|
||||
const response = await got({
|
||||
let response = await got({
|
||||
method: 'get',
|
||||
url: currentUrl,
|
||||
});
|
||||
|
||||
const $ = cheerio.load(response.data);
|
||||
let $ = cheerio.load(response.data);
|
||||
|
||||
response = await got({
|
||||
method: 'get',
|
||||
url: $('.LastPage').attr('href'),
|
||||
});
|
||||
|
||||
$ = cheerio.load(response.data);
|
||||
|
||||
const items = $('.userContent')
|
||||
.map((_, item) => {
|
||||
@@ -29,7 +36,7 @@ module.exports = async (ctx) => {
|
||||
.get();
|
||||
|
||||
ctx.state.data = {
|
||||
title: $('title').text(),
|
||||
title: $('h1').eq(0).text(),
|
||||
link: currentUrl,
|
||||
item: items,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user