fix(route): 壹蘋新聞網獲取失敗 (#11261)

This commit is contained in:
miles
2022-11-12 12:59:52 +07:00
committed by GitHub
parent df175f4dd8
commit d3d1425f94
2 changed files with 13 additions and 5 deletions
+12 -4
View File
@@ -4250,11 +4250,19 @@ wechat-feeds 来源[已停止更新](https://github.com/hellodword/wechat-feeds/
### 最新新聞
<Route author="miles170" example="/nextapple/realtime/new" path="/nextapple/realtime/:category?" :paramsDesc="['類別,見下表,默認為最新']">
<Route author="miles170" example="/nextapple/realtime/today" path="/nextapple/realtime/:category?" :paramsDesc="['類別,見下表,默認為首頁']">
| 最新 | 娛樂 | 生活 | 社會 | 政治 | 國際 | 財經 | 飲食旅遊 | 房市 | 時尚 | 車市 | 健康 | 體育 | 3C |
| --- | ------------- | ---- | ----- | -------- | ------------- | ------- | --------- | -------- | ------- | ---- | ------ | ------ | ------ |
| new | entertainment | life | local | politics | international | finance | lifestyle | property | fashion | auto | health | sports | gadget |
| 首頁 | 最新 | 焦點 | 熱門 | 娛樂 | 生活 | 女神 | 社會 |
| ----- | ------ | --------- | --- | ------------- | ---- | -------- | ----- |
| today | latest | recommend | hit | entertainment | life | gorgeous | local |
| 政治 | 國際 | 財經 | 區塊鏈 | 房市 | 時尚 | 體育 |
| -------- | ------------- | ------- | ---------- | -------- | ------- | ------ |
| politics | international | finance | blockchain | property | fashion | sports |
| 旅遊美食 | 3C 車市 | 蘋理 |
| --------- | ------ | ----- |
| lifestyle | gadget | forum |
</Route>
+1 -1
View File
@@ -4,7 +4,7 @@ const cheerio = require('cheerio');
const asyncPool = require('tiny-async-pool');
module.exports = async (ctx) => {
const category = ctx.params.category ?? 'new';
const category = ctx.params.category ?? 'today';
const currentUrl = `https://tw.nextapple.com/realtime/${category}`;
const response = await got(currentUrl);
const $ = cheerio.load(response.data);