mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
feat(route): add spoken_language for GitHub Trending (#8456)
This commit is contained in:
+1
-1
@@ -113,7 +113,7 @@ GitHub 官方也提供了一些 RSS:
|
||||
|
||||
### Trending
|
||||
|
||||
<Route author="DIYgod" example="/github/trending/daily/javascript" path="/github/trending/:since/:language?" :paramsDesc="['时间跨度, 可在 [Trending 页](https://github.com/trending/javascript?since=monthly) URL 中找到, 可选 daily weekly monthly', '语言, 可在 [Trending 页](https://github.com/trending/javascript?since=monthly) URL 中找到']" radar="1" rssbud="1"/>
|
||||
<Route author="DIYgod" example="/github/trending/daily/javascript/zh" path="/github/trending/:since/:language?/:spoken_language?" :paramsDesc="['时间跨度, 可在 [Trending 页](https://github.com/trending/javascript?since=monthly&spoken_language_code=zh) URL 中找到, 可选 daily weekly monthly', '语言, 可在 [Trending 页](https://github.com/trending/javascript?since=monthly&spoken_language_code=zh) URL 中找到', '自然语言, 可在 [Trending 页](https://github.com/trending/javascript?since=monthly&spoken_language_code=zh) URL 中找到']" radar="1" rssbud="1"/>
|
||||
|
||||
### Topics
|
||||
|
||||
|
||||
+1
-1
@@ -278,7 +278,7 @@ router.get('/readhub/category/:category', lazyloadRouteHandler('./routes/readhub
|
||||
|
||||
// GitHub
|
||||
router.get('/github/repos/:user', lazyloadRouteHandler('./routes/github/repos'));
|
||||
router.get('/github/trending/:since/:language?', lazyloadRouteHandler('./routes/github/trending'));
|
||||
router.get('/github/trending/:since/:language?/:spoken_language?', lazyloadRouteHandler('./routes/github/trending'));
|
||||
router.get('/github/issue/:user/:repo/:state?/:labels?', lazyloadRouteHandler('./routes/github/issue'));
|
||||
router.get('/github/pull/:user/:repo', lazyloadRouteHandler('./routes/github/pulls'));
|
||||
router.get('/github/user/followers/:user', lazyloadRouteHandler('./routes/github/follower'));
|
||||
|
||||
@@ -4,7 +4,8 @@ const cheerio = require('cheerio');
|
||||
module.exports = async (ctx) => {
|
||||
const since = ctx.params.since;
|
||||
const language = ctx.params.language || '';
|
||||
const url = `https://github.com/trending/${encodeURIComponent(language)}?since=${since}`;
|
||||
const spoken_language = ctx.params.spoken_language || '';
|
||||
const url = `https://github.com/trending/${encodeURIComponent(language)}?since=${since}&spoken_language_code=${spoken_language}`;
|
||||
|
||||
const response = await got({
|
||||
method: 'get',
|
||||
|
||||
Reference in New Issue
Block a user