mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-08 05:59:00 +08:00
* fix(route) thepaper now use nextjs as backend * Id to Name for channel and list * summary ok * determine the detail by null check instead of type check * list_url for better reading * add failback of thumbnail * fix video article * add list for thepaper * add list for thepaper * del the dup line * small fix and optimize * add maintainer
18 lines
558 B
JavaScript
18 lines
558 B
JavaScript
const utils = require('./utils');
|
|
const cheerio = require('cheerio');
|
|
const got = require('@/utils/got');
|
|
|
|
module.exports = async (ctx) => {
|
|
const response = await got('https://m.thepaper.cn');
|
|
const data = JSON.parse(cheerio.load(response.data)('#__NEXT_DATA__').html());
|
|
const list = data.props.pageProps.data.list;
|
|
|
|
const items = await Promise.all(list.map((item) => utils.ProcessItem(item, ctx)));
|
|
|
|
ctx.state.data = {
|
|
title: '澎湃新闻 - 首页头条',
|
|
link: 'https://m.thepaper.cn',
|
|
item: items,
|
|
};
|
|
};
|