mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-06 13:08:14 +08:00
fix: matters item (#3929)
This commit is contained in:
@@ -6,7 +6,7 @@ module.exports = async (ctx) => {
|
|||||||
|
|
||||||
const res = await got.get(url);
|
const res = await got.get(url);
|
||||||
const $ = cheerio.load(res.data);
|
const $ = cheerio.load(res.data);
|
||||||
const list = $('li section.container').get();
|
const list = $('section.list-item').get();
|
||||||
|
|
||||||
const proList = [];
|
const proList = [];
|
||||||
const indexList = [];
|
const indexList = [];
|
||||||
@@ -16,10 +16,8 @@ module.exports = async (ctx) => {
|
|||||||
const $ = cheerio.load(item);
|
const $ = cheerio.load(item);
|
||||||
const time = $('time').attr('datetime');
|
const time = $('time').attr('datetime');
|
||||||
const title = $('h2').text();
|
const title = $('h2').text();
|
||||||
const author = $('div.content a')
|
const author = $('span.displayname').text();
|
||||||
.attr('href')
|
const postfix = encodeURI($('section.title > a').attr('href'));
|
||||||
.replace(/\/@(.*?)\/.*/, '$1');
|
|
||||||
const postfix = encodeURI($('div.content a').attr('href'));
|
|
||||||
const address = `https://matters.news${postfix}`;
|
const address = `https://matters.news${postfix}`;
|
||||||
const cache = await ctx.cache.get(address);
|
const cache = await ctx.cache.get(address);
|
||||||
if (cache) {
|
if (cache) {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ module.exports = async (ctx) => {
|
|||||||
|
|
||||||
const res = await got.get(url);
|
const res = await got.get(url);
|
||||||
const $ = cheerio.load(res.data);
|
const $ = cheerio.load(res.data);
|
||||||
const list = $('article li section.container').get();
|
const list = $('article section.list-item').get();
|
||||||
|
|
||||||
const proList = [];
|
const proList = [];
|
||||||
const indexList = [];
|
const indexList = [];
|
||||||
@@ -16,10 +16,8 @@ module.exports = async (ctx) => {
|
|||||||
const $ = cheerio.load(item);
|
const $ = cheerio.load(item);
|
||||||
const time = $('time').attr('datetime');
|
const time = $('time').attr('datetime');
|
||||||
const title = $('h2').text();
|
const title = $('h2').text();
|
||||||
const author = $('div.content a')
|
const author = $('span.displayname').text();
|
||||||
.attr('href')
|
const partial = encodeURI($('section.title > a').attr('href'));
|
||||||
.replace(/\/@(.*?)\/.*/, '$1');
|
|
||||||
const partial = encodeURI($('div.content a').attr('href'));
|
|
||||||
const completeUrl = `https://matters.news${partial}`;
|
const completeUrl = `https://matters.news${partial}`;
|
||||||
const cache = await ctx.cache.get(completeUrl);
|
const cache = await ctx.cache.get(completeUrl);
|
||||||
if (cache) {
|
if (cache) {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ module.exports = async (ctx) => {
|
|||||||
|
|
||||||
const res = await got.get(url);
|
const res = await got.get(url);
|
||||||
const $ = cheerio.load(res.data);
|
const $ = cheerio.load(res.data);
|
||||||
const list = $('li section.container').get();
|
const list = $('section.list-item').get();
|
||||||
|
|
||||||
const proList = [];
|
const proList = [];
|
||||||
const indexList = [];
|
const indexList = [];
|
||||||
@@ -16,10 +16,8 @@ module.exports = async (ctx) => {
|
|||||||
const $ = cheerio.load(item);
|
const $ = cheerio.load(item);
|
||||||
const time = $('time').attr('datetime');
|
const time = $('time').attr('datetime');
|
||||||
const title = $('h2').text();
|
const title = $('h2').text();
|
||||||
const author = $('div.content a')
|
const author = $('span.displayname').text();
|
||||||
.attr('href')
|
const postfix = encodeURI($('section.title > a').attr('href'));
|
||||||
.replace(/\/@(.*?)\/.*/, '$1');
|
|
||||||
const postfix = encodeURI($('div.content a').attr('href'));
|
|
||||||
const address = `https://matters.news${postfix}`;
|
const address = `https://matters.news${postfix}`;
|
||||||
const cache = await ctx.cache.get(address);
|
const cache = await ctx.cache.get(address);
|
||||||
if (cache) {
|
if (cache) {
|
||||||
|
|||||||
Reference in New Issue
Block a user