feat(route): 增加Issue Hunt订阅 (#11818)
* feat(route): 增加Issue Hunt订阅 * feat(route): 增加英文文档和Markdown解析 * Update lib/v2/issuehunt/maintainer.js * Update docs/en/programming.md * Update lib/v2/issuehunt/radar.js * Update docs/programming.md * Update lib/v2/issuehunt/radar.js * Update docs/programming.md ---------
This commit is contained in:
parent
baa35af744
commit
22b19f2a4f
|
|
@ -290,6 +290,12 @@ Subscribe to the updates (threads and submission) from a paritcular Hacker News
|
|||
|
||||
<RouteEn author="hellodword" example="/hex-rays/news" path="/hex-rays/news" />
|
||||
|
||||
## Issue Hunt
|
||||
|
||||
### Project Funded
|
||||
|
||||
<RouteEn author="running-grass" radar="1" example="/issuehunt/funded/DIYgod/RSSHub" path="/issuehunt/funded/:username/:repo" :paramsDesc="['Github user/org','Repository name']" />
|
||||
|
||||
## Kaggle
|
||||
|
||||
### Discussion
|
||||
|
|
|
|||
|
|
@ -461,6 +461,12 @@ GitHub 官方也提供了一些 RSS:
|
|||
|
||||
<Route author="hellodword" example="/hex-rays/news" path="/hex-rays/news"/>
|
||||
|
||||
## Issue Hunt
|
||||
|
||||
### 项目悬赏
|
||||
|
||||
<Route author="running-grass" radar="1" example="/issuehunt/funded/DIYgod/RSSHub" path="/issuehunt/funded/:username/:repo" :paramsDesc="['Github用户/组织','仓库名称']" />
|
||||
|
||||
## ITSlide
|
||||
|
||||
### 最新
|
||||
|
|
|
|||
|
|
@ -0,0 +1,28 @@
|
|||
const got = require('@/utils/got');
|
||||
const MarkdownIt = require('markdown-it');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const { username, repo } = ctx.params;
|
||||
const response = await got(`https://issuehunt.io/apis/pages/repos/show?repositoryOwnerName=${username}&repositoryName=${repo}`);
|
||||
|
||||
const { issues } = response.data;
|
||||
if (issues === undefined) {
|
||||
throw new Error('没有获取到数据');
|
||||
}
|
||||
|
||||
const md = MarkdownIt({
|
||||
html: true,
|
||||
});
|
||||
ctx.state.data = {
|
||||
title: `Issue Hunt 的悬赏 -- ${username}/${repo}`,
|
||||
link: `https://issuehunt.io/r/${username}/${repo}`,
|
||||
description: ``,
|
||||
item: issues.map((item) => ({
|
||||
title: item.title,
|
||||
description: md.render(item.body),
|
||||
pubDate: item.fundedAt,
|
||||
link: `https://issuehunt.io/r/${username}/${repo}/issues/${item.number}`,
|
||||
author: item.userName,
|
||||
})),
|
||||
};
|
||||
};
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
module.exports = {
|
||||
'/funded/:username/:repo': ['running-grass'],
|
||||
};
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
module.exports = {
|
||||
'issuehunt.io': {
|
||||
_name: 'Issue Hunt',
|
||||
'.': [
|
||||
{
|
||||
title: '项目悬赏',
|
||||
docs: 'https://docs.rsshub.app/programming.html#issue-hunt-xiang-mu-xuan-shang',
|
||||
source: '/r/:username/:repo',
|
||||
target: ({ username, repo }) => `/issuehunt/funded/${username}/${repo}`,
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
module.exports = (router) => {
|
||||
router.get('/funded/:username/:repo', require('./funded'));
|
||||
};
|
||||
Loading…
Reference in New Issue