diff --git a/docs/programming.md b/docs/programming.md index c5c924605e..d6b1d4101a 100644 --- a/docs/programming.md +++ b/docs/programming.md @@ -113,7 +113,7 @@ GitHub 官方也提供了一些 RSS: ### Trending - + ### Topics diff --git a/lib/router.js b/lib/router.js index f9baa7933b..41a952a362 100644 --- a/lib/router.js +++ b/lib/router.js @@ -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')); diff --git a/lib/routes/github/trending.js b/lib/routes/github/trending.js index 46d9c919e1..9efc474cb9 100644 --- a/lib/routes/github/trending.js +++ b/lib/routes/github/trending.js @@ -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',