rsshub 1.0.0-master.d62365e → 1.0.0-master.d72dce4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/lib/config.js +3 -0
  2. package/lib/middleware/parameter.js +3 -1
  3. package/lib/radar-rules.js +0 -144
  4. package/lib/router.js +2 -56
  5. package/lib/routes/ehentai/ehapi.js +0 -1
  6. package/lib/routes/universities/sjtu/jwc.js +51 -53
  7. package/lib/routes/yxdzqb/index.js +5 -5
  8. package/lib/routes/zhihu/collection.js +26 -2
  9. package/lib/routes/zhihu/pin/utils.js +17 -7
  10. package/lib/routes/zhihu/posts.js +2 -1
  11. package/lib/routes/zhihu/topic.js +10 -2
  12. package/lib/routes/zhihu/zhuanlan.js +12 -1
  13. package/lib/v2/consumer/index.js +55 -0
  14. package/lib/v2/consumer/maintainer.js +3 -0
  15. package/lib/v2/consumer/radar.js +13 -0
  16. package/lib/v2/consumer/router.js +3 -0
  17. package/lib/{routes → v2}/dockerhub/build.js +3 -1
  18. package/lib/v2/dockerhub/maintainer.js +4 -0
  19. package/lib/v2/dockerhub/radar.js +19 -0
  20. package/lib/v2/dockerhub/router.js +4 -0
  21. package/lib/v2/dockerhub/tag.js +33 -0
  22. package/lib/v2/dockerhub/utils.js +10 -0
  23. package/lib/{routes → v2}/douban/book/rank.js +0 -0
  24. package/lib/{routes → v2}/douban/channel/subject.js +0 -0
  25. package/lib/{routes → v2}/douban/channel/topic.js +0 -0
  26. package/lib/{routes → v2}/douban/commercialpress/latest.js +0 -0
  27. package/lib/{routes → v2}/douban/event/hot.js +0 -0
  28. package/lib/v2/douban/maintainer.js +27 -0
  29. package/lib/{routes/douban → v2/douban/other}/bookstore.js +0 -0
  30. package/lib/{routes/douban → v2/douban/other}/celebrity.js +0 -0
  31. package/lib/{routes/douban → v2/douban/other}/classification.js +0 -0
  32. package/lib/{routes/douban → v2/douban/other}/doulist.js +0 -0
  33. package/lib/v2/douban/other/explore.js +50 -0
  34. package/lib/{routes/douban → v2/douban/other}/explore_column.js +0 -0
  35. package/lib/{routes/douban → v2/douban/other}/group.js +1 -1
  36. package/lib/v2/douban/other/jobs.js +33 -0
  37. package/lib/{routes/douban → v2/douban/other}/later.js +0 -0
  38. package/lib/{routes/douban → v2/douban/other}/latest_book.js +0 -0
  39. package/lib/{routes/douban → v2/douban/other}/latest_music.js +0 -0
  40. package/lib/{routes/douban → v2/douban/other}/playing.js +0 -0
  41. package/lib/{routes/douban → v2/douban/other}/replied.js +0 -0
  42. package/lib/{routes/douban → v2/douban/other}/replies.js +0 -0
  43. package/lib/{routes/douban → v2/douban/other}/topic.js +0 -0
  44. package/lib/{routes/douban → v2/douban/other}/ustop.js +0 -0
  45. package/lib/{routes/douban → v2/douban/other}/weekly_best.js +0 -0
  46. package/lib/{routes → v2}/douban/people/status.js +0 -0
  47. package/lib/{routes → v2}/douban/people/wish.js +0 -0
  48. package/lib/v2/douban/radar.js +54 -0
  49. package/lib/v2/douban/router.js +27 -0
  50. package/lib/v2/douban/templates/explore.art +7 -0
  51. package/lib/v2/epicgames/router.js +1 -1
  52. package/lib/{routes → v2}/github/branches.js +0 -0
  53. package/lib/{routes → v2}/github/contributors.js +0 -0
  54. package/lib/{routes → v2}/github/file.js +0 -0
  55. package/lib/{routes → v2}/github/follower.js +0 -0
  56. package/lib/{routes → v2}/github/issue.js +0 -0
  57. package/lib/v2/github/maintainer.js +12 -0
  58. package/lib/{routes → v2}/github/pulls.js +0 -0
  59. package/lib/v2/github/radar.js +66 -0
  60. package/lib/{routes → v2}/github/repos.js +0 -0
  61. package/lib/v2/github/router.js +12 -0
  62. package/lib/{routes → v2}/github/search.js +0 -0
  63. package/lib/{routes → v2}/github/star.js +0 -0
  64. package/lib/{routes → v2}/github/starred_repos.js +0 -0
  65. package/lib/{routes → v2}/github/topic.js +0 -0
  66. package/lib/{routes → v2}/github/trending.js +3 -3
  67. package/lib/{routes → v2}/google/album.js +0 -0
  68. package/lib/{routes → v2}/google/citations.js +0 -0
  69. package/lib/{routes → v2}/google/doodles.js +0 -0
  70. package/lib/v2/google/fonts.js +43 -0
  71. package/lib/v2/google/maintainer.js +8 -0
  72. package/lib/{routes → v2}/google/news.js +0 -0
  73. package/lib/v2/google/radar.js +64 -0
  74. package/lib/v2/google/router.js +8 -0
  75. package/lib/{routes → v2}/google/scholar.js +0 -0
  76. package/lib/{routes → v2}/google/sites.js +0 -0
  77. package/lib/v2/google/templates/fonts.art +15 -0
  78. package/lib/v2/jandan/index.js +6 -1
  79. package/lib/v2/latepost/index.js +62 -0
  80. package/lib/v2/latepost/maintainer.js +3 -0
  81. package/lib/v2/latepost/radar.js +13 -0
  82. package/lib/v2/latepost/router.js +3 -0
  83. package/lib/v2/leiphone/index.js +1 -1
  84. package/lib/v2/leiphone/radar.js +1 -1
  85. package/lib/v2/leiphone/router.js +1 -1
  86. package/lib/v2/qq/ac/comic.js +43 -0
  87. package/lib/v2/qq/ac/rank.js +20 -0
  88. package/lib/v2/qq/ac/templates/description.art +9 -0
  89. package/lib/v2/qq/ac/utils.js +71 -0
  90. package/lib/v2/qq/maintainer.js +2 -0
  91. package/lib/v2/qq/radar.js +14 -0
  92. package/lib/v2/qq/router.js +2 -0
  93. package/lib/v2/taobao/maintainer.js +3 -0
  94. package/lib/v2/taobao/radar.js +117 -0
  95. package/lib/v2/taobao/router.js +3 -0
  96. package/lib/v2/taobao/templates/zhongchou.art +4 -0
  97. package/lib/{routes → v2}/taobao/zhongchou.js +6 -7
  98. package/lib/v2/wechat/feeddd.js +13 -5
  99. package/lib/v2/wechat/maintainer.js +1 -1
  100. package/package.json +1 -1
  101. package/lib/routes/douban/explore.js +0 -33
  102. package/lib/routes/latepost/index.js +0 -84
@@ -0,0 +1,55 @@
1
+ const got = require('@/utils/got');
2
+ const cheerio = require('cheerio');
3
+ const { parseDate } = require('@/utils/parse-date');
4
+
5
+ module.exports = async (ctx) => {
6
+ const category = ctx.params.category ?? 'test';
7
+ const language = ctx.params.language ?? 'tc';
8
+ const keyword = ctx.params.keyword ?? '';
9
+
10
+ const rootUrl = 'https://www.consumer.org.hk';
11
+ const currentUrl = `${rootUrl}/${language}/free-article/free-article-${category}?category=free-article-${category}&q=${keyword}`;
12
+
13
+ const response = await got({
14
+ method: 'get',
15
+ url: currentUrl,
16
+ });
17
+
18
+ const $ = cheerio.load(response.data);
19
+
20
+ let items = $('.half-img-blk__title, .img-plate-blk__title')
21
+ .find('a')
22
+ .toArray()
23
+ .map((item) => {
24
+ item = $(item);
25
+
26
+ return {
27
+ title: item.text(),
28
+ link: `${rootUrl}${item.attr('href')}`,
29
+ pubDate: parseDate(item.parent().prev().find('li').first().text(), 'YYYY.MM'),
30
+ };
31
+ });
32
+
33
+ items = await Promise.all(
34
+ items.map((item) =>
35
+ ctx.cache.tryGet(item.link, async () => {
36
+ const detailResponse = await got({
37
+ method: 'get',
38
+ url: item.link,
39
+ });
40
+
41
+ const content = cheerio.load(detailResponse.data);
42
+
43
+ item.description = content('.ckec').html();
44
+
45
+ return item;
46
+ })
47
+ )
48
+ );
49
+
50
+ ctx.state.data = {
51
+ title: $('title').text(),
52
+ link: currentUrl,
53
+ item: items,
54
+ };
55
+ };
@@ -0,0 +1,3 @@
1
+ module.exports = {
2
+ '/:category?/:language?/:keyword?': ['nczitzk'],
3
+ };
@@ -0,0 +1,13 @@
1
+ module.exports = {
2
+ 'consumer.org.hk': {
3
+ _name: '消费者委员会',
4
+ '.': [
5
+ {
6
+ title: '文章',
7
+ docs: 'https://docs.rsshub.app/new-media.html#xiao-fei-zhe-wei-yuan-hui-wen-zhang',
8
+ source: ['/'],
9
+ target: '/consumer/:category?/:language?/:keyword?',
10
+ },
11
+ ],
12
+ },
13
+ };
@@ -0,0 +1,3 @@
1
+ module.exports = function (router) {
2
+ router.get('/:category?/:language?/:keyword?', require('./index'));
3
+ };
@@ -1,4 +1,5 @@
1
1
  const got = require('@/utils/got');
2
+ const { hash } = require('./utils');
2
3
 
3
4
  module.exports = async (ctx) => {
4
5
  const { owner, image, tag = 'latest' } = ctx.params;
@@ -22,7 +23,8 @@ module.exports = async (ctx) => {
22
23
  link: `https://hub.docker.com/layers/docker/${namespace}/${tag}/images/${item.images[0].digest.replace(':', '-')}`,
23
24
  author: owner,
24
25
  pubDate: new Date(item.last_updated).toUTCString(),
25
- guid: item.last_updated,
26
+ // only check for different images hashes (considering varients of all arches), since the tag name is already fixed
27
+ guid: hash(item.images),
26
28
  },
27
29
  ],
28
30
  };
@@ -0,0 +1,4 @@
1
+ module.exports = {
2
+ '/build/:owner/:image/:tag?': ['HenryQW'],
3
+ '/tag/:owner/:image': ['outloudvi'],
4
+ };
@@ -0,0 +1,19 @@
1
+ module.exports = {
2
+ 'docker.com': {
3
+ _name: 'Docker Hub',
4
+ hub: [
5
+ {
6
+ title: '镜像有新 Build',
7
+ docs: 'https://docs.rsshub.app/program-update.html#docker-hub',
8
+ source: ['/r/:owner/:image', '/r/:owner/:image/tags', '/_/:image'],
9
+ target: (params) => `/dockerhub/build/${params.owner ? params.owner : 'library'}/${params.image}`,
10
+ },
11
+ {
12
+ title: '镜像有新 Tag',
13
+ docs: 'https://docs.rsshub.app/program-update.html#docker-hub',
14
+ source: ['/r/:owner/:image', '/r/:owner/:image/tags', '/_/:image'],
15
+ target: (params) => `/dockerhub/tag/${params.owner ? params.owner : 'library'}/${params.image}`,
16
+ },
17
+ ],
18
+ },
19
+ };
@@ -0,0 +1,4 @@
1
+ module.exports = function (router) {
2
+ router.get('/build/:owner/:image/:tag?', require('./build'));
3
+ router.get('/tag/:owner/:image/:limits?', require('./tag'));
4
+ };
@@ -0,0 +1,33 @@
1
+ const got = require('@/utils/got');
2
+ const { parseDate } = require('@/utils/parse-date');
3
+ const { hash } = require('./utils');
4
+
5
+ module.exports = async (ctx) => {
6
+ const { owner, image, limits } = ctx.params;
7
+
8
+ const namespace = `${owner}/${image}`;
9
+ const link = `https://hub.docker.com/r/${namespace}`;
10
+
11
+ const pageSize = !isNaN(parseInt(limits)) ? parseInt(limits) : 10;
12
+
13
+ const data = await got.get(`https://hub.docker.com/v2/repositories/${namespace}/tags/?page_size=${pageSize}`);
14
+ const metadata = await got.get(`https://hub.docker.com/v2/repositories/${namespace}/`);
15
+
16
+ const tags = data.data.results;
17
+
18
+ ctx.state.data = {
19
+ title: `${namespace} tags`,
20
+ description: metadata.data.description,
21
+ link,
22
+ language: 'en',
23
+ item: tags.map((item) => ({
24
+ title: `${namespace}:${item.name} was updated`,
25
+ description: `${namespace}:${item.name} was updated, supporting the architectures of ${item.images.map((img) => `${img.os}/${img.architecture}`).join(', ')}`,
26
+ link: `https://hub.docker.com/layers/${owner === 'library' ? `${image}/` : ''}${namespace}/${item.name}/images/${item.images[0].digest.replace(':', '-')}`,
27
+ author: owner,
28
+ pubDate: parseDate(item.tag_last_pushed),
29
+ // check for (1) different tag names and (2) different image hashes, considering varients of all arches
30
+ guid: `${namespace}:${item.name}@${hash(item.images)}`,
31
+ })),
32
+ };
33
+ };
@@ -0,0 +1,10 @@
1
+ const md5 = require('@/utils/md5');
2
+
3
+ function hash(images) {
4
+ const entries = Object.entries(images)
5
+ .map((x) => [`${x.os}/${x.architecture}`, x.digest])
6
+ .sort((a, b) => a[0] - b[0]);
7
+ return md5(entries.map((x) => x.join(',')).join('|'));
8
+ }
9
+
10
+ module.exports = { hash };
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,27 @@
1
+ module.exports = {
2
+ '/book/latest': ['fengkx'],
3
+ '/book/rank/:type?': ['xyqfer', 'queensferryme'],
4
+ '/bookstore': ['xyqfer'],
5
+ '/celebrity/:id/:sort?': ['minimalistrojan'],
6
+ '/channel/:id/:nav?': ['umm233'],
7
+ '/channel/:id/subject/:nav': ['umm233'],
8
+ '/commercialpress/latest': ['xyqfer'],
9
+ '/doulist/:id': ['LogicJake'],
10
+ '/event/hot/:locationId': ['xyqfer'],
11
+ '/explore': ['clarkzsd'],
12
+ '/explore_column/:id': ['LogicJake'],
13
+ '/group/:groupid/:type?': ['DIYgod'],
14
+ '/jobs/:type': ['Fatpandac'],
15
+ '/movie/classification/:sort?/:score?/:tags?': ['zzwab'],
16
+ '/movie/later': ['DIYgod'],
17
+ '/movie/playing': ['DIYgod'],
18
+ '/movie/playing/:score': ['DIYgod'],
19
+ '/movie/ustop': ['DIYgod'],
20
+ '/movie/weekly/:type?': ['numm233', 'nczitzk'],
21
+ '/music/latest/:area?': ['fengkx', 'xyqfer'],
22
+ '/people/:userid/status/:routeParams': ['alfredcai'],
23
+ '/people/:userid/wish/:routeParams?': ['exherb'],
24
+ '/replied/:uid': ['nczitzk'],
25
+ '/replies/:uid': ['nczitzk'],
26
+ '/topic/:id/:sort?': ['LogicJake'],
27
+ };
@@ -0,0 +1,50 @@
1
+ const got = require('@/utils/got');
2
+ const cheerio = require('cheerio');
3
+ const { art } = require('@/utils/render');
4
+ const path = require('path');
5
+
6
+ module.exports = async (ctx) => {
7
+ const response = await got({
8
+ method: 'get',
9
+ url: 'https://www.douban.com/explore',
10
+ });
11
+
12
+ const data = response.data;
13
+
14
+ const $ = cheerio.load(data);
15
+ const list = $('div.item');
16
+
17
+ ctx.state.data = {
18
+ title: '豆瓣-浏览发现',
19
+ link: 'https://www.douban.com/explore',
20
+ item:
21
+ list &&
22
+ list
23
+ .map((_, item) => {
24
+ item = $(item);
25
+
26
+ const title = item.find('.title a').first().text() ? item.find('.title a').first().text() : '#' + item.find('.icon-topic').text();
27
+ const desc = item.find('.content p').text();
28
+ const itemPic = item.find('a.cover').attr('style')
29
+ ? item
30
+ .find('a.cover')
31
+ .attr('style')
32
+ .match(/\('(.*?)'\)/)[1]
33
+ : '';
34
+ const author = item.find('.usr-pic a').last().text();
35
+ const link = item.find('.title a').attr('href') ?? item.find('.icon-topic a').attr('href');
36
+
37
+ return {
38
+ title,
39
+ author,
40
+ description: art(path.join(__dirname, '../templates/explore.art'), {
41
+ author,
42
+ desc,
43
+ itemPic,
44
+ }),
45
+ link,
46
+ };
47
+ })
48
+ .get(),
49
+ };
50
+ };
@@ -1,4 +1,4 @@
1
- const got = require('../../utils/got');
1
+ const got = require('@/utils/got');
2
2
  const cheerio = require('cheerio');
3
3
 
4
4
  module.exports = async (ctx) => {
@@ -0,0 +1,33 @@
1
+ const got = require('@/utils/got');
2
+ const cheerio = require('cheerio');
3
+
4
+ const rootUrl = 'https://jobs.douban.com';
5
+
6
+ const titleMap = {
7
+ social: '社会招聘',
8
+ campus: '校园招聘',
9
+ intern: '实习生招聘',
10
+ };
11
+
12
+ module.exports = async (ctx) => {
13
+ const type = ctx.params.type;
14
+ const url = `${rootUrl}/jobs/${type}`;
15
+
16
+ const response = await got.get(url);
17
+ const $ = cheerio.load(response.data);
18
+ const list = $('div.mod.position');
19
+
20
+ const items = list
21
+ .map((_, item) => ({
22
+ title: $(item).find('h3').text(),
23
+ link: `${url}#${$(item).find('h3').attr('id')}`,
24
+ description: $(item).find('div.bd').html(),
25
+ }))
26
+ .get();
27
+
28
+ ctx.state.data = {
29
+ title: `豆瓣${titleMap[type]}`,
30
+ link: url,
31
+ item: items,
32
+ };
33
+ };
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,54 @@
1
+ module.exports = {
2
+ 'douban.com': {
3
+ _name: '豆瓣',
4
+ www: [
5
+ {
6
+ title: '用户的广播',
7
+ docs: 'https://docs.rsshub.app/social-media.html#dou-ban',
8
+ source: '/people/:user/',
9
+ target: (params, url, document) => {
10
+ const uid = document && document.querySelector('html').innerHTML.match(/"id":"([0-9]+)"/)[1];
11
+ return uid ? `/douban/people/${uid}/status` : '';
12
+ },
13
+ },
14
+ {
15
+ title: '小组-最新',
16
+ docs: 'https://docs.rsshub.app/social-media.html#dou-ban',
17
+ source: '/group/:groupid',
18
+ target: '/douban/group/:groupid',
19
+ },
20
+ {
21
+ title: '小组-最热',
22
+ docs: 'https://docs.rsshub.app/social-media.html#dou-ban',
23
+ source: '/group/:groupid',
24
+ target: '/douban/group/:groupid/essence',
25
+ },
26
+ {
27
+ title: '小组-精华',
28
+ docs: 'https://docs.rsshub.app/social-media.html#dou-ban',
29
+ source: '/group/:groupid',
30
+ target: '/douban/group/:groupid/elite',
31
+ },
32
+ ],
33
+ jobs: [
34
+ {
35
+ title: '社会招聘',
36
+ docs: 'https://docs.rsshub.app/social-media.html#dou-ban',
37
+ source: '/jobs/social',
38
+ target: '/jobs/social',
39
+ },
40
+ {
41
+ title: '校园招聘',
42
+ docs: 'https://docs.rsshub.app/social-media.html#dou-ban',
43
+ source: '/jobs/campus',
44
+ target: '/jobs/campus',
45
+ },
46
+ {
47
+ title: '实习生招聘',
48
+ docs: 'https://docs.rsshub.app/social-media.html#dou-ban',
49
+ source: '/jobs/intern',
50
+ target: '/jobs/intern',
51
+ },
52
+ ],
53
+ },
54
+ };
@@ -0,0 +1,27 @@
1
+ module.exports = function (router) {
2
+ router.get('/book/latest', require('./other/latest_book'));
3
+ router.get('/book/rank/:type?', require('./book/rank'));
4
+ router.get('/bookstore', require('./other/bookstore'));
5
+ router.get('/celebrity/:id/:sort?', require('./other/celebrity.js'));
6
+ router.get('/channel/:id/subject/:nav', require('./channel/subject.js'));
7
+ router.get('/channel/:id/:nav?', require('./channel/topic.js'));
8
+ router.get('/commercialpress/latest', require('./commercialpress/latest'));
9
+ router.get('/doulist/:id', require('./other/doulist'));
10
+ router.get('/event/hot/:locationId', require('./event/hot'));
11
+ router.get('/explore', require('./other/explore'));
12
+ router.get('/explore/column/:id', require('./other/explore_column'));
13
+ router.get('/group/:groupid/:type?', require('./other/group'));
14
+ router.get('/jobs/:type', require('./other/jobs.js'));
15
+ router.get('/movie/classification/:sort?/:score?/:tags?', require('./other/classification.js'));
16
+ router.get('/movie/later', require('./other/later'));
17
+ router.get('/movie/playing', require('./other/playing'));
18
+ router.get('/movie/playing/:score', require('./other/playing'));
19
+ router.get('/movie/ustop', require('./other/ustop'));
20
+ router.get('/movie/weekly/:type?', require('./other/weekly_best'));
21
+ router.get('/music/latest/:area?', require('./other/latest_music'));
22
+ router.get('/people/:userid/status/:routeParams?', require('./people/status.js'));
23
+ router.get('/people/:userid/wish/:routeParams?', require('./people/wish.js'));
24
+ router.get('/replied/:uid', require('./other/replied'));
25
+ router.get('/replies/:uid', require('./other/replies'));
26
+ router.get('/topic/:id/:sort?', require('./other/topic.js'));
27
+ };
@@ -0,0 +1,7 @@
1
+ 作者:{{author}}
2
+ <br>
3
+ 描述:{{desc}}
4
+ <br>
5
+ {{ if itemPic }}
6
+ <img src={{ itemPic }}>
7
+ {{ /if }}
@@ -1,3 +1,3 @@
1
1
  module.exports = function (router) {
2
- router.get('/epicgames/:collection', require('./index'));
2
+ router.get('/:collection', require('./index'));
3
3
  };
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,3 +1,15 @@
1
1
  module.exports = {
2
+ '/branches/:user/:repo': ['max-arnold'],
2
3
  '/comments/:user/:repo/:type/:number': ['TonyRL'],
4
+ '/contributors/:user/:repo/:order?/:anon?': ['zoenglinghou'],
5
+ '/file/:user/:repo/:branch/:filepath+': ['zengxs'],
6
+ '/issue/:user/:repo/:state?/:labels?': ['HenryQW', 'AndreyMZ'],
7
+ '/pull/:user/:repo': ['hashman'],
8
+ '/repos/:user': ['DIYgod'],
9
+ '/search/:query/:sort?/:order?': ['LogicJake'],
10
+ '/starred_repos/:user': ['LanceZhu'],
11
+ '/stars/:user/:repo': ['HenryQW'],
12
+ '/topics/:name/:qs?': ['queensferryme'],
13
+ '/trending/:since/:language?/:spoken_language?': ['DIYgod'],
14
+ '/user/followers/:user': ['HenryQW'],
3
15
  };
File without changes
@@ -8,6 +8,72 @@ module.exports = {
8
8
  source: ['/:user/:repo/:type/:number'],
9
9
  target: '/github/comments/:user/:repo/:type/:number',
10
10
  },
11
+ {
12
+ title: '用户仓库',
13
+ docs: 'https://docs.rsshub.app/programming.html#github',
14
+ source: '/:user',
15
+ target: '/github/repos/:user',
16
+ },
17
+ {
18
+ title: '用户 Followers',
19
+ docs: 'https://docs.rsshub.app/programming.html#github',
20
+ source: '/:user',
21
+ target: '/github/user/followers/:user',
22
+ },
23
+ {
24
+ title: 'Trending',
25
+ docs: 'https://docs.rsshub.app/programming.html#github',
26
+ source: '/trending',
27
+ target: '/github/trending/:since',
28
+ },
29
+ {
30
+ title: 'Trending',
31
+ docs: 'https://docs.rsshub.app/programming.html#github',
32
+ source: '/topics',
33
+ target: '/github/topics/:name/:qs?',
34
+ },
35
+ {
36
+ title: '仓库 Issue',
37
+ docs: 'https://docs.rsshub.app/programming.html#github',
38
+ source: ['/:user/:repo/issues', '/:user/:repo/issues/:id', '/:user/:repo'],
39
+ target: '/github/issue/:user/:repo',
40
+ },
41
+ {
42
+ title: '仓库 Pull Requests',
43
+ docs: 'https://docs.rsshub.app/programming.html#github',
44
+ source: ['/:user/:repo/pulls', '/:user/:repo/pulls/:id', '/:user/:repo'],
45
+ target: '/github/pull/:user/:repo',
46
+ },
47
+ {
48
+ title: '仓库 Stars',
49
+ docs: 'https://docs.rsshub.app/programming.html#github',
50
+ source: ['/:user/:repo/stargazers', '/:user/:repo'],
51
+ target: '/github/stars/:user/:repo',
52
+ },
53
+ {
54
+ title: '仓库 Branches',
55
+ docs: 'https://docs.rsshub.app/programming.html#github',
56
+ source: ['/:user/:repo/branches', '/:user/:repo'],
57
+ target: '/github/branches/:user/:repo',
58
+ },
59
+ {
60
+ title: '文件 Commits',
61
+ docs: 'https://docs.rsshub.app/programming.html#github',
62
+ source: '/:user/:repo/blob/:branch/*filepath',
63
+ target: '/github/file/:user/:repo/:branch/:filepath',
64
+ },
65
+ {
66
+ title: '用户 Starred Repositories',
67
+ docs: 'https://docs.rsshub.app/programming.html#github',
68
+ source: '/:user',
69
+ target: '/github/starred_repos/:user',
70
+ },
71
+ {
72
+ title: '仓库 Contributors',
73
+ docs: 'https://docs.rsshub.app/programming.html#github',
74
+ source: ['/:user/:repo/graphs/contributors', '/:user/:repo'],
75
+ target: '/github/contributors/:user/:repo',
76
+ },
11
77
  ],
12
78
  },
13
79
  };
File without changes
@@ -1,3 +1,15 @@
1
1
  module.exports = function (router) {
2
+ router.get('/branches/:user/:repo', require('./branches'));
2
3
  router.get('/comments/:user/:repo/:type/:number', require('./comments'));
4
+ router.get('/contributors/:user/:repo/:order?/:anon?', require('./contributors'));
5
+ router.get('/file/:user/:repo/:branch/:filepath+', require('./file'));
6
+ router.get('/issue/:user/:repo/:state?/:labels?', require('./issue'));
7
+ router.get('/pull/:user/:repo', require('./pulls'));
8
+ router.get('/repos/:user', require('./repos'));
9
+ router.get('/search/:query/:sort?/:order?', require('./search'));
10
+ router.get('/starred_repos/:user', require('./starred_repos'));
11
+ router.get('/stars/:user/:repo', require('./star'));
12
+ router.get('/topics/:name/:qs?', require('./topic'));
13
+ router.get('/trending/:since/:language/:spoken_language?', require('./trending'));
14
+ router.get('/user/followers/:user', require('./follower'));
3
15
  };
File without changes
File without changes
File without changes
File without changes
@@ -3,8 +3,8 @@ const cheerio = require('cheerio');
3
3
 
4
4
  module.exports = async (ctx) => {
5
5
  const since = ctx.params.since;
6
- const language = ctx.params.language || '';
7
- const spoken_language = ctx.params.spoken_language || '';
6
+ const language = ctx.params.language === 'any' ? '' : ctx.params.language;
7
+ const spoken_language = ctx.params.spoken_language ?? '';
8
8
  const url = `https://github.com/trending/${encodeURIComponent(language)}?since=${since}&spoken_language_code=${spoken_language}`;
9
9
 
10
10
  const response = await got({
@@ -32,7 +32,7 @@ module.exports = async (ctx) => {
32
32
  title: item.find('h1').text(),
33
33
  author: item.find('h1').text().split('/')[0].trim(),
34
34
  description: `${item.find('.pr-4').text()}<br>
35
- <br>Language: ${item.find('span[itemprop="programmingLanguage"]').text() || 'unknown'}
35
+ <br>Language: ${item.find('span[itemprop="programmingLanguage"]').text() ?? 'unknown'}
36
36
  <br>Star: ${item.find('.Link--muted').eq(0).text().trim()}
37
37
  <br>Fork: ${item.find('.Link--muted').eq(1).text().trim()}`,
38
38
  link: `https://github.com${item.find('h1 a').attr('href')}`,
File without changes
File without changes
File without changes