fix(route/wechat/feeddd): obsolete domain (#12510)
* fix(route/wechat/feeddd): obsolete domain Signed-off-by: Rongrong <i@rong.moe> * Update lib/v2/wechat/radar.js --------- Signed-off-by: Rongrong <i@rong.moe>
This commit is contained in:
parent
a1b22b2d60
commit
816d29de46
|
|
@ -4086,7 +4086,16 @@ column 为 third 时可选的 category:
|
|||
|
||||
### 公众号(feeddd 来源)
|
||||
|
||||
<Route author="TonyRL Rongronggg9" example="/wechat/feeddd/6131e1441269c358aa0e2141" path="/wechat/feeddd/:id" :paramsDesc="['公众号 id,打开 `https://feeddd.org/feeds` 或 `https://cdn.jsdelivr.net/gh/feeddd/feeds/feeds_all_rss.txt`,在 URL 中找到 id;注意不是公众号页的 id,而是订阅的 id']"/>
|
||||
::: warning 注意
|
||||
|
||||
feeddd 网站不提供检索功能,请自行在 <https://cdn.jsdelivr.net/gh/feeddd/feeds/feeds_all_rss.txt> 中检索所需公众号。\
|
||||
也可以在 <https://feed.hamibot.com/feeds> 上找到最近更新的公众号。请注意公众号页 id 与订阅时实际使用的 id 不同,请先复制订阅链接,再从中获取 id。
|
||||
|
||||
feeddd 自 2023/05/04 已更换域名,原 `feeddd.org` 已失效,现在使用 `feed.hamibot.com`。请及时更新自建实例。
|
||||
|
||||
:::
|
||||
|
||||
<Route author="TonyRL Rongronggg9" example="/wechat/feeddd/6131e1441269c358aa0e2141" path="/wechat/feeddd/:id" :paramsDesc="['公众号 id,详见上方说明']"/>
|
||||
|
||||
### 公众号(自由微信来源)
|
||||
|
||||
|
|
|
|||
|
|
@ -5,10 +5,19 @@ const { finishArticleItem } = require('@/utils/wechat-mp');
|
|||
module.exports = async (ctx) => {
|
||||
const id = ctx.params.id;
|
||||
|
||||
const baseUrl = 'https://api.feeddd.org';
|
||||
const apiUrl = `${baseUrl}/feeds/${id}/json`;
|
||||
const baseUrl = 'https://feed.hamibot.com';
|
||||
const apiUrl = `${baseUrl}/api/feeds/${id}/json`;
|
||||
|
||||
const response = await got(apiUrl);
|
||||
let response;
|
||||
|
||||
try {
|
||||
response = await got(apiUrl);
|
||||
} catch (error) {
|
||||
if (error.name === 'HTTPError' && error.response.statusCode === 404) {
|
||||
throw Error('该公众号不存在,有关如何获取公众号 id,详见 https://docs.rsshub.app/new-media.html#wei-xin-gong-zhong-hao-feeddd-lai-yuan');
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
|
||||
let items = response.data.items.map((item) => ({
|
||||
title: item.title,
|
||||
|
|
|
|||
|
|
@ -32,9 +32,9 @@ module.exports = {
|
|||
},
|
||||
],
|
||||
},
|
||||
'feeddd.org': {
|
||||
'hamibot.com': {
|
||||
_name: '微信',
|
||||
'.': [
|
||||
feed: [
|
||||
{
|
||||
title: '公众号(feeddd 来源)',
|
||||
docs: 'https://docs.rsshub.app/new-media.html#wei-xin',
|
||||
|
|
|
|||
Loading…
Reference in New Issue