rsshub 1.0.0-master.d3ce31d → 1.0.0-master.d4c8fa0

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 (154) hide show
  1. package/lib/middleware/parameter.js +10 -4
  2. package/lib/radar-rules.js +20 -37
  3. package/lib/router.js +9 -9
  4. package/lib/v2/36kr/index.js +75 -0
  5. package/lib/v2/36kr/maintainer.js +7 -5
  6. package/lib/v2/36kr/radar.js +27 -15
  7. package/lib/v2/36kr/router.js +1 -5
  8. package/lib/v2/acs/journal.js +73 -0
  9. package/lib/v2/acs/maintainer.js +3 -0
  10. package/lib/v2/acs/radar.js +13 -0
  11. package/lib/v2/acs/router.js +3 -0
  12. package/lib/v2/acs/templates/description.art +2 -0
  13. package/lib/v2/airchina/index.js +36 -0
  14. package/lib/v2/airchina/maintainer.js +3 -0
  15. package/lib/v2/airchina/radar.js +13 -0
  16. package/lib/v2/airchina/router.js +3 -0
  17. package/lib/v2/allrecode/index.js +65 -0
  18. package/lib/v2/allrecode/maintainer.js +5 -0
  19. package/lib/v2/allrecode/news.js +35 -0
  20. package/lib/v2/allrecode/radar.js +25 -0
  21. package/lib/v2/allrecode/router.js +4 -0
  22. package/lib/v2/biquge/index.js +78 -0
  23. package/lib/v2/biquge/maintainer.js +3 -0
  24. package/lib/v2/biquge/radar.js +29 -0
  25. package/lib/v2/biquge/router.js +3 -0
  26. package/lib/v2/ccfcv/index.js +68 -0
  27. package/lib/v2/ccfcv/maintainer.js +3 -0
  28. package/lib/v2/ccfcv/radar.js +25 -0
  29. package/lib/v2/ccfcv/router.js +3 -0
  30. package/lib/v2/ccfcv/templates/description.art +1 -0
  31. package/lib/v2/cde/maintainer.js +1 -0
  32. package/lib/v2/cde/radar.js +12 -0
  33. package/lib/v2/cde/router.js +1 -0
  34. package/lib/v2/cde/zdyz.js +77 -0
  35. package/lib/v2/clash/maintainer.js +3 -0
  36. package/lib/v2/clash/premium.js +23 -0
  37. package/lib/v2/clash/radar.js +13 -0
  38. package/lib/v2/clash/router.js +3 -0
  39. package/lib/v2/gdut/maintainer.js +3 -0
  40. package/lib/{routes/universities → v2}/gdut/news.js +4 -0
  41. package/lib/v2/gdut/oa_news.js +214 -0
  42. package/lib/v2/gdut/radar.js +13 -0
  43. package/lib/v2/gdut/router.js +3 -0
  44. package/lib/v2/github/maintainer.js +1 -1
  45. package/lib/v2/github/templates/trending-description.art +5 -0
  46. package/lib/v2/github/trending.js +32 -16
  47. package/lib/v2/gov/maintainer.js +2 -0
  48. package/lib/v2/gov/moj/aac/news.js +49 -0
  49. package/lib/v2/gov/nifdc/index.js +86 -0
  50. package/lib/v2/gov/radar.js +22 -0
  51. package/lib/v2/gov/router.js +2 -0
  52. package/lib/v2/gov/shanghai/yjj/index.js +16 -10
  53. package/lib/v2/hakkatv/maintainer.js +3 -0
  54. package/lib/v2/hakkatv/radar.js +13 -0
  55. package/lib/v2/hakkatv/router.js +3 -0
  56. package/lib/v2/hakkatv/type.js +67 -0
  57. package/lib/v2/hk01/channel.js +13 -30
  58. package/lib/v2/hk01/hot.js +13 -14
  59. package/lib/v2/hk01/issue.js +12 -31
  60. package/lib/v2/hk01/maintainer.js +5 -5
  61. package/lib/v2/hk01/radar.js +19 -19
  62. package/lib/v2/hk01/router.js +4 -4
  63. package/lib/v2/hk01/tag.js +14 -15
  64. package/lib/v2/hk01/templates/description.art +53 -0
  65. package/lib/v2/hk01/utils.js +43 -0
  66. package/lib/v2/hk01/zone.js +15 -34
  67. package/lib/v2/houxu/events.js +37 -0
  68. package/lib/v2/houxu/index.js +21 -69
  69. package/lib/v2/houxu/lives.js +35 -0
  70. package/lib/v2/houxu/maintainer.js +4 -2
  71. package/lib/v2/houxu/memory.js +37 -0
  72. package/lib/v2/houxu/radar.js +18 -6
  73. package/lib/v2/houxu/router.js +6 -1
  74. package/lib/v2/houxu/templates/events.art +5 -0
  75. package/lib/v2/houxu/templates/lives.art +5 -0
  76. package/lib/v2/houxu/templates/memory.art +3 -0
  77. package/lib/v2/myfigurecollection/activity.js +58 -0
  78. package/lib/v2/myfigurecollection/index.js +78 -0
  79. package/lib/v2/myfigurecollection/maintainer.js +4 -0
  80. package/lib/v2/myfigurecollection/radar.js +44 -0
  81. package/lib/v2/myfigurecollection/router.js +4 -0
  82. package/lib/v2/myfigurecollection/templates/activity.art +8 -0
  83. package/lib/v2/myfigurecollection/templates/description.art +24 -0
  84. package/lib/v2/ncepu/maintainer.js +3 -0
  85. package/lib/v2/ncepu/master/masterinfo.js +78 -0
  86. package/lib/v2/ncepu/radar.js +25 -0
  87. package/lib/v2/ncepu/router.js +3 -0
  88. package/lib/{routes → v2}/nga/forum.js +8 -9
  89. package/lib/v2/nga/maintainer.js +4 -0
  90. package/lib/{routes → v2}/nga/post.js +16 -15
  91. package/lib/v2/nga/radar.js +56 -0
  92. package/lib/v2/nga/router.js +4 -0
  93. package/lib/v2/oo-software/changelog.js +40 -0
  94. package/lib/v2/oo-software/maintainer.js +3 -0
  95. package/lib/v2/oo-software/radar.js +13 -0
  96. package/lib/v2/oo-software/router.js +3 -0
  97. package/lib/{routes/outagereport/service.js → v2/outagereport/index.js} +2 -2
  98. package/lib/v2/outagereport/maintainer.js +3 -0
  99. package/lib/v2/outagereport/radar.js +13 -0
  100. package/lib/v2/outagereport/router.js +3 -0
  101. package/lib/v2/peopo/maintainer.js +3 -0
  102. package/lib/v2/peopo/radar.js +13 -0
  103. package/lib/v2/peopo/router.js +3 -0
  104. package/lib/v2/peopo/topic.js +46 -0
  105. package/lib/v2/pts/curations.js +44 -0
  106. package/lib/v2/pts/{dailynews.js → index.js} +24 -11
  107. package/lib/v2/pts/maintainer.js +6 -0
  108. package/lib/v2/pts/projects.js +44 -0
  109. package/lib/v2/pts/radar.js +38 -2
  110. package/lib/v2/pts/router.js +4 -1
  111. package/lib/v2/pts/templates/description.art +6 -0
  112. package/lib/v2/sakurazaka46/blog.js +1 -1
  113. package/lib/v2/sakurazaka46/maintainer.js +1 -0
  114. package/lib/v2/sakurazaka46/news.js +51 -0
  115. package/lib/v2/sakurazaka46/radar.js +6 -0
  116. package/lib/v2/sakurazaka46/router.js +1 -0
  117. package/lib/v2/scitation/journal.js +37 -50
  118. package/lib/v2/scitation/section.js +38 -56
  119. package/lib/v2/scitation/templates/description.art +4 -7
  120. package/lib/v2/scitation/utils.js +29 -0
  121. package/lib/v2/sinchew/index.js +68 -0
  122. package/lib/v2/sinchew/maintainer.js +5 -0
  123. package/lib/v2/sinchew/radar.js +25 -0
  124. package/lib/v2/sinchew/router.js +4 -0
  125. package/lib/v2/sinchew/templates/images.art +4 -0
  126. package/lib/v2/taiwannews/hot.js +52 -0
  127. package/lib/v2/taiwannews/maintainer.js +3 -0
  128. package/lib/v2/taiwannews/radar.js +13 -0
  129. package/lib/v2/taiwannews/router.js +3 -0
  130. package/lib/v2/test/index.js +2 -0
  131. package/lib/v2/tju/cic/index.js +113 -0
  132. package/lib/v2/tju/maintainer.js +6 -0
  133. package/lib/v2/tju/news/index.js +135 -0
  134. package/lib/v2/tju/oaa/index.js +112 -0
  135. package/lib/v2/tju/radar.js +97 -0
  136. package/lib/v2/tju/router.js +6 -0
  137. package/lib/v2/tju/yzb/index.js +121 -0
  138. package/lib/v2/tribalfootball/latest.js +68 -0
  139. package/lib/v2/tribalfootball/maintainer.js +3 -0
  140. package/lib/v2/tribalfootball/radar.js +13 -0
  141. package/lib/v2/tribalfootball/router.js +3 -0
  142. package/lib/v2/tribalfootball/templates/plus_header.art +6 -0
  143. package/lib/v2/youzhiyouxing/materials.js +5 -5
  144. package/lib/v2/zhihu/question.js +5 -3
  145. package/lib/v2/zhihu/router.js +1 -1
  146. package/lib/v2/zhihu/zhuanlan.js +2 -2
  147. package/package.json +19 -19
  148. package/lib/routes/universities/tjpyu/ooa.js +0 -73
  149. package/lib/v2/36kr/motif.js +0 -36
  150. package/lib/v2/36kr/news.js +0 -56
  151. package/lib/v2/36kr/newsflashes.js +0 -37
  152. package/lib/v2/36kr/search/article.js +0 -27
  153. package/lib/v2/36kr/user.js +0 -61
  154. package/lib/v2/houxu/templates/description.art +0 -9
@@ -0,0 +1,53 @@
1
+ {{ if image }}
2
+ <img src="{{ image }}">
3
+ {{ /if }}
4
+ {{ if teasers }}
5
+ <backquote>
6
+ {{ each teasers teaser }}
7
+ <p>{{ teaser }}</p>
8
+ {{ /each }}
9
+ </backquote>
10
+ {{ /if }}
11
+ {{ each blocks block }}
12
+ {{ if block.blockType === 'summary' }}
13
+ <backquote>
14
+ {{ set summaries = block.summary }}
15
+ {{ each summaries summary }}
16
+ <p>{{ summary }}</p>
17
+ {{ /each }}
18
+ </backquote>
19
+ {{ else if block.blockType === 'text' }}
20
+ {{ set htmlTokens = block.htmlTokens }}
21
+ {{ each htmlTokens tokens }}
22
+ {{ each tokens token }}
23
+ {{ if token.type === 'text' }}
24
+ <p>{{ token.content }}</p>
25
+ {{ else if token.type === 'link' }}
26
+ <a href="{{ token.link }}">{{ token.content }}</a>
27
+ {{ else if token.type === 'boldText' }}
28
+ <b>{{ token.content }}</b>
29
+ {{ else if token.type === 'boldLink' }}
30
+ <a href="{{ token.link }}"><b>{{ token.content }}</b></a>
31
+ {{ /if }}
32
+ {{ /each }}
33
+ {{ /each }}
34
+ {{ else if block.blockType === 'quote' }}
35
+ {{ set message = block.message }}
36
+ {{ set author = block.author }}
37
+ <q>{{ message }} —— {{ author }}</q>
38
+ {{ else if block.blockType === 'image' }}
39
+ {{ set image = block.image }}
40
+ <figure>
41
+ <figurecaption>{{ image.caption }}</figurecaption>
42
+ <img src="{{ image.cdnUrl }}" alt="{{ image.caption }}" height="{{ image.originalHeight }}" width="{{ image.originalWidth }}">
43
+ </figure>
44
+ {{ else if block.blockType === 'gallery' }}
45
+ {{ set images = block.images }}
46
+ {{ each images image }}
47
+ <figure>
48
+ <figurecaption>{{ image.caption }}</figurecaption>
49
+ <img src="{{ image.cdnUrl }}" alt="{{ image.caption }}" height="{{ image.originalHeight }}" width="{{ image.originalWidth }}">
50
+ </figure>
51
+ {{ /each }}
52
+ {{ /if }}
53
+ {{ /each }}
@@ -0,0 +1,43 @@
1
+ const got = require('@/utils/got');
2
+ const { parseDate } = require('@/utils/parse-date');
3
+ const { art } = require('@/utils/render');
4
+ const path = require('path');
5
+
6
+ const rootUrl = 'https://hk01.com';
7
+ const apiRootUrl = 'https://web-data.api.hk01.com';
8
+
9
+ module.exports = {
10
+ rootUrl,
11
+ apiRootUrl,
12
+ ProcessItems: async (items, limit, tryGet) =>
13
+ await Promise.all(
14
+ items
15
+ .filter((item) => item.type !== 2)
16
+ .slice(0, limit ? parseInt(limit) : 50)
17
+ .map((item) => ({
18
+ title: item.data.title,
19
+ link: `${rootUrl}/sns/article/${item.data.articleId}`,
20
+ pubDate: parseDate(item.data.publishTime * 1000),
21
+ category: item.data.tags.map((t) => t.tagName),
22
+ author: item.data.authors.map((a) => a.publishName).join(', '),
23
+ }))
24
+ .map((item) =>
25
+ tryGet(item.link, async () => {
26
+ const detailResponse = await got({
27
+ method: 'get',
28
+ url: item.link,
29
+ });
30
+
31
+ const content = JSON.parse(detailResponse.data.match(/"__NEXT_DATA__" type="application\/json">({"props":.*})<\/script>/)[1]);
32
+
33
+ item.description = art(path.join(__dirname, 'templates/description.art'), {
34
+ image: content.props.initialProps.pageProps.article.originalImage.cdnUrl,
35
+ teasers: content.props.initialProps.pageProps.article.teaser,
36
+ blocks: content.props.initialProps.pageProps.article.blocks,
37
+ });
38
+
39
+ return item;
40
+ })
41
+ )
42
+ ),
43
+ };
@@ -1,42 +1,23 @@
1
1
  const got = require('@/utils/got');
2
- const { parseDate } = require('@/utils/parse-date');
2
+ const { rootUrl, apiRootUrl, ProcessItems } = require('./utils');
3
3
 
4
4
  module.exports = async (ctx) => {
5
- const id = ctx.params.id;
5
+ const id = ctx.params.id ?? '1';
6
6
 
7
- const response = await got(`https://web-data.api.hk01.com/v2/page/zone/${id}`);
8
- const data = response.data;
9
- const list = data.sections[0].items;
7
+ const currentUrl = `${rootUrl}/zone/${id}`;
8
+ const apiUrl = `${apiRootUrl}/v2/feed/zone/${id}`;
9
+
10
+ const response = await got({
11
+ method: 'get',
12
+ url: apiUrl,
13
+ });
14
+
15
+ const items = await ProcessItems(response.data.items, ctx.query.limit, ctx.cache.tryGet);
10
16
 
11
17
  ctx.state.data = {
12
- title: `香港01 - ${data.zone.publishName}`,
13
- description: data.meta.metaDesc,
14
- link: data.zone.publishUrl,
15
- item: list.map((item) => {
16
- let author;
17
- let description;
18
- let pubDate;
19
- switch (item.type) {
20
- case 1:
21
- author = item.data.authors && item.data.authors.map((e) => e.publishName).join(', ');
22
- description = `<p>${item.data.description}</p><img style="width: 100%" src="${item.data.mainImage.cdnUrl}" />`;
23
- pubDate = parseDate(item.data.lastModifyTime * 1000);
24
- break;
25
- case 2:
26
- author = item.data.zonePublishName;
27
- description = `${item.data.teaser.map((e) => '<p>' + e + '</p>').join('')}<img style="width: 100%" src="${item.data.mainImage.cdnUrl}" />`;
28
- pubDate = parseDate(item.data.lastModifyTime * 1000);
29
- break;
30
- default:
31
- break;
32
- }
33
- return {
34
- title: item.data.title,
35
- author,
36
- description,
37
- pubDate,
38
- link: item.data.canonicalUrl,
39
- };
40
- }),
18
+ title: `${response.data.category.publishName} | 香港01`,
19
+ link: currentUrl,
20
+ item: items,
21
+ image: response.data.category.icon,
41
22
  };
42
23
  };
@@ -0,0 +1,37 @@
1
+ const got = require('@/utils/got');
2
+ const { parseDate } = require('@/utils/parse-date');
3
+ const { art } = require('@/utils/render');
4
+ const path = require('path');
5
+
6
+ module.exports = async (ctx) => {
7
+ const rootUrl = 'https://houxu.app';
8
+ const apiUrl = `${rootUrl}/api/1/events?limit=${ctx.query.limit ?? 50}`;
9
+ const currentUrl = `${rootUrl}/events`;
10
+
11
+ const response = await got({
12
+ method: 'get',
13
+ url: apiUrl,
14
+ });
15
+
16
+ const items = response.data.results.map((item) => ({
17
+ guid: `${rootUrl}/events/${item.id}#${item.last_thread.id}`,
18
+ title: item.title,
19
+ link: `${rootUrl}/events/${item.id}`,
20
+ author: item.creator.name,
21
+ category: item.tags,
22
+ pubDate: parseDate(item.update_at),
23
+ description: art(path.join(__dirname, 'templates/events.art'), {
24
+ title: item.title,
25
+ description: item.description,
26
+ linkTitle: item.last_thread.link_title,
27
+ content: item.last_thread.title.replace(/\r\n/g, '<br>'),
28
+ pubDate: item.update_at,
29
+ }),
30
+ }));
31
+
32
+ ctx.state.data = {
33
+ title: '后续 - 专栏',
34
+ link: currentUrl,
35
+ item: items,
36
+ };
37
+ };
@@ -1,85 +1,37 @@
1
1
  const got = require('@/utils/got');
2
- const path = require('path');
3
- const { art } = require('@/utils/render');
4
2
  const { parseDate } = require('@/utils/parse-date');
5
-
6
- const categories = {
7
- index: '首页',
8
- featured: '热点',
9
- updated: '跟踪',
10
- memory: '跟踪',
11
- events: '事件',
12
- };
3
+ const { art } = require('@/utils/render');
4
+ const path = require('path');
13
5
 
14
6
  module.exports = async (ctx) => {
15
- const category = ctx.params.category ?? 'index';
16
- const id = ctx.params.id ?? '';
17
- let title,
18
- description,
19
- author = '';
20
-
21
7
  const rootUrl = 'https://houxu.app';
22
- const currentUrl = `${rootUrl}/api/1/${id ? `lives/${id}/threads` : category === 'events' ? category : category === 'updated' || category === 'memory' ? 'lives/updated' : `records/${category}`}/?limit=${ctx.query.limit ?? 30}`;
8
+ const apiUrl = `${rootUrl}/api/1/records/index?limit=${ctx.query.limit ?? 50}`;
23
9
 
24
10
  const response = await got({
25
11
  method: 'get',
26
- url: currentUrl,
12
+ url: apiUrl,
27
13
  });
28
14
 
29
- let items = response.data.results.map((item) => ({
30
- guid: item.object?.id ?? item.id,
31
- title: item.link?.title ?? item.object?.title ?? item.title,
32
- link: item.link?.url ?? `${rootUrl}/lives/${item.object?.id ?? item.id}`,
33
- pubDate: parseDate(item.create_at ?? item.object?.create_at ?? item.publish_at),
34
- description: `<p>${item.link?.description ?? item.object?.summary ?? item.last?.link.description ?? item.description}</p>`,
35
- author: item.link?.source ?? item.link?.media?.name ?? item.object?.creator?.username ?? item.object?.creator?.name ?? item.creator?.username ?? item.creator?.name ?? '',
15
+ const items = response.data.results.map((item) => ({
16
+ guid: `${rootUrl}/lives/${item.object.id}#${item.object.last.id}`,
17
+ title: item.object.title,
18
+ link: `${rootUrl}/lives/${item.object.id}`,
19
+ author: item.object.last.link.source ?? item.object.last.link.media.name,
20
+ pubDate: parseDate(item.object.news_update_at),
21
+ description: art(path.join(__dirname, 'templates/lives.art'), {
22
+ title: item.object.title,
23
+ description: item.object.summary,
24
+ url: item.object.last.link.url,
25
+ linkTitle: item.object.last.link.title,
26
+ source: item.object.last.link.source ?? item.object.last.link.media.name,
27
+ content: item.object.last.link.description.replace(/\r\n/g, '<br>'),
28
+ pubDate: item.object.news_update_at,
29
+ }),
36
30
  }));
37
31
 
38
- if (id) {
39
- const detailResponse = await got({
40
- method: 'get',
41
- url: `${rootUrl}/api/1/lives/${id}`,
42
- });
43
-
44
- title = detailResponse.data.title;
45
- description = detailResponse.data.summary;
46
- author = detailResponse.data.creator.name;
47
- } else {
48
- items = await Promise.all(
49
- items.map((item) =>
50
- ctx.cache.tryGet(item.guid, async () => {
51
- try {
52
- const detailResponse = await got({
53
- method: 'get',
54
- url: `${rootUrl}/api/1/lives/${item.guid}/threads/?limit=1000`,
55
- });
56
-
57
- const feeds = detailResponse.data.results.map((item) =>
58
- art(path.join(__dirname, 'templates/description.art'), {
59
- title: item.link.title,
60
- link: item.link.url,
61
- pubDate: parseDate(item.create_at),
62
- description: `<p>${item.link.description}</p>`,
63
- author: item.link.source ?? item.link.media?.name ?? '',
64
- })
65
- );
66
-
67
- item.description = feeds.join('');
68
-
69
- return item;
70
- } catch (e) {
71
- return Promise.resolve('');
72
- }
73
- })
74
- )
75
- );
76
- }
77
-
78
32
  ctx.state.data = {
79
- title: `${title || categories[category]} - 后续`,
80
- link: currentUrl,
33
+ title: '后续 - 热点',
34
+ link: rootUrl,
81
35
  item: items,
82
- description,
83
- author,
84
36
  };
85
37
  };
@@ -0,0 +1,35 @@
1
+ const got = require('@/utils/got');
2
+ const { parseDate } = require('@/utils/parse-date');
3
+
4
+ module.exports = async (ctx) => {
5
+ const id = ctx.params.id;
6
+
7
+ const rootUrl = 'https://houxu.app';
8
+ const apiUrl = `${rootUrl}/api/1/lives/${id}`;
9
+ const currentUrl = `${rootUrl}/lives/${id}`;
10
+
11
+ const pageResponse = await got({
12
+ method: 'get',
13
+ url: apiUrl,
14
+ });
15
+
16
+ const response = await got({
17
+ method: 'get',
18
+ url: `${apiUrl}/threads?limit=${ctx.query.limit ?? 500}`,
19
+ });
20
+
21
+ const items = response.data.results.map((item) => ({
22
+ title: item.link.title,
23
+ link: item.link.url,
24
+ author: item.link.source ?? item.link.media.name,
25
+ pubDate: parseDate(item.create_at),
26
+ description: item.link.description,
27
+ }));
28
+
29
+ ctx.state.data = {
30
+ title: `后续 - ${pageResponse.data.title}`,
31
+ link: currentUrl,
32
+ item: items,
33
+ description: pageResponse.data.summary,
34
+ };
35
+ };
@@ -1,4 +1,6 @@
1
1
  module.exports = {
2
- '/lives/:id?': ['nczitzk'],
3
- '/:category?': ['nczitzk'],
2
+ '/events': ['nczitzk'],
3
+ '/lives/:id': ['nczitzk'],
4
+ '/memory': ['nczitzk'],
5
+ '/': ['nczitzk'],
4
6
  };
@@ -0,0 +1,37 @@
1
+ const got = require('@/utils/got');
2
+ const { parseDate } = require('@/utils/parse-date');
3
+ const { art } = require('@/utils/render');
4
+ const path = require('path');
5
+
6
+ module.exports = async (ctx) => {
7
+ const rootUrl = 'https://houxu.app';
8
+ const apiUrl = `${rootUrl}/api/1/lives/updated?limit=${ctx.query.limit ?? 50}`;
9
+ const currentUrl = `${rootUrl}/memory`;
10
+
11
+ const response = await got({
12
+ method: 'get',
13
+ url: apiUrl,
14
+ });
15
+
16
+ const items = response.data.results.map((item) => ({
17
+ guid: `${rootUrl}/lives/${item.id}#${item.last.id}`,
18
+ title: item.last.link.title,
19
+ link: `${rootUrl}/lives/${item.id}`,
20
+ author: item.last.link.source,
21
+ category: [item.title],
22
+ pubDate: parseDate(item.last.create_at),
23
+ description: art(path.join(__dirname, 'templates/memory.art'), {
24
+ live: item.title,
25
+ url: item.last.link.url,
26
+ title: item.last.link.title,
27
+ source: item.last.link.source,
28
+ description: item.last.link.description,
29
+ }),
30
+ }));
31
+
32
+ ctx.state.data = {
33
+ title: '后续 - 跟踪',
34
+ link: currentUrl,
35
+ item: items,
36
+ };
37
+ };
@@ -3,14 +3,26 @@ module.exports = {
3
3
  _name: '后续',
4
4
  '.': [
5
5
  {
6
- title: '分类',
7
- docs: 'https://docs.rsshub.app/new-media.html#hou-xu-fen-lei',
8
- source: ['/:category', '/'],
9
- target: '/houxu/:category?',
6
+ title: '热点',
7
+ docs: 'https://docs.rsshub.app/new-media.html#hou-xu-re-dian',
8
+ source: ['/'],
9
+ target: '/houxu',
10
10
  },
11
11
  {
12
- title: 'Lives',
13
- docs: 'https://docs.rsshub.app/new-media.html#hou-xu-lives',
12
+ title: '跟踪',
13
+ docs: 'https://docs.rsshub.app/new-media.html#hou-xu-gen-zong',
14
+ source: ['/memory', '/'],
15
+ target: '/houxu/memory',
16
+ },
17
+ {
18
+ title: '专栏',
19
+ docs: 'https://docs.rsshub.app/new-media.html#hou-xu-zhuan-lan',
20
+ source: ['/events', '/'],
21
+ target: '/houxu/events',
22
+ },
23
+ {
24
+ title: 'Live',
25
+ docs: 'https://docs.rsshub.app/new-media.html#hou-xu-live',
14
26
  source: ['/lives/:id', '/'],
15
27
  target: '/houxu/lives/:id',
16
28
  },
@@ -1,3 +1,8 @@
1
1
  module.exports = function (router) {
2
- router.get('/:category?/:id?', require('./index'));
2
+ router.get('/events', require('./events'));
3
+ router.get('/featured', require('./index'));
4
+ router.get('/index', require('./index'));
5
+ router.get('/lives/:id', require('./lives'));
6
+ router.get('/memory', require('./memory'));
7
+ router.get('/', require('./index'));
3
8
  };
@@ -0,0 +1,5 @@
1
+ <h1>{{ title }}</h1>
2
+ <p>{{ description }}</p>
3
+ <b>Latest: {{ linkTitle }}</b>
4
+ <p>{{@ content }}</p>
5
+ <small>{{ pubDate }}</small>
@@ -0,0 +1,5 @@
1
+ <h1>{{ title }}</h1>
2
+ <p>{{ description }}</p>
3
+ <b>Latest: <a href="{{ url }}">{{ linkTitle }}</a>{{ if source }}&nbsp({{ source }}){{ /if }}</b>
4
+ <p>{{@ content }}</p>
5
+ <small>{{ pubDate }}</small>
@@ -0,0 +1,3 @@
1
+ <h1>{{ live }}</h1>
2
+ <b><a href="{{ url }}">{{ title }}</a>{{ if source }}&nbsp({{ source }}){{ /if }}</b>
3
+ <p>{{ description }}</p>
@@ -0,0 +1,58 @@
1
+ const got = require('@/utils/got');
2
+ const cheerio = require('cheerio');
3
+ const timezone = require('@/utils/timezone');
4
+ const { parseDate } = require('@/utils/parse-date');
5
+ const { art } = require('@/utils/render');
6
+ const path = require('path');
7
+
8
+ module.exports = async (ctx) => {
9
+ const category = ctx.params.category ?? '-1';
10
+ const language = ctx.params.language ?? '';
11
+ const latestAdditions = ctx.params.latestAdditions ?? '1';
12
+ const latestEdits = ctx.params.latestEdits ?? '1';
13
+ const latestAlerts = ctx.params.latestAlerts ?? '1';
14
+ const latestPictures = ctx.params.latestPictures ?? '1';
15
+
16
+ const rootUrl = `https://${language === 'en' || language === '' ? '' : `${language}.`}myfigurecollection.net`;
17
+ const currentUrl = `${rootUrl}/browse.v4.php?mode=activity&latestAdditions=${latestAdditions}&latestEdits=${latestEdits}&latestAlerts=${latestAlerts}&latestPictures=${latestPictures}&rootId=${category}`;
18
+
19
+ const response = await got({
20
+ method: 'get',
21
+ url: currentUrl,
22
+ });
23
+
24
+ const $ = cheerio.load(response.data);
25
+
26
+ const items = $('.activity-wrapper')
27
+ .toArray()
28
+ .map((item) => {
29
+ item = $(item);
30
+
31
+ return {
32
+ title: `${item.find('.activity-label').text().split(' • ')[0]}: ${item.find('.stamp-anchor').text()}`,
33
+ link: `${rootUrl}${item.find('.stamp-anchor .tbx-tooltip').attr('href')}`,
34
+ pubDate: timezone(parseDate(item.find('.activity-time span').attr('title')), +0),
35
+ author: item.find('.user-anchor').text(),
36
+ description: art(path.join(__dirname, 'templates/activity.art'), {
37
+ changelog: item.find('.changelog').text(),
38
+ pictures: item
39
+ .find('.picture-icon')
40
+ .toArray()
41
+ .map((image) =>
42
+ $(image)
43
+ .html()
44
+ .match(/url\((.*)\)/)[1]
45
+ .replace(/\/thumbnails/, '')
46
+ ),
47
+ }),
48
+ };
49
+ });
50
+
51
+ ctx.state.data = {
52
+ title: $('title')
53
+ .text()
54
+ .replace(/ \(.*\)/, ''),
55
+ link: currentUrl,
56
+ item: items,
57
+ };
58
+ };
@@ -0,0 +1,78 @@
1
+ const got = require('@/utils/got');
2
+ const cheerio = require('cheerio');
3
+ const { art } = require('@/utils/render');
4
+ const path = require('path');
5
+
6
+ const shortcuts = {
7
+ potd: 'picture/browse/potd/',
8
+ potw: 'picture/browse/potw/',
9
+ potm: 'picture/browse/potm/',
10
+ };
11
+
12
+ module.exports = async (ctx) => {
13
+ const language = ctx.params.language ?? '';
14
+ const category = ctx.params.category ?? 'figure';
15
+
16
+ const rootUrl = `https://${language === 'en' || language === '' ? '' : `${language}.`}myfigurecollection.net`;
17
+ const currentUrl = `${rootUrl}/${shortcuts.hasOwnProperty(category) ? shortcuts[category] : category}`;
18
+
19
+ const response = await got({
20
+ method: 'get',
21
+ url: currentUrl,
22
+ });
23
+
24
+ const $ = cheerio.load(response.data);
25
+
26
+ let items = $('.item-icon, .picture-icon')
27
+ .slice(0, ctx.query.limit ? parseInt(ctx.query.limit) : 25)
28
+ .toArray()
29
+ .map((item) => {
30
+ item = $(item).find('a');
31
+
32
+ const link = item.attr('href');
33
+
34
+ return {
35
+ link: /^http/.test(link) ? link : `${rootUrl}${link}`,
36
+ };
37
+ });
38
+
39
+ items = await Promise.all(
40
+ items.map((item) =>
41
+ ctx.cache.tryGet(item.link, async () => {
42
+ try {
43
+ const detailResponse = await got({
44
+ method: 'get',
45
+ url: item.link,
46
+ });
47
+
48
+ const content = cheerio.load(detailResponse.data);
49
+
50
+ item.title = content('.headline').text();
51
+ item.description = art(path.join(__dirname, 'templates/description.art'), {
52
+ pictures: /myfigurecollection\.net\/picture\//.test(item.link)
53
+ ? [{ src: content('meta[property="og:image"]').attr('content') }]
54
+ : JSON.parse(decodeURIComponent(content('meta[name="pictures"]').attr('content'))),
55
+ fields: content('.form-field')
56
+ .toArray()
57
+ .map((f) => ({
58
+ key: content(f).find('.form-label').text(),
59
+ value: content(f).find('.form-input').text(),
60
+ })),
61
+ });
62
+ } catch (e) {
63
+ item.title = `Item #${item.link.split('/').pop()}`;
64
+ }
65
+
66
+ return item;
67
+ })
68
+ )
69
+ );
70
+
71
+ ctx.state.data = {
72
+ title: $('title')
73
+ .text()
74
+ .replace(/ \(.*\)/, ''),
75
+ link: currentUrl,
76
+ item: items,
77
+ };
78
+ };
@@ -0,0 +1,4 @@
1
+ module.exports = {
2
+ '/activity/:category?/:language?/:latestAdditions?/:latestEdits?/:latestAlerts?/:latestPictures?': ['nczitzk'],
3
+ '/:category?/:language?': ['nczitzk'],
4
+ };
@@ -0,0 +1,44 @@
1
+ const myFigureCollection = [
2
+ {
3
+ title: '活動',
4
+ docs: 'https://docs.rsshub.app/shopping.html#MyFigureCollection-huo-dong',
5
+ source: ['/browse/activity', '/'],
6
+ target: '/myfigurecollection/activity/:category?/:language?/:latestAdditions?/:latestEdits?/:latestAlerts?/:latestPictures?',
7
+ },
8
+ {
9
+ title: '資料庫',
10
+ docs: 'https://docs.rsshub.app/shopping.html#MyFigureCollection-zi-liao-ku',
11
+ source: ['/browse', '/'],
12
+ target: '/myfigurecollection/:category?/:language?',
13
+ },
14
+ {
15
+ title: '圖片',
16
+ docs: 'https://docs.rsshub.app/shopping.html#MyFigureCollection-tu-pian',
17
+ source: ['/picture/browse/:category', '/'],
18
+ target: (params) => {
19
+ if (params.category === 'potd' || params.category === 'potw' || params.category === 'potm') {
20
+ return '/myfigurecollection/:category?/:language?';
21
+ }
22
+ },
23
+ },
24
+ ];
25
+
26
+ module.exports = {
27
+ 'myfigurecollection.net': {
28
+ _name: 'MyFigureCollection',
29
+ '.': myFigureCollection,
30
+ de: myFigureCollection,
31
+ es: myFigureCollection,
32
+ fi: myFigureCollection,
33
+ fr: myFigureCollection,
34
+ it: myFigureCollection,
35
+ ja: myFigureCollection,
36
+ nl: myFigureCollection,
37
+ no: myFigureCollection,
38
+ pl: myFigureCollection,
39
+ pt: myFigureCollection,
40
+ ru: myFigureCollection,
41
+ sv: myFigureCollection,
42
+ zh: myFigureCollection,
43
+ },
44
+ };
@@ -0,0 +1,4 @@
1
+ module.exports = function (router) {
2
+ router.get('/activity/:category?/:language?/:latestAdditions?/:latestEdits?/:latestAlerts?/:latestPictures?', require('./activity'));
3
+ router.get('/:category?/:language?', require('./index'));
4
+ };
@@ -0,0 +1,8 @@
1
+ {{ if changelog }}
2
+ Changed field: {{ changelog }}
3
+ {{ /if }}
4
+ {{ if pictures }}
5
+ {{ each pictures picture }}
6
+ <img src="{{ picture }}">
7
+ {{ /each }}
8
+ {{ /if }}