fix(route): gamme (#14108)

This commit is contained in:
Tony
2023-12-24 23:54:46 +08:00
committed by GitHub
parent 30ed60da40
commit 26d4afcd56
2 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -11,7 +11,7 @@ module.exports = async (ctx) => {
const baseUrl = `https://${domain}.gamme.com.tw`;
const feed = await parser.parseURL(`${baseUrl + (category ? `/category/${category}` : '')}/feed`);
await Promise.all(
const items = await Promise.all(
feed.items.map((item) =>
ctx.cache.tryGet(item.link, async () => {
const { data } = await got(item.link);
@@ -45,6 +45,6 @@ module.exports = async (ctx) => {
link: feed.link,
image: domain === 'news' ? `${baseUrl}/blogico.ico` : `${baseUrl}/favicon.ico`,
description: feed.description,
item: feed.items,
item: items,
};
};
+3 -3
View File
@@ -14,7 +14,7 @@ module.exports = async (ctx) => {
const { data } = await got(pageUrl);
const $ = cheerio.load(data);
const items = $('#category_new li a, .List-4 h3 a')
const list = $('#category_new li a, .List-4 h3 a')
.toArray()
.map((item) => {
item = $(item);
@@ -24,8 +24,8 @@ module.exports = async (ctx) => {
};
});
await Promise.all(
items.map((item) =>
const items = await Promise.all(
list.map((item) =>
ctx.cache.tryGet(item.link, async () => {
const { data } = await got(item.link);
const $ = cheerio.load(data);