mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
@@ -133,6 +133,8 @@ RSSHub 是一个轻量、易于扩展的 RSS 生成器,可以给任何奇奇
|
||||
- 分类
|
||||
- GitHub
|
||||
- 用户仓库
|
||||
- Trending
|
||||
- Issue
|
||||
- Konachan.com Anime Wallpapers
|
||||
- posts
|
||||
- Popular Recent Posts
|
||||
|
||||
@@ -1165,6 +1165,15 @@ since,时间跨度,可在 [Trending 页](https://github.com/trending/javascr
|
||||
|
||||
language,语言,可在 [Trending 页](https://github.com/trending/javascript?since=monthly) URL 中找到
|
||||
|
||||
### Issue
|
||||
|
||||
举例: [https://rsshub.app/github/issue/DIYgod/RSSHub](https://rsshub.app/github/issue/DIYgod/RSSHub)
|
||||
|
||||
路由: `/github/issue/:user/:repo`
|
||||
|
||||
参数: user,用户名
|
||||
参数: repo,仓库名
|
||||
|
||||
## 纽约时报
|
||||
|
||||
::: tip 提示
|
||||
|
||||
@@ -263,6 +263,7 @@ if (config.github && config.github.access_token) {
|
||||
logger.warn('GitHub Repos RSS is disabled for lacking config.');
|
||||
}
|
||||
router.get('/github/trending/:since/:language?', require('./routes/github/trending'));
|
||||
router.get('/github/issue/:user/:repo', require('./routes/github/issue'));
|
||||
|
||||
// konachan
|
||||
router.get('/konachan/post', require('./routes/konachan/post'));
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
const axios = require('../../utils/axios');
|
||||
const config = require('../../config');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const user = ctx.params.user;
|
||||
const repo = ctx.params.repo;
|
||||
|
||||
const host = `https://github.com/repos/${user}/${repo}/issues`;
|
||||
const url = `https://api.github.com/repos/${user}/${repo}/issues`;
|
||||
|
||||
const response = await axios({
|
||||
method: 'get',
|
||||
url,
|
||||
headers: {
|
||||
'User-Agent': config.ua,
|
||||
},
|
||||
params: {
|
||||
sort: 'created',
|
||||
access_token: config.github.access_token,
|
||||
},
|
||||
});
|
||||
const data = response.data;
|
||||
ctx.state.data = {
|
||||
title: `${user}/${repo} Issues`,
|
||||
link: host,
|
||||
item:
|
||||
data &&
|
||||
data.map((item) => ({
|
||||
title: item.title,
|
||||
description: item.body || 'No description',
|
||||
pubDate: new Date(item.created_at),
|
||||
link: `${host}/${item.number}`,
|
||||
})),
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user