mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
feat(route): add HiFeng'Blog (#14518)
* 增加 免費資源網路社群 * style: auto format * 更新 rss.js 使用 wordpress 的 api 来获取数据 * 更新 rss.js * 更新 rss.js * 更新 rss.js * 增加 HiFeng'Blog * 更新 rss.js * 更新 rss.js * 更新 rss.js * 更新 rss.js * 更新 rss.js * 更新 rss.js * 更新 rss.js * 更新 rss.js * 更新 rss.js * 1 * 2 * 3 * 4 * 更新 rss.js * 1 * 更新 router.js * 更新 rss1.js * 改router文件 * 更新 rss.js * 修改 hicairo * 更新 radar.js * 更新 rss.js * 更新 rss.js * Update lib/v2/hicairo/radar.js Co-authored-by: Tony <TonyRL@users.noreply.github.com> --------- Co-authored-by: pull[bot] <39814207+pull[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
Tony
pull[bot]
github-actions[bot]
parent
b53061bcbb
commit
1caaa4f578
@@ -0,0 +1,3 @@
|
||||
module.exports = {
|
||||
'/': ['cnkmmk'],
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
module.exports = {
|
||||
'hicairo.com': {
|
||||
_name: "HiFeng'Blog",
|
||||
'.': [
|
||||
{
|
||||
title: '博客',
|
||||
docs: 'https://docs.rsshub.app/routes/blog#hifeng-blog',
|
||||
source: ['/'],
|
||||
target: '/hicairo',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,3 @@
|
||||
module.exports = function (router) {
|
||||
router.get('/', require('./rss'));
|
||||
};
|
||||
@@ -0,0 +1,32 @@
|
||||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const currentUrl = 'https://www.hicairo.com';
|
||||
const response = await got(`${currentUrl}/feed.php`);
|
||||
const $ = cheerio.load(response.data, { xmlMode: true });
|
||||
const title_main = $('channel > title').text();
|
||||
const description_main = $('channel > description').text();
|
||||
const items = $('channel > item')
|
||||
.map((_, item) => {
|
||||
const $item = $(item);
|
||||
const link = $item.find('link').text();
|
||||
const title = $item.find('title').text();
|
||||
const description = $item.find('description').text();
|
||||
const pubDate = $item.find('pubDate').text();
|
||||
return {
|
||||
link,
|
||||
pubDate, // no need to normalize because it's from a valid RSS feed
|
||||
title,
|
||||
description,
|
||||
};
|
||||
})
|
||||
.get();
|
||||
|
||||
ctx.state.data = {
|
||||
title: title_main,
|
||||
description: description_main,
|
||||
link: currentUrl,
|
||||
item: items,
|
||||
};
|
||||
};
|
||||
@@ -473,3 +473,9 @@
|
||||
### 上周热门 TOP 20 {#zhu-bai-shang-zhou-re-men-top-20}
|
||||
|
||||
<Route author="nczitzk" example="/zhubai/top20" path="/zhubai/top20" radar="1" />
|
||||
|
||||
## HiFeng'Blog {#Hi-Feng-Blog}
|
||||
|
||||
### 博客 {#Hi-Feng-Blog-bo-ke}
|
||||
|
||||
<Route author="aneasystone" example="/hicairo" path="/hicairo" />
|
||||
Reference in New Issue
Block a user