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 土猛的员外 blog (DIYgod#13215)
* feat(route): add 土猛的员外 blog * fix: review problem
- Loading branch information
Showing
5 changed files
with
52 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,28 @@ | ||
const got = require('@/utils/got'); | ||
const { parseDate } = require('@/utils/parse-date'); | ||
|
||
module.exports = async (ctx) => { | ||
const { data } = await got(`https://www.luxiangdong.com/content.json?t=${Date.now()}`); | ||
|
||
const items = data.posts.map((item) => ({ | ||
// 文章标题 | ||
title: item.title, | ||
// 文章链接 | ||
link: item.permalink, | ||
// 文章发布日期 | ||
pubDate: parseDate(item.date), | ||
// 如果有的话,文章作者 | ||
author: data.meta.author, | ||
// 如果有的话,文章分类 | ||
category: item.tags.map((tag) => tag.name), | ||
})); | ||
|
||
ctx.state.data = { | ||
// 源标题 | ||
title: '土猛的员外', | ||
// 源链接 | ||
link: 'https://www.luxiangdong.com/', | ||
// 源文章 | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
'/archive': ['Levix'], | ||
}; |
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 = { | ||
'luxiangdong.com': { | ||
_name: '土猛的员外', | ||
'.': [ | ||
{ | ||
title: '文章', | ||
docs: 'https://docs.rsshub.app/routes/blog#luxiangdong', | ||
source: ['/'], | ||
target: '/luxiangdong/archive', | ||
}, | ||
], | ||
}, | ||
}; |
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 = (router) => { | ||
router.get('/archive', require('./archive')); | ||
}; |
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