mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
fix double fetch same page
This commit is contained in:
+4
-5
@@ -41,14 +41,13 @@ module.exports = async (ctx) => {
|
||||
throw Error(`暂不支持对${type}的订阅`);
|
||||
}
|
||||
|
||||
const items = await util.ProcessList(baseUrl, baseUrl, listName, listDate);
|
||||
const pageName = await util.ProcessPageName(baseUrl, webPageName);
|
||||
const results = await util.ProcessFeed(items, artiContent, ctx.cache);
|
||||
const items = await util.ProcessList(baseUrl, baseUrl, listName, listDate,webPageName);
|
||||
const results = await util.ProcessFeed(items[0], artiContent, ctx.cache);
|
||||
|
||||
ctx.state.data = {
|
||||
title: 'NUA-设计学院-' + pageName,
|
||||
title: 'NUA-设计学院-' + items[1],
|
||||
link: baseUrl,
|
||||
description: '南京艺术学院 设计学院 ' + pageName,
|
||||
description: '南京艺术学院 设计学院 ' + items[1],
|
||||
item: results,
|
||||
};
|
||||
};
|
||||
|
||||
+4
-5
@@ -9,14 +9,13 @@ module.exports = async (ctx) => {
|
||||
const listDate = '.Article_PublishDate';
|
||||
const webPageName = '.col_title';
|
||||
|
||||
const items = await util.ProcessList(newsUrl, baseUrl, listName, listDate);
|
||||
const pageName = await util.ProcessPageName(newsUrl, webPageName);
|
||||
const results = await util.ProcessFeed(items, artiContent, ctx.cache);
|
||||
const items = await util.ProcessList(newsUrl, baseUrl, listName, listDate, webPageName);
|
||||
const results = await util.ProcessFeed(items[0], artiContent, ctx.cache);
|
||||
|
||||
ctx.state.data = {
|
||||
title: 'NUA-研究生处-' + pageName,
|
||||
title: 'NUA-研究生处-' + items[1],
|
||||
link: `${baseUrl}/${type}/list.htm`,
|
||||
description: '南京艺术学院 研究生处 ' + pageName,
|
||||
description: '南京艺术学院 研究生处 ' + items[1],
|
||||
item: results,
|
||||
};
|
||||
};
|
||||
|
||||
+4
-5
@@ -10,14 +10,13 @@ module.exports = async (ctx) => {
|
||||
const webPageName = '.col_title';
|
||||
|
||||
const artiContent = '.read';
|
||||
const items = await util.ProcessList(newsUrl, baseUrl, listName, listDate);
|
||||
const pageName = await util.ProcessPageName(newsUrl, webPageName);
|
||||
const results = await util.ProcessFeed(items, artiContent, ctx.cache);
|
||||
const items = await util.ProcessList(newsUrl, baseUrl, listName, listDate, webPageName);
|
||||
const results = await util.ProcessFeed(items[0], artiContent, ctx.cache);
|
||||
|
||||
ctx.state.data = {
|
||||
title: 'NUA-' + pageName,
|
||||
title: 'NUA-' + items[1],
|
||||
link: newsUrl,
|
||||
description: '南京艺术学院 ' + pageName,
|
||||
description: '南京艺术学院 ' + items[1],
|
||||
item: results,
|
||||
};
|
||||
};
|
||||
|
||||
+4
-5
@@ -10,14 +10,13 @@ module.exports = async (ctx) => {
|
||||
const webPageName = '.Column_Anchor';
|
||||
|
||||
const artiContent = '.read';
|
||||
const items = await util.ProcessList(newsUrl, baseUrl, listName, listDate);
|
||||
const pageName = await util.ProcessPageName(newsUrl, webPageName);
|
||||
const results = await util.ProcessFeed(items, artiContent, ctx.cache);
|
||||
const items = await util.ProcessList(newsUrl, baseUrl, listName, listDate, webPageName);
|
||||
const results = await util.ProcessFeed(items[0], artiContent, ctx.cache);
|
||||
|
||||
ctx.state.data = {
|
||||
title: 'NUA-双馨网-' + pageName,
|
||||
title: 'NUA-双馨网-' + items[1],
|
||||
link: newsUrl,
|
||||
description: '南京艺术学院 双馨网 ' + pageName,
|
||||
description: '南京艺术学院 双馨网 ' + items[1],
|
||||
item: results,
|
||||
};
|
||||
};
|
||||
|
||||
+4
-16
@@ -3,7 +3,7 @@ const cheerio = require('cheerio');
|
||||
const { parseDate } = require('@/utils/parse-date');
|
||||
const timezone = require('@/utils/timezone');
|
||||
|
||||
async function ProcessList(newsUrl, baseUrl, listName, listDate) {
|
||||
async function ProcessList(newsUrl, baseUrl, listName, listDate, webPageName) {
|
||||
const result = await got(newsUrl, {
|
||||
https: {
|
||||
rejectUnauthorized: false,
|
||||
@@ -11,6 +11,8 @@ async function ProcessList(newsUrl, baseUrl, listName, listDate) {
|
||||
});
|
||||
const $ = cheerio.load(result.data);
|
||||
|
||||
const pageName = $(webPageName).text();
|
||||
|
||||
let artiLink;
|
||||
|
||||
const items = $(listName)
|
||||
@@ -30,20 +32,7 @@ async function ProcessList(newsUrl, baseUrl, listName, listDate) {
|
||||
};
|
||||
});
|
||||
|
||||
return items;
|
||||
}
|
||||
|
||||
async function ProcessPageName(newsUrl, webPageName) {
|
||||
const result = await got(newsUrl, {
|
||||
https: {
|
||||
rejectUnauthorized: false,
|
||||
},
|
||||
});
|
||||
const $ = cheerio.load(result.data);
|
||||
|
||||
const pageName = $(webPageName).text();
|
||||
|
||||
return pageName;
|
||||
return [items, pageName];
|
||||
}
|
||||
|
||||
const ProcessFeed = async (items, artiContent, cache) =>
|
||||
@@ -67,6 +56,5 @@ const ProcessFeed = async (items, artiContent, cache) =>
|
||||
|
||||
module.exports = {
|
||||
ProcessList,
|
||||
ProcessPageName,
|
||||
ProcessFeed,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user