Files
RSSHub/lib/v2/southcn/nfapp/utils.js
T
Tim Wu e304b0ed49 feat(route): add 南方网南方+ (#12169)
* feat(route): add 南方网南方+

* Update lib/v2/southcn/nfapp/reporter.js

* Update lib/v2/southcn/maintainer.js

* fix(route): fix southcn

* opt(route): optimize southcn

* docs: fix route tag

---------
2023-04-05 19:43:34 +08:00

24 lines
598 B
JavaScript

const got = require('@/utils/got');
const cheerio = require('cheerio');
const parseArticle = (item, tryGet) =>
tryGet(item.link, async () => {
const detailResponse = await got({
method: 'get',
url: item.link,
});
const $ = cheerio.load(detailResponse.data);
$('.article-nfh-icon, .article-crumb, .article-share, .article-copyright').remove();
item.description += $('#content').html() ?? '';
item.author = $('meta[name="author"]').attr('content');
return item;
});
module.exports = {
parseArticle,
};