rsshub 1.0.0-master.f9b85f5 → 1.0.0-master.f9c381a

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 (166) hide show
  1. package/lib/config.ts +10 -0
  2. package/lib/middleware/cache.ts +4 -0
  3. package/lib/middleware/parameter.ts +1 -1
  4. package/lib/registry.ts +6 -2
  5. package/lib/routes/51cto/utils.ts +1 -1
  6. package/lib/routes/abc/index.ts +1 -1
  7. package/lib/routes/acgvinyl/namespace.ts +6 -0
  8. package/lib/routes/acgvinyl/news.ts +86 -0
  9. package/lib/routes/ally/rail.ts +1 -1
  10. package/lib/routes/anthropic/news.ts +13 -11
  11. package/lib/routes/apnews/mobile-api.ts +1 -1
  12. package/lib/routes/apnews/sitemap.ts +1 -1
  13. package/lib/routes/apple/apps.ts +2 -2
  14. package/lib/routes/apple/podcast.ts +58 -25
  15. package/lib/routes/bangumi.tv/group/reply.ts +1 -1
  16. package/lib/routes/bilibili/cache.ts +18 -2
  17. package/lib/routes/bilibili/dynamic.ts +31 -7
  18. package/lib/routes/bilibili/page.ts +1 -1
  19. package/lib/routes/bilibili/ranking.ts +23 -17
  20. package/lib/routes/bilibili/wasm-exec.ts +1 -1
  21. package/lib/routes/bilibili/weekly-recommend.ts +22 -6
  22. package/lib/routes/bjp/apod.ts +1 -1
  23. package/lib/routes/buaa/jiaowu.ts +1 -1
  24. package/lib/routes/bullionvault/gold-news.ts +3 -3
  25. package/lib/routes/cast/index.ts +1 -1
  26. package/lib/routes/coolapk/utils.ts +5 -4
  27. package/lib/routes/coolbuy/index.ts +106 -0
  28. package/lib/routes/{xinhuanet → coolbuy}/namespace.ts +3 -3
  29. package/lib/routes/coolbuy/templates/description.art +48 -0
  30. package/lib/routes/coolidge/film-guide.ts +60 -0
  31. package/lib/routes/coolidge/namespace.ts +7 -0
  32. package/lib/routes/coolidge/news.ts +65 -0
  33. package/lib/routes/coolidge/templates/description.art +4 -0
  34. package/lib/routes/copymanga/comic.ts +1 -1
  35. package/lib/routes/cpta/handler.ts +1 -1
  36. package/lib/routes/creative-comic/book.ts +1 -1
  37. package/lib/routes/daum/potplayer.ts +1 -1
  38. package/lib/routes/dockerhub/utils.ts +1 -1
  39. package/lib/routes/dora-world/article.ts +2 -2
  40. package/lib/routes/ehentai/ehapi.ts +3 -3
  41. package/lib/routes/eventbrite/events.ts +152 -0
  42. package/lib/routes/eventbrite/namespace.ts +7 -0
  43. package/lib/routes/github/activity.ts +1 -1
  44. package/lib/routes/google/jules.ts +63 -0
  45. package/lib/routes/gov/mem/namespace.ts +7 -0
  46. package/lib/routes/gov/mem/zfxxgkpt.ts +96 -0
  47. package/lib/routes/gov/mot/index.ts +158 -53
  48. package/lib/routes/hameln/chapter.ts +1 -1
  49. package/lib/routes/hpoi/banner-item.ts +28 -11
  50. package/lib/routes/hpoi/info.ts +1 -1
  51. package/lib/routes/huggingface/daily-papers.ts +1 -1
  52. package/lib/routes/hupu/index.ts +158 -74
  53. package/lib/routes/hupu/types.ts +163 -0
  54. package/lib/routes/hust/gs.ts +1 -1
  55. package/lib/routes/hust/mse.ts +1 -1
  56. package/lib/routes/huxiu/util.ts +2 -2
  57. package/lib/routes/infoq/presentations.ts +1 -1
  58. package/lib/routes/instagram/common-utils.ts +3 -3
  59. package/lib/routes/itch/devlog.ts +7 -3
  60. package/lib/routes/javbus/index.ts +1 -1
  61. package/lib/routes/javlibrary/utils.ts +1 -1
  62. package/lib/routes/jbma/namespace.ts +17 -0
  63. package/lib/routes/jbma/report.ts +473 -0
  64. package/lib/routes/jetbrains/comments.ts +1 -1
  65. package/lib/routes/jingzhengu/utils.ts +1 -1
  66. package/lib/routes/juejin/aicoding.ts +102 -0
  67. package/lib/routes/juejin/utils.ts +36 -51
  68. package/lib/routes/kakuyomu/works.ts +1 -1
  69. package/lib/routes/kemono/index.ts +2 -2
  70. package/lib/routes/komiic/comic.ts +1 -1
  71. package/lib/routes/koyso/index.ts +338 -0
  72. package/lib/routes/koyso/namespace.ts +9 -0
  73. package/lib/routes/koyso/templates/description.art +13 -0
  74. package/lib/routes/letterboxd/index.ts +65 -0
  75. package/lib/routes/letterboxd/namespace.ts +8 -0
  76. package/lib/routes/maccms/index.ts +1 -1
  77. package/lib/routes/mercari/util.ts +1 -1
  78. package/lib/routes/mingpao/index.ts +1 -1
  79. package/lib/routes/nankai/ai-notice.ts +142 -0
  80. package/lib/routes/nankai/graduate-notice.ts +162 -0
  81. package/lib/routes/natgeo/natgeo.ts +1 -0
  82. package/lib/routes/nhk/news-web-easy.ts +1 -1
  83. package/lib/routes/nicovideo/mylist.ts +39 -0
  84. package/lib/routes/nicovideo/types.ts +27 -0
  85. package/lib/routes/nicovideo/utils.ts +27 -1
  86. package/lib/routes/nikkei/cn/index.ts +1 -4
  87. package/lib/routes/now/news.ts +1 -1
  88. package/lib/routes/nytimes/index.ts +1 -1
  89. package/lib/routes/pixiv/novel-api/user-novels/sfw.ts +1 -1
  90. package/lib/routes/pixivision/utils.ts +1 -1
  91. package/lib/routes/pku/hr.ts +1 -1
  92. package/lib/routes/pku/scc/recruit.ts +1 -1
  93. package/lib/routes/producthunt/templates/description.art +2 -2
  94. package/lib/routes/producthunt/today.ts +17 -8
  95. package/lib/routes/ps/trophy.ts +1 -1
  96. package/lib/routes/pubscholar/utils.ts +14 -1
  97. package/lib/routes/qweather/3days.ts +14 -14
  98. package/lib/routes/qweather/now.ts +12 -10
  99. package/lib/routes/qweather/util.tsx +89 -0
  100. package/lib/routes/qwenlm/blog.ts +75 -0
  101. package/lib/routes/qwenlm/namespace.ts +6 -0
  102. package/lib/routes/radio-canada/latest.ts +30 -17
  103. package/lib/routes/ruc/ai.ts +1 -1
  104. package/lib/routes/ruc/hr.ts +1 -1
  105. package/lib/routes/samrdprc/index.ts +241 -0
  106. package/lib/routes/samrdprc/namespace.ts +1 -1
  107. package/lib/routes/sdo/ff14risingstones/api.ts +78 -0
  108. package/lib/routes/sdo/ff14risingstones/constant.ts +338 -0
  109. package/lib/routes/sdo/ff14risingstones/posts.ts +80 -0
  110. package/lib/routes/sdo/ff14risingstones/strats.ts +75 -0
  111. package/lib/routes/sdo/ff14risingstones/templates/duties-party.art +41 -0
  112. package/lib/routes/sdo/ff14risingstones/templates/fc-party.art +26 -0
  113. package/lib/routes/sdo/ff14risingstones/templates/novice-network-party.art +9 -0
  114. package/lib/routes/sdo/ff14risingstones/templates/rp-party.art +15 -0
  115. package/lib/routes/sdo/ff14risingstones/timeline.ts +31 -0
  116. package/lib/routes/sdo/ff14risingstones/types/dynamic.ts +50 -0
  117. package/lib/routes/sdo/ff14risingstones/types/index.ts +3 -0
  118. package/lib/routes/sdo/ff14risingstones/types/other.ts +57 -0
  119. package/lib/routes/sdo/ff14risingstones/types/party.ts +111 -0
  120. package/lib/routes/sdo/ff14risingstones/user-dynamics.ts +32 -0
  121. package/lib/routes/sdo/ff14risingstones/user-posts.ts +32 -0
  122. package/lib/routes/sdo/ff14risingstones/user-resently.ts +38 -0
  123. package/lib/routes/sdo/ff14risingstones/user-strats.ts +32 -0
  124. package/lib/routes/sdo/ff14risingstones/utils.ts +215 -0
  125. package/lib/routes/sdo/namespace.ts +7 -0
  126. package/lib/routes/showstart/utils.ts +1 -1
  127. package/lib/routes/sohu/mp.ts +1 -1
  128. package/lib/routes/sotwe/user.ts +1 -1
  129. package/lib/routes/surfshark/blog.ts +273 -77
  130. package/lib/routes/surfshark/templates/description.art +16 -4
  131. package/lib/routes/sustainabilitymag/articles.ts +1 -1
  132. package/lib/routes/syosetu/dev.ts +1 -1
  133. package/lib/routes/syosetu/ranking-isekai.ts +1 -1
  134. package/lib/routes/szse/disclosure/listed-notice.ts +44 -6
  135. package/lib/routes/telegram/channel-media.ts +249 -0
  136. package/lib/routes/telegram/channel.ts +5 -4
  137. package/lib/routes/telegram/stories.ts +130 -0
  138. package/lib/routes/telegram/tglib/channel.ts +136 -118
  139. package/lib/routes/telegram/tglib/client.ts +37 -139
  140. package/lib/routes/tesla/cx.ts +1 -1
  141. package/lib/routes/theverge/index.ts +20 -6
  142. package/lib/routes/threads/utils.ts +7 -3
  143. package/lib/routes/tidb/blog.ts +1 -1
  144. package/lib/routes/toutiao/user.ts +2 -2
  145. package/lib/routes/twitter/api/mobile-api/api.ts +1 -1
  146. package/lib/routes/txrjy/fornumtopic.ts +2 -2
  147. package/lib/routes/typst/universe.ts +1 -1
  148. package/lib/routes/uber/blog.ts +87 -46
  149. package/lib/routes/weibo/utils.ts +17 -9
  150. package/lib/routes/xiaohongshu/user.ts +1 -1
  151. package/lib/routes/xjtu/ee-jzxx.ts +1 -1
  152. package/lib/routes/yahoo/news/utils.ts +1 -1
  153. package/lib/routes/ymgal/article.ts +1 -1
  154. package/lib/routes/yoasobi-music/media.ts +1 -1
  155. package/lib/routes/youtube/api/youtubei.ts +1 -1
  156. package/lib/routes/youtube/community.ts +4 -4
  157. package/lib/routes/zaker/utils.ts +1 -1
  158. package/lib/routes/zaobao/util.tsx +1 -1
  159. package/lib/server.ts +1 -1
  160. package/lib/types.ts +1 -1
  161. package/lib/utils/puppeteer-utils.test.ts +2 -2
  162. package/lib/views/index.tsx +4 -4
  163. package/package.json +40 -40
  164. package/lib/routes/qweather/templates/3days.art +0 -22
  165. package/lib/routes/qweather/templates/now.art +0 -16
  166. package/lib/routes/xinhuanet/app.ts +0 -109
@@ -0,0 +1,473 @@
1
+ import { type Data, type Route, ViewType } from '@/types';
2
+
3
+ import ofetch from '@/utils/ofetch';
4
+ import { parseDate } from '@/utils/parse-date';
5
+
6
+ import { type CheerioAPI, load } from 'cheerio';
7
+ import { type Context } from 'hono';
8
+
9
+ export const handler = async (ctx: Context): Promise<Data> => {
10
+ const { filter } = ctx.req.param();
11
+ const limit: number = Number.parseInt(ctx.req.query('limit') ?? '50', 10);
12
+
13
+ const apiSlug = 'wp-json/wp/v2';
14
+
15
+ const baseUrl: string = 'https://jbma.net';
16
+ const apiUrl = new URL(`${apiSlug}/report`, baseUrl).href;
17
+ let targetUrl: string = new URL('report/', baseUrl).href;
18
+
19
+ const [taxonomy, keyword] = filter ? (filter.includes('/') ? filter.split('/') : [undefined, filter]) : [undefined, undefined];
20
+
21
+ let searchId: number | undefined = undefined;
22
+
23
+ if (taxonomy && keyword) {
24
+ const apiSearchUrl = new URL(`${apiSlug}/${taxonomy}`, baseUrl).href;
25
+
26
+ const searchResponse = await ofetch(apiSearchUrl, {
27
+ query: {
28
+ search: keyword,
29
+ },
30
+ });
31
+
32
+ const searchObj = searchResponse.find((c) => c.slug === keyword || c.name === keyword);
33
+ searchId = searchObj?.id ?? undefined;
34
+ targetUrl = searchObj?.link ?? targetUrl;
35
+ }
36
+
37
+ const response = await ofetch(apiUrl, {
38
+ query: {
39
+ _embed: 'true',
40
+ per_page: limit,
41
+ ...(taxonomy && searchId
42
+ ? {
43
+ [taxonomy as string]: searchId,
44
+ }
45
+ : {
46
+ search: keyword,
47
+ }),
48
+ },
49
+ });
50
+
51
+ const targetResponse = await ofetch(targetUrl);
52
+ const $: CheerioAPI = load(targetResponse);
53
+ const language = $('html').attr('lang') ?? 'ja';
54
+
55
+ const postIds: number[] = [];
56
+ const regExp = new RegExp(`^${baseUrl.replaceAll(/[.*+?^${}()|[\]\\]/g, String.raw`\$&`)}/?(?:[a-zA-Z0-9-]+/)*\\?p=\\d+$`);
57
+
58
+ for (const item of response.slice(0, limit)) {
59
+ const linkUrl: string | undefined = item.link;
60
+ if (linkUrl && regExp.test(linkUrl)) {
61
+ postIds.push(item.id);
62
+ }
63
+ }
64
+
65
+ const mediaMap: Map<number, any> = new Map();
66
+ if (postIds.length > 0) {
67
+ const mediaApiUrl = new URL(`${apiSlug}/media`, baseUrl).href;
68
+ const mediaResponse = await ofetch(mediaApiUrl, {
69
+ query: {
70
+ parent: postIds.join(','),
71
+ per_page: 100,
72
+ },
73
+ });
74
+
75
+ for (const media of mediaResponse) {
76
+ if (media.parent) {
77
+ const existing = mediaMap.get(media.parent);
78
+ if (existing) {
79
+ existing.push(media);
80
+ } else {
81
+ mediaMap.set(media.parent, [media]);
82
+ }
83
+ }
84
+ }
85
+ }
86
+
87
+ const items = response.slice(0, limit).map((item) => {
88
+ const title = item.title?.rendered ?? item.title;
89
+ const description = item.content?.rendered ?? undefined;
90
+ const pubDate = item.date_gmt;
91
+
92
+ const terminologies = item._embedded?.['wp:term'];
93
+
94
+ const categories = terminologies?.flat().map((c) => c.name) ?? [];
95
+ const authors =
96
+ item._embedded?.author?.map((author) => ({
97
+ name: author.name,
98
+ url: author.link,
99
+ avatar: author.avatar_urls?.['96'] ?? author.avatar_urls?.['48'] ?? author.avatar_urls?.['24'] ?? undefined,
100
+ })) ?? [];
101
+ const guid = item.guid?.rendered ?? item.guid;
102
+ const updated = item.modified_gmt ?? pubDate;
103
+
104
+ let image = item._embedded?.['wp:featuredmedia']?.[0].source_url ?? undefined;
105
+ let enclosureUrl: string | undefined;
106
+ let enclosureType: string | undefined;
107
+ let enclosureTitle: string | undefined;
108
+ let enclosureLength: number | undefined;
109
+
110
+ let linkUrl = item.link;
111
+
112
+ if (linkUrl && regExp.test(linkUrl)) {
113
+ const mediaItems = mediaMap.get(item.id);
114
+
115
+ if (mediaItems && mediaItems.length > 0) {
116
+ const media = mediaItems[0];
117
+ if (media.source_url) {
118
+ enclosureUrl = media.source_url;
119
+ enclosureType = media.mime_type;
120
+ enclosureTitle = media.title?.rendered ?? media.title;
121
+ enclosureLength = Number(media.media_details?.filesize);
122
+ linkUrl = enclosureUrl;
123
+ }
124
+ if (!image && media.media_details?.sizes?.full?.source_url) {
125
+ image = media.media_details.sizes.full.source_url;
126
+ }
127
+ }
128
+ }
129
+
130
+ if (!linkUrl || regExp.test(linkUrl)) {
131
+ linkUrl = new URL(`report/${item.slug}`, baseUrl).href;
132
+ }
133
+
134
+ let processedItem = {
135
+ title,
136
+ description,
137
+ pubDate: pubDate ? parseDate(pubDate) : undefined,
138
+ link: linkUrl ?? guid,
139
+ category: categories,
140
+ author: authors,
141
+ guid,
142
+ id: guid,
143
+ content: {
144
+ html: description,
145
+ text: description,
146
+ },
147
+ image,
148
+ banner: image,
149
+ updated: updated ? parseDate(updated) : undefined,
150
+ language,
151
+ };
152
+
153
+ if (enclosureUrl) {
154
+ processedItem = {
155
+ ...processedItem,
156
+ enclosure_url: enclosureUrl,
157
+ enclosure_type: enclosureType,
158
+ enclosure_title: enclosureTitle || title,
159
+ enclosure_length: enclosureLength,
160
+ };
161
+ }
162
+
163
+ return processedItem;
164
+ });
165
+
166
+ return {
167
+ title: $('title').text(),
168
+ description: $('meta[property="og:description"]').attr('content'),
169
+ link: targetUrl,
170
+ item: items,
171
+ allowEmpty: true,
172
+ image: $('meta[property="og:image"]').attr('content'),
173
+ author: $('meta[property="og:site_name"]').attr('content'),
174
+ language,
175
+ id: targetUrl,
176
+ };
177
+ };
178
+
179
+ const options = [
180
+ {
181
+ label: 'すべて',
182
+ value: '',
183
+ },
184
+ {
185
+ label: 'Metals Forcus',
186
+ value: 'cat_report/metals-forcus',
187
+ },
188
+ {
189
+ label: 'WPIC',
190
+ value: 'cat_report/wpic',
191
+ },
192
+ {
193
+ label: 'Incrementum',
194
+ value: 'cat_report/incrementum',
195
+ },
196
+ {
197
+ label: '東京金融取引所',
198
+ value: 'cat_report/tfx',
199
+ },
200
+ {
201
+ label: '池水執筆・出演',
202
+ value: 'cat_report/ikemizu',
203
+ },
204
+ {
205
+ label: 'note',
206
+ value: 'cat_report/note',
207
+ },
208
+ {
209
+ label: 'その他',
210
+ value: 'cat_report/other',
211
+ },
212
+ {
213
+ label: 'In Gold We Trust',
214
+ value: 'tag_report/in-gold-we-trust',
215
+ },
216
+ {
217
+ label: 'Precious Metals Weeklyレポート',
218
+ value: 'tag_report/precious-metals-weekly-report',
219
+ },
220
+ {
221
+ label: 'ひろこのマーケットラウンジ',
222
+ value: 'tag_report/market-lounge',
223
+ },
224
+ {
225
+ label: 'その他',
226
+ value: 'tag_report/other',
227
+ },
228
+ {
229
+ label: '四半期レポート',
230
+ value: 'tag_report/quarterly-report',
231
+ },
232
+ {
233
+ label: 'プラチナ展望',
234
+ value: 'tag_report/tenbo',
235
+ },
236
+ {
237
+ label: 'Gold Compass',
238
+ value: 'tag_report/gold-compass',
239
+ },
240
+ {
241
+ label: '豆知識',
242
+ value: 'tag_report/mamechishiki',
243
+ },
244
+ {
245
+ label: 'プラチナ投資のエッセンス',
246
+ value: 'tag_report/essence',
247
+ },
248
+ {
249
+ label: '三菱UFJ信託銀行',
250
+ value: 'tag_report/mufg',
251
+ },
252
+ {
253
+ label: '石福金属興業',
254
+ value: 'tag_report/ishifuku',
255
+ },
256
+ {
257
+ label: 'OANDA 証券',
258
+ value: 'tag_report/oanda',
259
+ },
260
+ {
261
+ label: 'レポート',
262
+ value: 'tag_report/report',
263
+ },
264
+ ];
265
+
266
+ const filterTable = `
267
+ | --------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
268
+ | [Metals Forcus](https://jbma.net/cat_report/metals-forcus/) | [cat_report/metals-forcus](https://rsshub.app/jbma/report/cat_report/metals-forcus) |
269
+ | [WPIC](https://jbma.net/cat_report/wpic/) | [cat_report/wpic](https://rsshub.app/jbma/report/cat_report/wpic) |
270
+ | [Incrementum](https://jbma.net/cat_report/incrementum/) | [cat_report/incrementum](https://rsshub.app/jbma/report/cat_report/incrementum) |
271
+ | [東京金融取引所](https://jbma.net/cat_report/tfx/) | [cat_report/tfx](https://rsshub.app/jbma/report/cat_report/tfx) |
272
+ | [池水執筆・出演](https://jbma.net/cat_report/ikemizu/) | [cat_report/ikemizu](https://rsshub.app/jbma/report/cat_report/ikemizu) |
273
+ | [note](https://jbma.net/cat_report/note/) | [cat_report/note](https://rsshub.app/jbma/report/cat_report/note) |
274
+ | [その他](https://jbma.net/cat_report/other/) | [cat_report/other](https://rsshub.app/jbma/report/cat_report/other) |
275
+ | [In Gold We Trust](https://jbma.net/tag_report/in-gold-we-trust/) | [tag_report/in-gold-we-trust](https://rsshub.app/jbma/report/tag_report/in-gold-we-trust) |
276
+ | [Precious Metals Weekly レポート](https://jbma.net/tag_report/precious-metals-weekly-report/) | [tag_report/precious-metals-weekly-report](https://rsshub.app/jbma/report/tag_report/precious-metals-weekly-report) |
277
+ | [ひろこのマーケットラウンジ](https://jbma.net/tag_report/market-lounge/) | [tag_report/market-lounge](https://rsshub.app/jbma/report/tag_report/market-lounge) |
278
+ | [その他](https://jbma.net/tag_report/other/) | [tag_report/other](https://rsshub.app/jbma/report/tag_report/other) |
279
+ | [四半期レポート](https://jbma.net/tag_report/quarterly-report/) | [tag_report/quarterly-report](https://rsshub.app/jbma/report/tag_report/quarterly-report) |
280
+ | [プラチナ展望](https://jbma.net/tag_report/tenbo/) | [tag_report/tenbo](https://rsshub.app/jbma/report/tag_report/tenbo) |
281
+ | [Gold Compass](https://jbma.net/tag_report/gold-compass/) | [tag_report/gold-compass](https://rsshub.app/jbma/report/tag_report/gold-compass) |
282
+ | [豆知識](https://jbma.net/tag_report/mamechishiki/) | [tag_report/mamechishiki](https://rsshub.app/jbma/report/tag_report/mamechishiki) |
283
+ | [プラチナ投資のエッセンス](https://jbma.net/tag_report/essence/) | [tag_report/essence](https://rsshub.app/jbma/report/tag_report/essence) |
284
+ | [三菱 UFJ 信託銀行](https://jbma.net/tag_report/mufg/) | [tag_report/mufg](https://rsshub.app/jbma/report/tag_report/mufg) |
285
+ | [石福金属興業](https://jbma.net/tag_report/ishifuku/) | [tag_report/ishifuku](https://rsshub.app/jbma/report/tag_report/ishifuku) |
286
+ | [OANDA 証券](https://jbma.net/tag_report/oanda/) | [tag_report/oanda](https://rsshub.app/jbma/report/tag_report/oanda) |
287
+ | [レポート](https://jbma.net/tag_report/report/) | [tag_report/report](https://rsshub.app/jbma/report/tag_report/report) |
288
+
289
+ `;
290
+
291
+ export const route: Route = {
292
+ path: '/report/:filter{.+}?',
293
+ name: 'Precious Metals Report',
294
+ url: 'jbma.net',
295
+ maintainers: ['nczitzk'],
296
+ handler,
297
+ example: '/jbma/report',
298
+ parameters: {
299
+ filter: {
300
+ description: 'Filter, all by default, can be found in the corresponding page URL',
301
+ options,
302
+ },
303
+ },
304
+ description:
305
+ `:::tip
306
+ To subscribe to [Metals Forcus](https://jbma.net/cat_report/metals-forcus/), where the source URL is \`https://jbma.net/cat_report/metals-forcus/\`, extract the certain parts from this URL to be used as parameters, resulting in the route as [\`/jbma/report/cat_report/metals-forcus\`](https://rsshub.app/jbma/report/cat_report/metals-forcus).
307
+ :::
308
+
309
+ <details>
310
+ <summary>More filters</summary>
311
+
312
+ | Name | ID |
313
+ ` +
314
+ filterTable +
315
+ `
316
+ </details>
317
+ `,
318
+ categories: ['new-media'],
319
+ features: {
320
+ requireConfig: false,
321
+ requirePuppeteer: false,
322
+ antiCrawler: false,
323
+ supportRadar: true,
324
+ supportBT: false,
325
+ supportPodcast: false,
326
+ supportScihub: false,
327
+ },
328
+ radar: [
329
+ {
330
+ source: ['jbma.net/:type/:name?'],
331
+ target: (params) => {
332
+ const type: string = params.type;
333
+ const name: string = params.name;
334
+
335
+ if (type === 'report' || type === 'cat_report' || type === 'tag_report') {
336
+ return `/${type}${name ? `/${name}` : ''}`;
337
+ }
338
+
339
+ return `/${type}`;
340
+ },
341
+ },
342
+ {
343
+ title: 'Metals Forcus',
344
+ source: ['jbma.net/cat_report/metals-forcus'],
345
+ target: '/report/cat_report/metals-forcus',
346
+ },
347
+ {
348
+ title: 'WPIC',
349
+ source: ['jbma.net/cat_report/wpic'],
350
+ target: '/report/cat_report/wpic',
351
+ },
352
+ {
353
+ title: 'Incrementum',
354
+ source: ['jbma.net/cat_report/incrementum'],
355
+ target: '/report/cat_report/incrementum',
356
+ },
357
+ {
358
+ title: '東京金融取引所',
359
+ source: ['jbma.net/cat_report/tfx'],
360
+ target: '/report/cat_report/tfx',
361
+ },
362
+ {
363
+ title: '池水執筆・出演',
364
+ source: ['jbma.net/cat_report/ikemizu'],
365
+ target: '/report/cat_report/ikemizu',
366
+ },
367
+ {
368
+ title: 'note',
369
+ source: ['jbma.net/cat_report/note'],
370
+ target: '/report/cat_report/note',
371
+ },
372
+ {
373
+ title: 'その他',
374
+ source: ['jbma.net/cat_report/other'],
375
+ target: '/report/cat_report/other',
376
+ },
377
+ {
378
+ title: 'In Gold We Trust',
379
+ source: ['jbma.net/tag_report/in-gold-we-trust'],
380
+ target: '/report/tag_report/in-gold-we-trust',
381
+ },
382
+ {
383
+ title: 'Precious Metals Weeklyレポート',
384
+ source: ['jbma.net/tag_report/precious-metals-weekly-report'],
385
+ target: '/report/tag_report/precious-metals-weekly-report',
386
+ },
387
+ {
388
+ title: 'ひろこのマーケットラウンジ',
389
+ source: ['jbma.net/tag_report/market-lounge'],
390
+ target: '/report/tag_report/market-lounge',
391
+ },
392
+ {
393
+ title: 'その他',
394
+ source: ['jbma.net/tag_report/other'],
395
+ target: '/report/tag_report/other',
396
+ },
397
+ {
398
+ title: '四半期レポート',
399
+ source: ['jbma.net/tag_report/quarterly-report'],
400
+ target: '/report/tag_report/quarterly-report',
401
+ },
402
+ {
403
+ title: 'プラチナ展望',
404
+ source: ['jbma.net/tag_report/tenbo'],
405
+ target: '/report/tag_report/tenbo',
406
+ },
407
+ {
408
+ title: 'Gold Compass',
409
+ source: ['jbma.net/tag_report/gold-compass'],
410
+ target: '/report/tag_report/gold-compass',
411
+ },
412
+ {
413
+ title: '豆知識',
414
+ source: ['jbma.net/tag_report/mamechishiki'],
415
+ target: '/report/tag_report/mamechishiki',
416
+ },
417
+ {
418
+ title: 'プラチナ投資のエッセンス',
419
+ source: ['jbma.net/tag_report/essence'],
420
+ target: '/report/tag_report/essence',
421
+ },
422
+ {
423
+ title: '三菱UFJ信託銀行',
424
+ source: ['jbma.net/tag_report/mufg'],
425
+ target: '/report/tag_report/mufg',
426
+ },
427
+ {
428
+ title: '石福金属興業',
429
+ source: ['jbma.net/tag_report/ishifuku'],
430
+ target: '/report/tag_report/ishifuku',
431
+ },
432
+ {
433
+ title: 'OANDA 証券',
434
+ source: ['jbma.net/tag_report/oanda'],
435
+ target: '/report/tag_report/oanda',
436
+ },
437
+ {
438
+ title: 'レポート',
439
+ source: ['jbma.net/tag_report/report'],
440
+ target: '/report/tag_report/report',
441
+ },
442
+ ],
443
+ view: ViewType.Articles,
444
+
445
+ zh: {
446
+ path: '/report/:filter{.+}?',
447
+ name: '贵金属报告',
448
+ url: 'jbma.net',
449
+ maintainers: ['nczitzk'],
450
+ handler,
451
+ example: '/jbma/report',
452
+ parameters: {
453
+ filter: {
454
+ description: '过滤条件,默认为全部,可在对应页 URL 中找到',
455
+ options,
456
+ },
457
+ },
458
+ description:
459
+ `:::tip
460
+ 若订阅 [Metals Forcus](https://jbma.net/cat_report/metals-forcus/),网址为 \`https://jbma.net/cat_report/metals-forcus/\`,请截取 \`https://jbma.net/\` 到末尾 \`/\` 的部分 \`cat_report/metals-forcus\` 作为 \`filter\` 参数填入,此时目标路由为 [\`/jbma/report/cat_report/metals-forcus\`](https://rsshub.app/jbma/report/cat_report/metals-forcus)。
461
+ :::
462
+
463
+ <details>
464
+ <summary>更多分类</summary>
465
+
466
+ | 名称 | ID |
467
+ ` +
468
+ filterTable +
469
+ `
470
+ </details>
471
+ `,
472
+ },
473
+ };
@@ -87,7 +87,7 @@ async function handler(ctx) {
87
87
  const items = response.activities
88
88
  .map((activity) => processActivity(activity, issueId))
89
89
  .filter((item) => item !== null)
90
- .sort((a, b) => new Date(b.pubDate).getTime() - new Date(a.pubDate).getTime())
90
+ .toSorted((a, b) => new Date(b.pubDate).getTime() - new Date(a.pubDate).getTime())
91
91
  .slice(0, limit);
92
92
 
93
93
  return {
@@ -23,7 +23,7 @@ export function sign(payload: Map<string, any>) {
23
23
  }
24
24
 
25
25
  const sortedString = lowerCaseKeys
26
- .sort()
26
+ .toSorted()
27
27
  .map((key) => key + '=' + map.get(key))
28
28
  .join('');
29
29
  const linkedString = link('--'.slice(0, 1), '#CEAIWER', '892F', 'KB97', 'JKB6', 'HJ7OC7C8', 'GJZG');
@@ -0,0 +1,102 @@
1
+ import { Route } from '@/types';
2
+ import ofetch from '@/utils/ofetch';
3
+ import { getTagList, parseList, ProcessFeed } from './utils';
4
+ import { Tag } from './types';
5
+
6
+ export const route: Route = {
7
+ path: '/aicoding/:tag?/:sort?',
8
+ categories: ['programming'],
9
+ example: '/juejin/aicoding',
10
+ parameters: {
11
+ tag: {
12
+ description: '标签,留空为全部',
13
+ options: [
14
+ { value: 'AI编程', label: 'AI编程' },
15
+ { value: 'Claude', label: 'Claude' },
16
+ { value: 'Trae', label: 'Trae' },
17
+ { value: 'MCP', label: 'MCP' },
18
+ { value: 'Cursor', label: 'Cursor' },
19
+ { value: 'Cline', label: 'Cline' },
20
+ { value: 'Github Copilot', label: 'Github Copilot' },
21
+ { value: 'bolt', label: 'bolt' },
22
+ { value: 'V0', label: 'V0' },
23
+ { value: 'replit', label: 'replit' },
24
+ { value: 'Warp', label: 'Warp' },
25
+ { value: 'Visual Studio IntelliCode', label: 'Visual Studio IntelliCode' },
26
+ { value: 'WindSurf', label: 'WindSurf' },
27
+ { value: '豆包MarsCode', label: '豆包MarsCode' },
28
+ { value: '通义灵码', label: '通义灵码' },
29
+ { value: 'Devin', label: 'Devin' },
30
+ { value: '文心快码', label: '文心快码' },
31
+ { value: 'imgcook', label: 'imgcook' },
32
+ { value: 'CodeWhisperer', label: 'CodeWhisperer' },
33
+ { value: 'Lovable', label: 'Lovable' },
34
+ { value: 'FittenCode', label: 'FittenCode' },
35
+ { value: 'Solo', label: 'Solo' },
36
+ { value: 'CodeFuse', label: 'CodeFuse' },
37
+ { value: 'Tabnine', label: 'Tabnine' },
38
+ ],
39
+ },
40
+ sort: {
41
+ description: '排序方式,默认为最新发布',
42
+ default: 'hot',
43
+ options: [
44
+ { value: 'hot', label: '热门' },
45
+ { value: 'latest', label: '最新' },
46
+ ],
47
+ },
48
+ },
49
+ features: {
50
+ requireConfig: false,
51
+ requirePuppeteer: false,
52
+ antiCrawler: false,
53
+ supportBT: false,
54
+ supportPodcast: false,
55
+ supportScihub: false,
56
+ },
57
+ radar: [
58
+ {
59
+ source: ['juejin.cn/books'],
60
+ },
61
+ ],
62
+ name: 'AI 编程',
63
+ maintainers: ['TonyRL'],
64
+ handler,
65
+ url: 'aicoding.juejin.cn',
66
+ };
67
+
68
+ async function handler(ctx) {
69
+ const { tag, sort } = ctx.req.param();
70
+ const sortType = sort === 'hot' ? 1 : 2;
71
+ let tagList: {
72
+ tag_id: string;
73
+ tag: Tag;
74
+ }[],
75
+ currentTag: Tag | undefined,
76
+ tagId: string | undefined;
77
+ if (tag) {
78
+ tagList = await getTagList();
79
+ currentTag = tagList.find((item) => item.tag.tag_name === tag)?.tag;
80
+ tagId = currentTag?.tag_id;
81
+ }
82
+
83
+ const response = await ofetch('https://api.juejin.cn/content_api/v1/aicoding/content', {
84
+ method: 'POST',
85
+ body: {
86
+ sort_type: sortType,
87
+ cursor: '',
88
+ limit: 10,
89
+ tag_ids: tagId ? [tagId] : undefined,
90
+ },
91
+ });
92
+
93
+ const list = parseList(response.data.map((item) => item.article_pack || item.short_msg_pack));
94
+ const items = await ProcessFeed(list);
95
+
96
+ return {
97
+ title: `${currentTag ? `${currentTag.tag_name} - ` : ''}AI 编程`,
98
+ link: `https://aicoding.juejin.cn/?contentType=${sortType}${tagId ? `&tagId=${tagId}` : ''}`,
99
+ image: currentTag ? currentTag.icon : 'https://lf-web-assets.juejin.cn/obj/juejin-web/goofy_deploy_edenx/toutiao-fe/xitu_juejin_aicoding/favicon.ico',
100
+ item: items,
101
+ };
102
+ }