forked from DIYgod/RSSHub
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(route): add HiFeng'Blog (DIYgod#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>
- Loading branch information
1 parent
b53061b
commit 1caaa4f
Showing
5 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
'/': ['cnkmmk'], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module.exports = { | ||
'hicairo.com': { | ||
_name: "HiFeng'Blog", | ||
'.': [ | ||
{ | ||
title: '博客', | ||
docs: 'https://docs.rsshub.app/routes/blog#hifeng-blog', | ||
source: ['/'], | ||
target: '/hicairo', | ||
}, | ||
], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = function (router) { | ||
router.get('/', require('./rss')); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters