rsshub 1.0.0-master.c9d8450 → 1.0.0-master.c9e754b

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 (117) hide show
  1. package/lib/config.js +8 -0
  2. package/lib/middleware/parameter.js +3 -1
  3. package/lib/radar-rules.js +0 -144
  4. package/lib/router.js +1 -58
  5. package/lib/routes/ehentai/ehapi.js +0 -1
  6. package/lib/routes/rsshub/routes.js +7 -6
  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/app-center/maintainer.js +3 -0
  14. package/lib/v2/app-center/radar.js +13 -0
  15. package/lib/v2/app-center/release.js +121 -0
  16. package/lib/v2/app-center/router.js +3 -0
  17. package/lib/v2/app-center/templates/description.art +24 -0
  18. package/lib/v2/baozimh/index.js +8 -2
  19. package/lib/v2/baozimh/templates/desc.art +3 -0
  20. package/lib/{routes → v2}/dockerhub/build.js +3 -1
  21. package/lib/v2/dockerhub/maintainer.js +4 -0
  22. package/lib/v2/dockerhub/radar.js +19 -0
  23. package/lib/v2/dockerhub/router.js +4 -0
  24. package/lib/v2/dockerhub/tag.js +33 -0
  25. package/lib/v2/dockerhub/utils.js +10 -0
  26. package/lib/{routes → v2}/douban/book/rank.js +0 -0
  27. package/lib/{routes → v2}/douban/channel/subject.js +0 -0
  28. package/lib/{routes → v2}/douban/channel/topic.js +0 -0
  29. package/lib/{routes → v2}/douban/commercialpress/latest.js +0 -0
  30. package/lib/{routes → v2}/douban/event/hot.js +0 -0
  31. package/lib/v2/douban/maintainer.js +27 -0
  32. package/lib/{routes/douban → v2/douban/other}/bookstore.js +0 -0
  33. package/lib/{routes/douban → v2/douban/other}/celebrity.js +0 -0
  34. package/lib/{routes/douban → v2/douban/other}/classification.js +0 -0
  35. package/lib/{routes/douban → v2/douban/other}/doulist.js +0 -0
  36. package/lib/v2/douban/other/explore.js +50 -0
  37. package/lib/{routes/douban → v2/douban/other}/explore_column.js +0 -0
  38. package/lib/{routes/douban → v2/douban/other}/group.js +1 -1
  39. package/lib/v2/douban/other/jobs.js +33 -0
  40. package/lib/{routes/douban → v2/douban/other}/later.js +0 -0
  41. package/lib/{routes/douban → v2/douban/other}/latest_book.js +0 -0
  42. package/lib/{routes/douban → v2/douban/other}/latest_music.js +0 -0
  43. package/lib/{routes/douban → v2/douban/other}/playing.js +0 -0
  44. package/lib/{routes/douban → v2/douban/other}/replied.js +0 -0
  45. package/lib/{routes/douban → v2/douban/other}/replies.js +0 -0
  46. package/lib/{routes/douban → v2/douban/other}/topic.js +0 -0
  47. package/lib/{routes/douban → v2/douban/other}/ustop.js +0 -0
  48. package/lib/{routes/douban → v2/douban/other}/weekly_best.js +0 -0
  49. package/lib/{routes → v2}/douban/people/status.js +0 -0
  50. package/lib/{routes → v2}/douban/people/wish.js +0 -0
  51. package/lib/v2/douban/radar.js +54 -0
  52. package/lib/v2/douban/router.js +27 -0
  53. package/lib/v2/douban/templates/explore.art +7 -0
  54. package/lib/v2/epicgames/router.js +1 -1
  55. package/lib/v2/epicgames/supportedList.js +1 -1
  56. package/lib/{routes → v2}/github/branches.js +0 -0
  57. package/lib/{routes → v2}/github/contributors.js +0 -0
  58. package/lib/{routes → v2}/github/file.js +0 -0
  59. package/lib/{routes → v2}/github/follower.js +0 -0
  60. package/lib/{routes → v2}/github/issue.js +0 -0
  61. package/lib/v2/github/maintainer.js +12 -0
  62. package/lib/{routes → v2}/github/pulls.js +0 -0
  63. package/lib/v2/github/radar.js +66 -0
  64. package/lib/{routes → v2}/github/repos.js +0 -0
  65. package/lib/v2/github/router.js +12 -0
  66. package/lib/{routes → v2}/github/search.js +0 -0
  67. package/lib/{routes → v2}/github/star.js +0 -0
  68. package/lib/{routes → v2}/github/starred_repos.js +0 -0
  69. package/lib/{routes → v2}/github/topic.js +0 -0
  70. package/lib/{routes → v2}/github/trending.js +3 -3
  71. package/lib/{routes → v2}/google/album.js +0 -0
  72. package/lib/{routes → v2}/google/citations.js +0 -0
  73. package/lib/{routes → v2}/google/doodles.js +0 -0
  74. package/lib/v2/google/fonts.js +43 -0
  75. package/lib/v2/google/maintainer.js +8 -0
  76. package/lib/{routes → v2}/google/news.js +0 -0
  77. package/lib/v2/google/radar.js +64 -0
  78. package/lib/v2/google/router.js +8 -0
  79. package/lib/{routes → v2}/google/scholar.js +0 -0
  80. package/lib/{routes → v2}/google/sites.js +0 -0
  81. package/lib/v2/google/templates/fonts.art +15 -0
  82. package/lib/v2/hackernews/index.js +9 -3
  83. package/lib/v2/hackernews/maintainer.js +1 -1
  84. package/lib/v2/hackernews/radar.js +1 -1
  85. package/lib/v2/hackernews/router.js +1 -1
  86. package/lib/v2/leiphone/index.js +1 -1
  87. package/lib/v2/leiphone/radar.js +1 -1
  88. package/lib/v2/leiphone/router.js +1 -1
  89. package/lib/v2/nikkei-asia/index.js +40 -0
  90. package/lib/v2/nikkei-asia/maintainer.js +3 -0
  91. package/lib/v2/nikkei-asia/radar.js +13 -0
  92. package/lib/v2/nikkei-asia/router.js +3 -0
  93. package/lib/v2/producthunt/maintainer.js +3 -0
  94. package/lib/v2/producthunt/radar.js +13 -0
  95. package/lib/v2/producthunt/router.js +3 -0
  96. package/lib/v2/producthunt/templates/descImg.art +5 -0
  97. package/lib/v2/producthunt/today.js +41 -0
  98. package/lib/v2/spotify/artist.js +41 -0
  99. package/lib/v2/spotify/maintainer.js +7 -0
  100. package/lib/v2/spotify/playlist.js +31 -0
  101. package/lib/v2/spotify/radar.js +37 -0
  102. package/lib/v2/spotify/router.js +7 -0
  103. package/lib/v2/spotify/saved.js +30 -0
  104. package/lib/v2/spotify/top.js +24 -0
  105. package/lib/v2/spotify/utils.js +62 -0
  106. package/lib/v2/taobao/maintainer.js +3 -0
  107. package/lib/v2/taobao/radar.js +117 -0
  108. package/lib/v2/taobao/router.js +3 -0
  109. package/lib/v2/taobao/templates/zhongchou.art +4 -0
  110. package/lib/{routes → v2}/taobao/zhongchou.js +6 -7
  111. package/lib/v2/ustb/maintainer.js +24 -0
  112. package/lib/v2/ustb/radar.js +13 -0
  113. package/lib/v2/ustb/router.js +3 -0
  114. package/lib/v2/ustb/yjsy/news.js +464 -0
  115. package/package.json +1 -1
  116. package/lib/routes/douban/explore.js +0 -33
  117. package/lib/routes/producthunt/today.js +0 -24
package/lib/config.js CHANGED
@@ -63,6 +63,11 @@ const calculateValue = () => {
63
63
  disqus: {
64
64
  api_key: envs.DISQUS_API_KEY,
65
65
  },
66
+ spotify: {
67
+ clientId: envs.SPOTIFY_CLIENT_ID,
68
+ clientSecret: envs.SPOTIFY_CLIENT_SECRET,
69
+ refreshToken: envs.SPOTIFY_REFRESHTOKEN,
70
+ },
66
71
  twitter: {
67
72
  consumer_key: envs.TWITTER_CONSUMER_KEY,
68
73
  consumer_secret: envs.TWITTER_CONSUMER_SECRET,
@@ -211,6 +216,9 @@ const calculateValue = () => {
211
216
  wenku8: {
212
217
  cookie: envs.WENKU8_COOKIE,
213
218
  },
219
+ google: {
220
+ fontsApiKey: envs.GOOGLE_FONTS_API_KEY,
221
+ },
214
222
  };
215
223
  };
216
224
  calculateValue();
@@ -208,7 +208,9 @@ module.exports = async (ctx, next) => {
208
208
  mercury_parser = mercury_parser || require('@postlight/mercury-parser');
209
209
 
210
210
  const res = await got(link);
211
- const $ = cheerio.load(res.data);
211
+ const $ = cheerio.load(res.data, {
212
+ xmlMode: true,
213
+ });
212
214
  const result = await mercury_parser.parse(link, {
213
215
  html: $.html(),
214
216
  });
@@ -243,77 +243,6 @@ module.exports = {
243
243
  },
244
244
  ],
245
245
  },
246
- 'github.com': {
247
- _name: 'GitHub',
248
- '.': [
249
- {
250
- title: '用户仓库',
251
- docs: 'https://docs.rsshub.app/programming.html#github',
252
- source: '/:user',
253
- target: '/github/repos/:user',
254
- },
255
- {
256
- title: '用户 Followers',
257
- docs: 'https://docs.rsshub.app/programming.html#github',
258
- source: '/:user',
259
- target: '/github/user/followers/:user',
260
- },
261
- {
262
- title: 'Trending',
263
- docs: 'https://docs.rsshub.app/programming.html#github',
264
- source: '/trending',
265
- target: '/github/trending/:since',
266
- },
267
- {
268
- title: 'Trending',
269
- docs: 'https://docs.rsshub.app/programming.html#github',
270
- source: '/topics',
271
- target: '/github/topics/:name/:qs?',
272
- },
273
- {
274
- title: '仓库 Issue',
275
- docs: 'https://docs.rsshub.app/programming.html#github',
276
- source: ['/:user/:repo/issues', '/:user/:repo/issues/:id', '/:user/:repo'],
277
- target: '/github/issue/:user/:repo',
278
- },
279
- {
280
- title: '仓库 Pull Requests',
281
- docs: 'https://docs.rsshub.app/programming.html#github',
282
- source: ['/:user/:repo/pulls', '/:user/:repo/pulls/:id', '/:user/:repo'],
283
- target: '/github/pull/:user/:repo',
284
- },
285
- {
286
- title: '仓库 Stars',
287
- docs: 'https://docs.rsshub.app/programming.html#github',
288
- source: ['/:user/:repo/stargazers', '/:user/:repo'],
289
- target: '/github/stars/:user/:repo',
290
- },
291
- {
292
- title: '仓库 Branches',
293
- docs: 'https://docs.rsshub.app/programming.html#github',
294
- source: ['/:user/:repo/branches', '/:user/:repo'],
295
- target: '/github/branches/:user/:repo',
296
- },
297
- {
298
- title: '文件 Commits',
299
- docs: 'https://docs.rsshub.app/programming.html#github',
300
- source: '/:user/:repo/blob/:branch/*filepath',
301
- target: '/github/file/:user/:repo/:branch/:filepath',
302
- },
303
- {
304
- title: '用户 Starred Repositories',
305
- docs: 'https://docs.rsshub.app/programming.html#github',
306
- source: '/:user',
307
- target: '/github/starred_repos/:user',
308
- },
309
- {
310
- title: '仓库 Contributors',
311
- docs: 'https://docs.rsshub.app/programming.html#github',
312
- source: ['/:user/:repo/graphs/contributors', '/:user/:repo'],
313
- target: '/github/contributors/:user/:repo',
314
- },
315
- ],
316
- },
317
246
  'zhihu.com': {
318
247
  _name: '知乎',
319
248
  www: [
@@ -786,17 +715,6 @@ module.exports = {
786
715
  },
787
716
  ],
788
717
  },
789
- 'docker.com': {
790
- _name: 'Docker',
791
- hub: [
792
- {
793
- title: '镜像有新 Build',
794
- docs: 'https://docs.rsshub.app/program-update.html#docker-hub',
795
- source: ['/r/:owner/:image', '/r/:owner/:image/tags', '/_/:image'],
796
- target: (params) => `/dockerhub/build/${params.owner ? params.owner : 'library'}/${params.image}`,
797
- },
798
- ],
799
- },
800
718
  'nga.cn': {
801
719
  _name: 'NGA',
802
720
  bbs: [
@@ -1386,36 +1304,6 @@ module.exports = {
1386
1304
  },
1387
1305
  ],
1388
1306
  },
1389
- 'google.com': {
1390
- _name: '谷歌',
1391
- chrome: [
1392
- {
1393
- title: '插件更新',
1394
- source: '/webstore/detail/:name/:id',
1395
- docs: 'https://docs.rsshub.app/program-update.html#chrome-wang-shang-ying-yong-dian',
1396
- target: '/chrome/webstore/extensions/:id',
1397
- },
1398
- ],
1399
- photos: [
1400
- {
1401
- title: '相册',
1402
- docs: 'https://docs.rsshub.app/picture.html#google-xiang-ce',
1403
- source: '/share/*',
1404
- target: (params, url, document) => {
1405
- const id = document && document.querySelector('html').innerHTML.match(/photos.app.goo.gl\/(.*?)"/)[1];
1406
- return id ? `/google/album/${id}` : '';
1407
- },
1408
- },
1409
- ],
1410
- sites: [
1411
- {
1412
- title: 'Sites',
1413
- docs: 'https://docs.rsshub.app/blog.html#google-sites',
1414
- source: ['/site/:id/*', '/site/:id'],
1415
- target: '/google/sites/:id',
1416
- },
1417
- ],
1418
- },
1419
1307
  'javlibrary.com': {
1420
1308
  _name: 'javlibrary',
1421
1309
  www: [
@@ -2416,38 +2304,6 @@ module.exports = {
2416
2304
  },
2417
2305
  ],
2418
2306
  },
2419
- 'douban.com': {
2420
- _name: '豆瓣',
2421
- www: [
2422
- {
2423
- title: '用户的广播',
2424
- docs: 'https://docs.rsshub.app/social-media.html#dou-ban',
2425
- source: '/people/:user/',
2426
- target: (params, url, document) => {
2427
- const uid = document && document.querySelector('html').innerHTML.match(/"id":"([0-9]+)"/)[1];
2428
- return uid ? `/douban/people/${uid}/status` : '';
2429
- },
2430
- },
2431
- {
2432
- title: '小组-最新',
2433
- docs: 'https://docs.rsshub.app/social-media.html#dou-ban',
2434
- source: '/group/:groupid',
2435
- target: '/douban/group/:groupid',
2436
- },
2437
- {
2438
- title: '小组-最热',
2439
- docs: 'https://docs.rsshub.app/social-media.html#dou-ban',
2440
- source: '/group/:groupid',
2441
- target: '/douban/group/:groupid/essence',
2442
- },
2443
- {
2444
- title: '小组-精华',
2445
- docs: 'https://docs.rsshub.app/social-media.html#dou-ban',
2446
- source: '/group/:groupid',
2447
- target: '/douban/group/:groupid/elite',
2448
- },
2449
- ],
2450
- },
2451
2307
  'okjike.com': {
2452
2308
  _name: '即刻',
2453
2309
  m: [
package/lib/router.js CHANGED
@@ -128,7 +128,7 @@ router.get('/jianshu/collection/:id', lazyloadRouteHandler('./routes/jianshu/col
128
128
  router.get('/jianshu/user/:id', lazyloadRouteHandler('./routes/jianshu/user'));
129
129
 
130
130
  // 知乎
131
- router.get('/zhihu/collection/:id', lazyloadRouteHandler('./routes/zhihu/collection'));
131
+ router.get('/zhihu/collection/:id/:getAll?', lazyloadRouteHandler('./routes/zhihu/collection'));
132
132
  router.get('/zhihu/people/activities/:id', lazyloadRouteHandler('./routes/zhihu/activities'));
133
133
  router.get('/zhihu/people/answers/:id', lazyloadRouteHandler('./routes/zhihu/answers'));
134
134
  router.get('/zhihu/posts/:usertype/:id', lazyloadRouteHandler('./routes/zhihu/posts'));
@@ -163,33 +163,6 @@ router.get('/pixiv/search/:keyword/:order?/:mode?', lazyloadRouteHandler('./rout
163
163
  // pixiv-fanbox
164
164
  router.get('/fanbox/:user?', lazyloadRouteHandler('./routes/fanbox/main'));
165
165
 
166
- // 豆瓣
167
- router.get('/douban/movie/playing', lazyloadRouteHandler('./routes/douban/playing'));
168
- router.get('/douban/movie/playing/:score', lazyloadRouteHandler('./routes/douban/playing'));
169
- router.get('/douban/movie/playing/:score/:city', lazyloadRouteHandler('./routes/douban/playing'));
170
- router.get('/douban/movie/later', lazyloadRouteHandler('./routes/douban/later'));
171
- router.get('/douban/movie/ustop', lazyloadRouteHandler('./routes/douban/ustop'));
172
- router.get('/douban/movie/weekly/:type?', lazyloadRouteHandler('./routes/douban/weekly_best'));
173
- router.get('/douban/movie/classification/:sort?/:score?/:tags?', lazyloadRouteHandler('./routes/douban/classification.js'));
174
- router.get('/douban/group/:groupid/:type?', lazyloadRouteHandler('./routes/douban/group'));
175
- router.get('/douban/explore', lazyloadRouteHandler('./routes/douban/explore'));
176
- router.get('/douban/music/latest/:area?', lazyloadRouteHandler('./routes/douban/latest_music'));
177
- router.get('/douban/book/latest', lazyloadRouteHandler('./routes/douban/latest_book'));
178
- router.get('/douban/event/hot/:locationId', lazyloadRouteHandler('./routes/douban/event/hot'));
179
- router.get('/douban/commercialpress/latest', lazyloadRouteHandler('./routes/douban/commercialpress/latest'));
180
- router.get('/douban/bookstore', lazyloadRouteHandler('./routes/douban/bookstore'));
181
- router.get('/douban/book/rank/:type?', lazyloadRouteHandler('./routes/douban/book/rank'));
182
- router.get('/douban/doulist/:id', lazyloadRouteHandler('./routes/douban/doulist'));
183
- router.get('/douban/explore/column/:id', lazyloadRouteHandler('./routes/douban/explore_column'));
184
- router.get('/douban/people/:userid/status/:routeParams?', lazyloadRouteHandler('./routes/douban/people/status.js'));
185
- router.get('/douban/people/:userid/wish/:routeParams?', lazyloadRouteHandler('./routes/douban/people/wish.js'));
186
- router.get('/douban/replies/:uid', lazyloadRouteHandler('./routes/douban/replies'));
187
- router.get('/douban/replied/:uid', lazyloadRouteHandler('./routes/douban/replied'));
188
- router.get('/douban/topic/:id/:sort?', lazyloadRouteHandler('./routes/douban/topic.js'));
189
- router.get('/douban/channel/:id/:nav?', lazyloadRouteHandler('./routes/douban/channel/topic.js'));
190
- router.get('/douban/channel/:id/subject/:nav', lazyloadRouteHandler('./routes/douban/channel/subject.js'));
191
- router.get('/douban/celebrity/:id/:sort?', lazyloadRouteHandler('./routes/douban/celebrity.js'));
192
-
193
166
  // 法律白話文運動
194
167
  router.get('/plainlaw/archives', lazyloadRouteHandler('./routes/plainlaw/archives.js'));
195
168
 
@@ -272,20 +245,6 @@ router.get('/v2ex/tab/:tabid', lazyloadRouteHandler('./routes/v2ex/tab'));
272
245
  // readhub
273
246
  router.get('/readhub/category/:category', lazyloadRouteHandler('./routes/readhub/category'));
274
247
 
275
- // GitHub
276
- router.get('/github/repos/:user', lazyloadRouteHandler('./routes/github/repos'));
277
- router.get('/github/trending/:since/:language?/:spoken_language?', lazyloadRouteHandler('./routes/github/trending'));
278
- router.get('/github/issue/:user/:repo/:state?/:labels?', lazyloadRouteHandler('./routes/github/issue'));
279
- router.get('/github/pull/:user/:repo', lazyloadRouteHandler('./routes/github/pulls'));
280
- router.get('/github/user/followers/:user', lazyloadRouteHandler('./routes/github/follower'));
281
- router.get('/github/stars/:user/:repo', lazyloadRouteHandler('./routes/github/star'));
282
- router.get('/github/search/:query/:sort?/:order?', lazyloadRouteHandler('./routes/github/search'));
283
- router.get('/github/branches/:user/:repo', lazyloadRouteHandler('./routes/github/branches'));
284
- router.get('/github/file/:user/:repo/:branch/:filepath+', lazyloadRouteHandler('./routes/github/file'));
285
- router.get('/github/starred_repos/:user', lazyloadRouteHandler('./routes/github/starred_repos'));
286
- router.get('/github/contributors/:user/:repo/:order?/:anon?', lazyloadRouteHandler('./routes/github/contributors'));
287
- router.get('/github/topics/:name/:qs?', lazyloadRouteHandler('./routes/github/topic'));
288
-
289
248
  // f-droid
290
249
  router.get('/fdroid/apprelease/:app', lazyloadRouteHandler('./routes/fdroid/apprelease'));
291
250
 
@@ -525,13 +484,6 @@ router.get('/fir/update/:id', lazyloadRouteHandler('./routes/fir/update'));
525
484
  // Nvidia Web Driver
526
485
  router.get('/nvidia/webdriverupdate', lazyloadRouteHandler('./routes/nvidia/webdriverupdate'));
527
486
 
528
- // Google
529
- router.get('/google/citations/:id', lazyloadRouteHandler('./routes/google/citations'));
530
- router.get('/google/scholar/:query', lazyloadRouteHandler('./routes/google/scholar'));
531
- router.get('/google/doodles/:language?', lazyloadRouteHandler('./routes/google/doodles'));
532
- router.get('/google/album/:id', lazyloadRouteHandler('./routes/google/album'));
533
- router.get('/google/sites/:id', lazyloadRouteHandler('./routes/google/sites'));
534
-
535
487
  // 每日环球展览 iMuseum
536
488
  router.get('/imuseum/:city/:type?', lazyloadRouteHandler('./routes/imuseum'));
537
489
 
@@ -1274,9 +1226,6 @@ router.get('/patchwork.kernel.org/comments/:id', lazyloadRouteHandler('./routes/
1274
1226
  // 京东众筹
1275
1227
  router.get('/jingdong/zhongchou/:type/:status/:sort', lazyloadRouteHandler('./routes/jingdong/zhongchou'));
1276
1228
 
1277
- // 淘宝众筹
1278
- router.get('/taobao/zhongchou/:type?', lazyloadRouteHandler('./routes/taobao/zhongchou'));
1279
-
1280
1229
  // All Poetry
1281
1230
  router.get('/allpoetry/:order?', lazyloadRouteHandler('./routes/allpoetry/order'));
1282
1231
 
@@ -1406,9 +1355,6 @@ router.get('/meipai/user/:uid', lazyloadRouteHandler('./routes/meipai/user'));
1406
1355
  // 多知网
1407
1356
  router.get('/duozhi', lazyloadRouteHandler('./routes/duozhi'));
1408
1357
 
1409
- // Docker Hub
1410
- router.get('/dockerhub/build/:owner/:image/:tag?', lazyloadRouteHandler('./routes/dockerhub/build'));
1411
-
1412
1358
  // 人人都是产品经理
1413
1359
  router.get('/woshipm/popular', lazyloadRouteHandler('./routes/woshipm/popular'));
1414
1360
  router.get('/woshipm/wen', lazyloadRouteHandler('./routes/woshipm/wen'));
@@ -2456,9 +2402,6 @@ router.get('/blogs/paulgraham', lazyloadRouteHandler('./routes/blogs/paulgraham'
2456
2402
  // invisionapp
2457
2403
  router.get('/invisionapp/inside-design', lazyloadRouteHandler('./routes/invisionapp/inside-design'));
2458
2404
 
2459
- // producthunt
2460
- router.get('/producthunt/today', lazyloadRouteHandler('./routes/producthunt/today'));
2461
-
2462
2405
  // mlog.club
2463
2406
  router.get('/mlog-club/topics/:node', lazyloadRouteHandler('./routes/mlog-club/topics'));
2464
2407
  router.get('/mlog-club/projects', lazyloadRouteHandler('./routes/mlog-club/projects'));
@@ -82,7 +82,6 @@ function getBittorrent(cache, bittorrent_page_url) {
82
82
  if (match_p) {
83
83
  p = match_p[1];
84
84
  }
85
- break;
86
85
  }
87
86
  }
88
87
  }
@@ -37,14 +37,15 @@ module.exports = async (ctx) => {
37
37
  const data = response.data;
38
38
 
39
39
  const $ = cheerio.load(data);
40
+ const page = $('.page').get();
40
41
  const item = $('.routeBlock').get();
41
- return Promise.resolve({ item, type });
42
+ return { page, item, type };
42
43
  })
43
44
  );
44
45
  const list = [];
45
- all.forEach(({ item, type }) => {
46
+ all.forEach(({ page, item, type }) => {
46
47
  item.forEach((item) => {
47
- list.push({ item, type });
48
+ list.push({ page, item, type });
48
49
  });
49
50
  });
50
51
 
@@ -52,9 +53,9 @@ module.exports = async (ctx) => {
52
53
  title: 'RSSHub 有新路由啦',
53
54
  link: 'https://docs.rsshub.app',
54
55
  description: '万物皆可 RSS',
55
- item: list.map(({ item, type }) => {
56
- item = cheerio(item);
57
- item.find('.header-anchor').remove();
56
+ item: list.map(({ page, item, type }) => {
57
+ const $ = cheerio.load(page);
58
+ item = $(item);
58
59
  const titleEle = item.prevAll('h2').eq(0);
59
60
  return {
60
61
  title: `${titleEle.text().slice(2)} - ${item.prevAll('h3').eq(0).text().slice(2)}`,
@@ -5,11 +5,11 @@ const cheerio = require('cheerio');
5
5
  const host = 'https://www.yxdzqb.com';
6
6
 
7
7
  const map = {
8
- new: 'index_r.html',
9
- hot: 'index1.html',
10
- hot_chinese: 'index_1c.html',
11
- low: 'index2.html',
12
- low_chinese: 'index_2c.html',
8
+ new: 'index_discount.html',
9
+ hot: 'index_popular.html',
10
+ hot_chinese: 'index_popular_cn.html',
11
+ low: 'index_low.html',
12
+ low_chinese: 'index_low_cn.html',
13
13
  };
14
14
 
15
15
  module.exports = async (ctx) => {
@@ -5,6 +5,7 @@ const { generateData } = require('./pin/utils');
5
5
 
6
6
  module.exports = async (ctx) => {
7
7
  const id = ctx.params.id;
8
+ const getAll = ctx.params.getAll;
8
9
 
9
10
  const response = await got({
10
11
  method: 'get',
@@ -17,6 +18,29 @@ module.exports = async (ctx) => {
17
18
 
18
19
  const list = response.data.data;
19
20
 
21
+ if (getAll) {
22
+ const totals = response.data.paging.totals;
23
+
24
+ const offsetList = [...new Array(Math.round(totals / 20)).keys()].map((item) => item * 20).slice(1);
25
+ const otherList = await Promise.all(
26
+ offsetList.map((offset) =>
27
+ ctx.cache.tryGet(`https://www.zhihu.com/api/v4/collections/${id}/items?offset=${offset}&limit=20`, async () => {
28
+ const response = await got({
29
+ method: 'get',
30
+ url: `https://www.zhihu.com/api/v4/collections/${id}/items?offset=${offset}&limit=20`,
31
+ headers: {
32
+ ...utils.header,
33
+ Referer: `https://www.zhihu.com/collection/${id}`,
34
+ },
35
+ });
36
+
37
+ return response.data.data;
38
+ })
39
+ )
40
+ ).then((item) => item.flat());
41
+ list.push(...otherList);
42
+ }
43
+
20
44
  const response2 = await got({
21
45
  method: 'get',
22
46
  url: `https://www.zhihu.com/collection/${id}`,
@@ -42,9 +66,9 @@ module.exports = async (ctx) => {
42
66
  item.content.type === 'pin'
43
67
  ? generateDataPin(item)
44
68
  : {
45
- title: item.content.type === 'article' ? item.content.title : item.content.question.title,
69
+ title: item.content.type === 'article' || item.content.type === 'zvideo' ? item.content.title : item.content.question.title,
46
70
  link: item.content.url,
47
- description: item.content.content,
71
+ description: item.content.type === 'zvideo' ? `<img src=${item.content.video.url}/>` : item.content.content,
48
72
  pubDate: new Date((item.content.type === 'article' ? item.content.updated : item.content.updated_time) * 1000).toUTCString(),
49
73
  }
50
74
  ),
@@ -17,13 +17,23 @@ module.exports = {
17
17
  break;
18
18
 
19
19
  case 'video':
20
- description += `<video
21
- controls="controls"
22
- width="${item.playlist.hd.width}"
23
- height="${item.playlist.hd.height}"
24
- poster="${item.cover_info.thumbnail}"
25
- src="${item.playlist.hd.play_url}"
26
- >`;
20
+ try {
21
+ description += `<video
22
+ controls="controls"
23
+ width="${item.playlist.hd.width}"
24
+ height="${item.playlist.hd.height}"
25
+ poster="${item.cover_info.thumbnail}"
26
+ src="${item.playlist.hd.play_url}"
27
+ >`;
28
+ } catch (e) {
29
+ description += `<video
30
+ controls="controls"
31
+ width="${item.playlist.pop().width}"
32
+ height="${item.playlist.pop().height}"
33
+ poster="${item.thumbnail}"
34
+ src="${item.playlist.pop().play_url}"
35
+ >`;
36
+ }
27
37
  break;
28
38
 
29
39
  case 'link':
@@ -1,6 +1,7 @@
1
1
  const got = require('@/utils/got');
2
2
  const utils = require('./utils');
3
3
  const cheerio = require('cheerio');
4
+ const { parseDate } = require('@/utils/parse-date');
4
5
 
5
6
  module.exports = async (ctx) => {
6
7
  const id = ctx.params.id;
@@ -38,7 +39,7 @@ module.exports = async (ctx) => {
38
39
  title: String(item.title),
39
40
  description: item.content,
40
41
  link: item.url,
41
- pubDate: new Date(item.updated).toUTCString(),
42
+ pubDate: parseDate(item.updated * 1000),
42
43
  })),
43
44
  };
44
45
  };
@@ -1,5 +1,6 @@
1
1
  const got = require('@/utils/got');
2
2
  const utils = require('./utils');
3
+ const { parseDate } = require('@/utils/parse-date');
3
4
 
4
5
  module.exports = async (ctx) => {
5
6
  const { topicId } = ctx.params;
@@ -32,7 +33,7 @@ module.exports = async (ctx) => {
32
33
  title = `${item.question.title}-${item.author.name}的回答:${item.excerpt}`;
33
34
  description = `<strong>${item.question.title}</strong><br>${item.author.name}的回答<br/>${utils.ProcessImage(item.content)}`;
34
35
  link = `https://www.zhihu.com/question/${item.question.id}/answer/${item.id}`;
35
- pubDate = new Date(item.updated_time * 1000).toUTCString();
36
+ pubDate = parseDate(item.updated_time * 1000);
36
37
  author = item.author.name;
37
38
  break;
38
39
 
@@ -40,7 +41,14 @@ module.exports = async (ctx) => {
40
41
  title = item.title;
41
42
  description = item.title;
42
43
  link = `https://www.zhihu.com/question/${item.id}`;
43
- pubDate = new Date(item.created * 1000).toUTCString();
44
+ pubDate = parseDate(item.created * 1000);
45
+ break;
46
+
47
+ case 'article':
48
+ title = item.title;
49
+ description = item.content;
50
+ link = item.url;
51
+ pubDate = parseDate(item.created * 1000);
44
52
  break;
45
53
 
46
54
  default:
@@ -14,6 +14,17 @@ module.exports = async (ctx) => {
14
14
  },
15
15
  });
16
16
 
17
+ const pinnedRes = await got({
18
+ method: 'get',
19
+ url: `https://www.zhihu.com/api/v4/columns/${id}/pinned-items`,
20
+ headers: {
21
+ ...utils.header,
22
+ Referer: `https://zhuanlan.zhihu.com/${id}`,
23
+ },
24
+ });
25
+
26
+ listRes.data.data = listRes.data.data.concat(pinnedRes.data.data);
27
+
17
28
  // 知乎专栏链接存在两种格式, 一种以 'zhuanlan.' 开头, 另一种新增的以 'c_' 结尾
18
29
  let url = `https://zhuanlan.zhihu.com/${id}`;
19
30
  if (id.search('c_') === 0) {
@@ -41,7 +52,7 @@ module.exports = async (ctx) => {
41
52
 
42
53
  if (item.type === 'answer') {
43
54
  title = item.question.title;
44
- author = item.question.author.name;
55
+ author = item.question.author ? item.question.author.name : '';
45
56
  link = `https://www.zhihu.com/question/${item.question.id}/answer/${item.id}`;
46
57
  pubDate = new Date(item.created_time * 1000);
47
58
  } else if (item.type === 'article') {
@@ -0,0 +1,3 @@
1
+ module.exports = {
2
+ '/release/:user/:app/:distribution_group': ['Rongronggg9'],
3
+ };
@@ -0,0 +1,13 @@
1
+ module.exports = {
2
+ 'appcenter.ms': {
3
+ _name: 'App Center',
4
+ install: [
5
+ {
6
+ title: 'App Center Release',
7
+ docs: 'https://docs.rsshub.app/program-update.html#app-center',
8
+ source: ['/users/:user/apps/:app/distribution_groups/:distribution_group', '/orgs/:user/apps/:app/distribution_groups/:distribution_group'],
9
+ target: '/app-center/release/:user/:app/:distribution_group',
10
+ },
11
+ ],
12
+ },
13
+ };