rsshub 1.0.0-master.e5d191c → 1.0.0-master.e5fc2b2

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 (294) hide show
  1. package/README.md +11 -46
  2. package/lib/api/radar/rules/all.ts +3 -6
  3. package/lib/api/radar/rules/one.ts +3 -6
  4. package/lib/config.ts +30 -22
  5. package/lib/errors/index.test.ts +1 -1
  6. package/lib/errors/index.tsx +2 -2
  7. package/lib/index.ts +1 -1
  8. package/lib/middleware/anti-hotlink.test.ts +191 -6
  9. package/lib/middleware/anti-hotlink.ts +28 -0
  10. package/lib/middleware/logger.ts +2 -2
  11. package/lib/middleware/parameter.test.ts +22 -5
  12. package/lib/middleware/parameter.ts +47 -17
  13. package/lib/registry.test.ts +8 -0
  14. package/lib/registry.ts +2 -0
  15. package/lib/router.js +1 -4
  16. package/lib/routes/141jav/index.ts +25 -21
  17. package/lib/routes/141ppv/index.ts +24 -20
  18. package/lib/routes/51read/article.ts +82 -0
  19. package/lib/routes/51read/namespace.ts +6 -0
  20. package/lib/routes/5eplay/utils.ts +5 -3
  21. package/lib/routes/abc/index.ts +2 -2
  22. package/lib/routes/agri/index.ts +307 -0
  23. package/lib/routes/agri/namespace.ts +8 -0
  24. package/lib/routes/agri/templates/description.art +21 -0
  25. package/lib/routes/aljazeera/index.ts +2 -2
  26. package/lib/routes/apnews/api.ts +62 -0
  27. package/lib/routes/apnews/rss.ts +1 -1
  28. package/lib/routes/apnews/sitemap.ts +99 -0
  29. package/lib/routes/apnews/topics.ts +2 -2
  30. package/lib/routes/apnews/utils.ts +7 -5
  31. package/lib/routes/bestblogs/feeds.ts +107 -0
  32. package/lib/routes/bestblogs/namespace.ts +6 -0
  33. package/lib/routes/bilibili/api-interface.d.ts +1 -0
  34. package/lib/routes/bilibili/bilibili-recommend.ts +42 -0
  35. package/lib/routes/bilibili/cache.ts +25 -1
  36. package/lib/routes/bilibili/dynamic.ts +103 -101
  37. package/lib/routes/bilibili/followings-video.ts +9 -3
  38. package/lib/routes/bilibili/utils.ts +5 -0
  39. package/lib/routes/bilibili/video.ts +2 -1
  40. package/lib/routes/binance/announcement.ts +168 -0
  41. package/lib/routes/binance/types.ts +26 -0
  42. package/lib/routes/bing/daily-wallpaper.ts +1 -1
  43. package/lib/routes/bitget/announcement.ts +200 -0
  44. package/lib/routes/bitget/namespace.ts +6 -0
  45. package/lib/routes/bitget/type.ts +26 -0
  46. package/lib/routes/bjnews/cat.ts +43 -0
  47. package/lib/routes/bjnews/column.ts +43 -0
  48. package/lib/routes/bjnews/namespace.ts +6 -0
  49. package/lib/routes/bjnews/utils.ts +19 -0
  50. package/lib/routes/bjx/fd.ts +35 -26
  51. package/lib/routes/buaa/jiaowu.ts +1 -1
  52. package/lib/routes/buaa/lib/space/newbook.ts +171 -0
  53. package/lib/routes/buaa/lib/space/templates/newbook.art +44 -0
  54. package/lib/routes/bupt/jwc.ts +130 -0
  55. package/lib/routes/cccfna/index.ts +2 -2
  56. package/lib/routes/cctv/category.ts +16 -12
  57. package/lib/routes/cctv/xwlb.ts +32 -10
  58. package/lib/routes/cdu/jwgg.ts +79 -0
  59. package/lib/routes/cdu/namespace.ts +6 -0
  60. package/lib/routes/cffex/announcement.ts +73 -0
  61. package/lib/routes/cffex/namespace.ts +6 -0
  62. package/lib/routes/chikubi/index.ts +75 -0
  63. package/lib/routes/chikubi/namespace.ts +6 -0
  64. package/lib/routes/chikubi/utils.ts +82 -0
  65. package/lib/routes/chlinlearn/daily-blog.ts +7 -0
  66. package/lib/routes/copymanga/comic.ts +3 -1
  67. package/lib/routes/devolverdigital/blog.ts +59 -42
  68. package/lib/routes/digitalcameraworld/news.ts +1 -1
  69. package/lib/routes/discord/channel.ts +10 -10
  70. package/lib/routes/discord/discord-api.ts +27 -32
  71. package/lib/routes/discord/templates/message.art +15 -0
  72. package/lib/routes/discourse/notifications.ts +2 -1
  73. package/lib/routes/discourse/official.ts +55 -0
  74. package/lib/routes/douban/movie/coming.ts +68 -0
  75. package/lib/routes/douban/templates/movie_coming.art +27 -0
  76. package/lib/routes/eastmoney/report/index.ts +63 -15
  77. package/lib/routes/eastmoney/templates/stock_description.art +36 -0
  78. package/lib/routes/eastmoney/utils.ts +35 -0
  79. package/lib/routes/easynomad/joblist.ts +56 -0
  80. package/lib/routes/easynomad/namespace.ts +6 -0
  81. package/lib/routes/fediverse/timeline.ts +35 -18
  82. package/lib/routes/flashcat/blog.ts +61 -0
  83. package/lib/routes/flashcat/namespace.ts +6 -0
  84. package/lib/routes/follow/namespace.ts +6 -0
  85. package/lib/routes/follow/profile.ts +69 -0
  86. package/lib/routes/follow/types.ts +38 -0
  87. package/lib/routes/ftm/index.ts +60 -0
  88. package/lib/routes/ftm/namespace.ts +6 -0
  89. package/lib/routes/galxe/index.ts +94 -0
  90. package/lib/routes/galxe/namespace.ts +9 -0
  91. package/lib/routes/gamersky/ent.ts +57 -0
  92. package/lib/routes/gamersky/namespace.ts +10 -0
  93. package/lib/routes/gamersky/news.ts +91 -0
  94. package/lib/routes/gamersky/review.ts +80 -0
  95. package/lib/routes/gamersky/utils.ts +94 -0
  96. package/lib/routes/gdut/oa-news.ts +12 -17
  97. package/lib/routes/geekpark/index.ts +219 -0
  98. package/lib/routes/geekpark/namespace.ts +8 -0
  99. package/lib/routes/geekpark/templates/description.art +21 -0
  100. package/lib/routes/gisreportsonline/index.ts +60 -0
  101. package/lib/routes/gisreportsonline/namespace.ts +6 -0
  102. package/lib/routes/github/activity.ts +2 -1
  103. package/lib/routes/github/search.ts +20 -18
  104. package/lib/routes/go/mhlw/pdf.ts +87 -0
  105. package/lib/routes/go/namespace.ts +8 -0
  106. package/lib/routes/go/niid/idwr-dl.ts +104 -0
  107. package/lib/routes/google/research.ts +45 -0
  108. package/lib/routes/gov/cbirc/index.ts +371 -0
  109. package/lib/routes/gov/chongqing/sydwgkzp.ts +4 -4
  110. package/lib/routes/gov/lswz/index.ts +289 -0
  111. package/lib/routes/gov/zj/ningbogzw-notice.ts +50 -0
  112. package/lib/routes/gov/zj/ningborsjnotice.ts +50 -0
  113. package/lib/routes/gq/news.ts +1 -1
  114. package/lib/routes/gs/developer/blog.ts +58 -0
  115. package/lib/routes/gs/namespace.ts +9 -0
  116. package/lib/routes/healthz.ts +8 -0
  117. package/lib/routes/hket/index.ts +80 -76
  118. package/lib/routes/hottoys/index.ts +63 -0
  119. package/lib/routes/hottoys/namespace.ts +6 -0
  120. package/lib/routes/hust/gs.ts +281 -0
  121. package/lib/routes/hust/namespace.ts +1 -1
  122. package/lib/routes/imhcg/blog.ts +47 -0
  123. package/lib/routes/imhcg/namespace.ts +7 -0
  124. package/lib/routes/imop/namespace.ts +10 -0
  125. package/lib/routes/imop/tianshu.ts +53 -0
  126. package/lib/routes/infzm/hot.ts +39 -0
  127. package/lib/routes/infzm/index.ts +3 -30
  128. package/lib/routes/infzm/utils.ts +34 -0
  129. package/lib/routes/inspirehep/author.ts +46 -0
  130. package/lib/routes/inspirehep/literature.ts +42 -0
  131. package/lib/routes/inspirehep/namespace.ts +7 -0
  132. package/lib/routes/inspirehep/types.ts +210 -0
  133. package/lib/routes/inspirehep/utils.ts +15 -0
  134. package/lib/routes/iwara/subscriptions.ts +1 -1
  135. package/lib/routes/javdb/actors.ts +6 -2
  136. package/lib/routes/jjwxc/book.ts +18 -14
  137. package/lib/routes/joins/chinese.ts +218 -0
  138. package/lib/routes/joins/namespace.ts +8 -0
  139. package/lib/routes/joins/templates/description.art +17 -0
  140. package/lib/routes/juejin/dynamic.ts +114 -0
  141. package/lib/routes/kakuyomu/namespace.ts +6 -0
  142. package/lib/routes/kakuyomu/types.ts +6 -0
  143. package/lib/routes/kakuyomu/works.ts +73 -0
  144. package/lib/routes/kaopu/news.ts +3 -3
  145. package/lib/routes/keylol/index.ts +56 -11
  146. package/lib/routes/kurogames/namespace.ts +7 -0
  147. package/lib/routes/kurogames/wutheringwaves/news.ts +59 -0
  148. package/lib/routes/link3/events.ts +86 -0
  149. package/lib/routes/link3/namespace.ts +6 -0
  150. package/lib/routes/link3/profile.ts +143 -0
  151. package/lib/routes/lmu/jobs.ts +96 -0
  152. package/lib/routes/lmu/namespace.ts +17 -0
  153. package/lib/routes/lmu/templates/jobPosting.art +11 -0
  154. package/lib/routes/lofter/user.ts +1 -1
  155. package/lib/routes/luma/index.ts +92 -0
  156. package/lib/routes/luma/namespace.ts +6 -0
  157. package/lib/routes/malaysiakini/index.ts +179 -0
  158. package/lib/routes/malaysiakini/namespace.ts +11 -0
  159. package/lib/routes/mcmod/index.ts +105 -0
  160. package/lib/routes/mcmod/namespace.ts +6 -0
  161. package/lib/routes/mcmod/templates/mod.art +13 -0
  162. package/lib/routes/meishichina/index.ts +1997 -0
  163. package/lib/routes/meishichina/namespace.ts +8 -0
  164. package/lib/routes/misskey/user-timeline.ts +42 -0
  165. package/lib/routes/misskey/utils.ts +41 -1
  166. package/lib/routes/nationalgeographic/latest-stories.ts +1 -1
  167. package/lib/routes/nationalgeographic/templates/stories.art +1 -1
  168. package/lib/routes/newyorker/news.ts +24 -17
  169. package/lib/routes/oschina/news.ts +2 -0
  170. package/lib/routes/pconline/focus.ts +143 -0
  171. package/lib/routes/pconline/namespace.ts +10 -0
  172. package/lib/routes/people/index.ts +8 -2
  173. package/lib/routes/picnob/user.ts +11 -3
  174. package/lib/routes/pixiv/search.ts +20 -1
  175. package/lib/routes/pixiv/utils.ts +3 -3
  176. package/lib/routes/pku/bbs/hot.ts +1 -1
  177. package/lib/routes/psyche/topic.ts +1 -1
  178. package/lib/routes/psyche/type.ts +1 -1
  179. package/lib/routes/psyche/utils.ts +1 -1
  180. package/lib/routes/questn/community.ts +76 -0
  181. package/lib/routes/questn/events.ts +101 -0
  182. package/lib/routes/questn/namespace.ts +6 -0
  183. package/lib/routes/questn/util.ts +16 -0
  184. package/lib/routes/rebase/geekdaily.ts +35 -0
  185. package/lib/routes/rebase/namespace.ts +6 -0
  186. package/lib/routes/rss3/index.ts +22 -13
  187. package/lib/routes/rss3/interfaces/metadata.ts +67 -0
  188. package/lib/routes/rsshub/routes.ts +18 -12
  189. package/lib/routes/samd/news.ts +2 -2
  190. package/lib/routes/sara/index.ts +1 -1
  191. package/lib/routes/scut/gzic/media.ts +71 -0
  192. package/lib/routes/scut/gzic/news.ts +65 -0
  193. package/lib/routes/scut/gzic/notice.ts +88 -0
  194. package/lib/routes/shiep/config.ts +4 -10
  195. package/lib/routes/shiep/index.ts +9 -9
  196. package/lib/routes/showstart/artist.ts +5 -4
  197. package/lib/routes/showstart/brand.ts +5 -4
  198. package/lib/routes/showstart/event.ts +8 -7
  199. package/lib/routes/showstart/search.ts +43 -9
  200. package/lib/routes/showstart/service.ts +81 -53
  201. package/lib/routes/showstart/site.ts +41 -0
  202. package/lib/routes/showstart/utils.ts +9 -8
  203. package/lib/routes/sis001/author.ts +52 -0
  204. package/lib/routes/sis001/common.ts +38 -0
  205. package/lib/routes/sis001/forum.ts +2 -29
  206. package/lib/routes/sjtu/jwc.ts +4 -1
  207. package/lib/routes/sjtu/namespace.ts +1 -1
  208. package/lib/routes/sjtu/seiee/index.ts +97 -0
  209. package/lib/routes/smzdm/product.ts +86 -0
  210. package/lib/routes/spotify/show.ts +1 -1
  211. package/lib/routes/springer/journal.ts +10 -12
  212. package/lib/routes/sse/sselawsrules.ts +370 -0
  213. package/lib/routes/sspai/author.ts +1 -1
  214. package/lib/routes/sspai/column.ts +1 -1
  215. package/lib/routes/sspai/index.ts +3 -3
  216. package/lib/routes/sspai/matrix.ts +1 -1
  217. package/lib/routes/sspai/series-update.ts +1 -1
  218. package/lib/routes/sspai/tag.ts +1 -1
  219. package/lib/routes/sspai/topic.ts +1 -1
  220. package/lib/routes/sustainabilitymag/articles.ts +2 -0
  221. package/lib/routes/szse/rule.ts +315 -42
  222. package/lib/routes/t66y/index.ts +29 -7
  223. package/lib/routes/taoguba/blog.ts +1 -1
  224. package/lib/routes/taoguba/index.ts +1 -1
  225. package/lib/routes/techcrunch/news.ts +20 -29
  226. package/lib/routes/techcrunch/templates/description.art +7 -0
  227. package/lib/routes/telegram/channel.ts +34 -1
  228. package/lib/routes/test/index.ts +50 -43
  229. package/lib/routes/the/index.ts +211 -0
  230. package/lib/routes/the/namespace.ts +8 -0
  231. package/lib/routes/the/templates/description.art +27 -0
  232. package/lib/routes/the/util.ts +307 -0
  233. package/lib/routes/theblockbeats/index.ts +10 -5
  234. package/lib/routes/towardsdatascience/latest.ts +67 -0
  235. package/lib/routes/towardsdatascience/namespace.ts +6 -0
  236. package/lib/routes/tvb/news.ts +1 -0
  237. package/lib/routes/twitter/api/index.ts +2 -0
  238. package/lib/routes/twitter/api/mobile-api/login.ts +1 -1
  239. package/lib/routes/twitter/api/web-api/api.ts +18 -0
  240. package/lib/routes/twitter/api/web-api/constants.ts +16 -13
  241. package/lib/routes/twitter/api/web-api/login.ts +68 -0
  242. package/lib/routes/twitter/api/web-api/utils.ts +54 -29
  243. package/lib/routes/twitter/home-latest.ts +60 -0
  244. package/lib/routes/twitter/home.ts +1 -1
  245. package/lib/routes/twitter/tweet.ts +1 -0
  246. package/lib/routes/twitter/user.ts +1 -1
  247. package/lib/routes/twitter/utils.ts +4 -1
  248. package/lib/routes/uber/blog.ts +1 -1
  249. package/lib/routes/ustc/scms.ts +97 -0
  250. package/lib/routes/wchscu/namespace.ts +6 -0
  251. package/lib/routes/wchscu/recruit.ts +73 -0
  252. package/lib/routes/weibo/super-index.ts +23 -11
  253. package/lib/routes/weibo/utils.ts +0 -4
  254. package/lib/routes/xiaohongshu/notes.ts +10 -2
  255. package/lib/routes/xiaohongshu/user.ts +27 -5
  256. package/lib/routes/xiaohongshu/util.ts +3 -1
  257. package/lib/routes/xidian/cs.ts +143 -0
  258. package/lib/routes/xidian/gr.ts +289 -0
  259. package/lib/routes/xidian/jwc.ts +1 -0
  260. package/lib/routes/xidian/namespace.ts +1 -1
  261. package/lib/routes/xueqiu/cookies.ts +14 -1
  262. package/lib/routes/xueqiu/favorite.ts +16 -2
  263. package/lib/routes/yahoo/news/index.ts +1 -0
  264. package/lib/routes/yahoo/news/listid.ts +67 -0
  265. package/lib/routes/yahoo/news/utils.ts +8 -2
  266. package/lib/routes/yicai/carousel.ts +48 -0
  267. package/lib/routes/yicai/utils.ts +23 -17
  268. package/lib/routes/youtube/subscriptions.ts +1 -0
  269. package/lib/routes/yystv/docs.ts +28 -19
  270. package/lib/routes/zaobao/util.ts +1 -1
  271. package/lib/routes/zhihu/answers.ts +5 -1
  272. package/lib/routes/zhihu/execlib/x-zse-96-v3.ts +2 -0
  273. package/lib/routes/zhihu/namespace.ts +3 -0
  274. package/lib/routes/zhihu/utils.ts +18 -3
  275. package/lib/routes/zhihu/zhuanlan.ts +8 -7
  276. package/lib/routes/zsxq/types.ts +9 -0
  277. package/lib/routes/zsxq/utils.ts +4 -3
  278. package/lib/setup.test.ts +1 -1
  279. package/lib/types.ts +6 -0
  280. package/lib/utils/cache/index.ts +8 -0
  281. package/lib/utils/camelcase-keys.spec.ts +127 -0
  282. package/lib/utils/camelcase-keys.ts +27 -0
  283. package/lib/utils/common-utils.ts +1 -0
  284. package/lib/utils/otel/metric.ts +3 -2
  285. package/lib/views/error.tsx +3 -3
  286. package/lib/views/index.tsx +7 -9
  287. package/lib/views/json.ts +1 -1
  288. package/lib/views/layout.tsx +1 -1
  289. package/package.json +45 -43
  290. package/lib/routes/sse/lawandrules.ts +0 -68
  291. package/lib/routes-deprecated/bjnews/news.js +0 -44
  292. package/lib/routes-deprecated/gamersky/ent.js +0 -89
  293. package/lib/routes-deprecated/gamersky/news.js +0 -34
  294. package/lib/routes-deprecated/geekpark/breakingnews.js +0 -25
@@ -0,0 +1,101 @@
1
+ import { Route } from '@/types';
2
+ import { parseDate } from '@/utils/parse-date';
3
+ import ofetch from '@/utils/ofetch';
4
+
5
+ import { parseFilterStr } from './util';
6
+
7
+ export const route: Route = {
8
+ path: '/events/:filter?',
9
+ name: 'Events',
10
+ url: 'app.questn.com',
11
+ maintainers: ['cxheng315'],
12
+ example: '/questn/events',
13
+ parameters: {
14
+ filter: 'Filter string',
15
+ },
16
+ description: `
17
+ :::tip
18
+
19
+ Filter parameters:
20
+ - category: 100: trending, 200: newest, 300: top
21
+ - status_filter: 0: all, 100: available, 400: missed
22
+ - community_filter: 0: all community, 100: verified, 200: followed
23
+ - rewards_filter: 0: all rewards, 100: nft, 200: token, 400: whitelist
24
+ - chain_filter: 0: all chains, 1: ethereum, 56: bsc, 137: polygon, 42161: arb, 10: op, 324: zksync, 43114: avax
25
+ - search: 'Search keyword',
26
+ - count: 'Number of events to fetch',
27
+ - page: 'Page number',
28
+ :::`,
29
+ categories: ['other'],
30
+ features: {
31
+ requireConfig: false,
32
+ requirePuppeteer: false,
33
+ antiCrawler: false,
34
+ supportBT: false,
35
+ supportPodcast: false,
36
+ supportScihub: false,
37
+ },
38
+ radar: [
39
+ {
40
+ source: ['app.questn.com/explore'],
41
+ target: '/events/:category?/:status_filter?/:community_filter?/:reward_filter?/:chain_filter?/:search?/:count?/:page?',
42
+ },
43
+ ],
44
+ handler,
45
+ };
46
+
47
+ async function handler(ctx) {
48
+ const url = 'https://api.questn.com/consumer/explore/list/';
49
+
50
+ const parsedFilter: { category?: string; status_filter?: string; community_filter?: string; reward_filter?: string; chain_filter?: string; search?: string; count?: string; page?: string } = parseFilterStr(
51
+ ctx.req.param('filter')
52
+ );
53
+
54
+ const params = {
55
+ category: parsedFilter.category || '200',
56
+ status_filter: parsedFilter.status_filter || '100',
57
+ community_filter: parsedFilter.community_filter || '0',
58
+ rewards_filter: parsedFilter.reward_filter || '0',
59
+ chain_filter: parsedFilter.chain_filter || '0',
60
+ search: parsedFilter.search || '',
61
+ count: parsedFilter.count || ctx.req.query('limit') || '20',
62
+ page: parsedFilter.page || '1',
63
+ };
64
+
65
+ const response = await ofetch(`${url}?${new URLSearchParams(params)}`, {
66
+ method: 'GET',
67
+ headers: {
68
+ 'Content-Type': 'application/json',
69
+ },
70
+ });
71
+
72
+ const data = await response.result.data;
73
+
74
+ const items = data.map((item) => ({
75
+ title: item.title,
76
+ link: `https://app.questn.com/quest/${item.id}`,
77
+ author: item.community_info ? item.community_info.name : '',
78
+ guid: item.id,
79
+ pubDate: parseDate(item.start_time * 1000),
80
+ itunes_duration: item.end_time > 0 ? item.end_time - item.start_time : 0,
81
+ }));
82
+
83
+ return {
84
+ title: 'QuestN Events',
85
+ link: 'https://app.questn.com/explore',
86
+ description: 'A Quest Protocol Dedicated to DePIN and AI Training',
87
+ image: 'https://app.questn.com/static/svgs/logo-white.svg',
88
+ logo: 'https://app.questn.com/static/svgs/logo-white.svg',
89
+ author: 'QuestN',
90
+ item:
91
+ items && items.length > 0
92
+ ? items
93
+ : [
94
+ {
95
+ title: 'No events found',
96
+ description: 'No events found',
97
+ link: 'https://app.questn.com/explore',
98
+ },
99
+ ],
100
+ };
101
+ }
@@ -0,0 +1,6 @@
1
+ import type { Namespace } from '@/types';
2
+
3
+ export const namespace: Namespace = {
4
+ name: 'QuestN',
5
+ url: 'app.questn.com',
6
+ };
@@ -0,0 +1,16 @@
1
+ const parseFilterStr = (filterStr) => {
2
+ const filters = {};
3
+ if (!filterStr) {
4
+ return filters;
5
+ }
6
+ const filterPairs = filterStr.split('&'); // Split by '&'
7
+
8
+ for (const pair of filterPairs) {
9
+ const [key, value] = pair.split('='); // Split by '='
10
+ filters[key] = value;
11
+ }
12
+
13
+ return filters;
14
+ };
15
+
16
+ export { parseFilterStr };
@@ -0,0 +1,35 @@
1
+ import { Route } from '@/types';
2
+ import ofetch from '@/utils/ofetch';
3
+ import { parseDate } from '@/utils/parse-date';
4
+
5
+ export const route: Route = {
6
+ path: '/geekdaily',
7
+ categories: ['new-media'],
8
+ example: '/rebase/geekdaily',
9
+ radar: [
10
+ {
11
+ source: ['rebase.network/geekdaily'],
12
+ target: '/geekdaily',
13
+ },
14
+ ],
15
+ name: 'Web3 Geek Daily',
16
+ maintainers: ['gaoyifan'],
17
+ handler: async () => {
18
+ const response = await ofetch('https://db.rebase.network/api/v1/geekdailies?sort=id:desc');
19
+ const data = response.data;
20
+
21
+ const items = data.map((item) => ({
22
+ title: item.attributes.title,
23
+ link: item.attributes.url,
24
+ description: item.attributes.introduce,
25
+ pubDate: parseDate(item.attributes.time),
26
+ author: item.attributes.author,
27
+ }));
28
+
29
+ return {
30
+ title: 'Web3 Geek Daily',
31
+ link: 'https://rebase.network/geekdaily',
32
+ item: items,
33
+ };
34
+ },
35
+ };
@@ -0,0 +1,6 @@
1
+ import type { Namespace } from '@/types';
2
+
3
+ export const namespace: Namespace = {
4
+ name: 'Rebase Network',
5
+ url: 'rebase.network',
6
+ };
@@ -1,6 +1,8 @@
1
- import { Route } from '@/types';
1
+ import { Route, type DataItem } from '@/types';
2
2
 
3
+ import { camelcaseKeys } from '@/utils/camelcase-keys';
3
4
  import ofetch from '@/utils/ofetch';
5
+ import { renderItemActionToHTML } from '@rss3/sdk';
4
6
 
5
7
  export const route: Route = {
6
8
  path: '/:account/:network?/:tag?',
@@ -132,17 +134,24 @@ async function handler(ctx) {
132
134
  return {
133
135
  title: `${account} activities`,
134
136
  link: 'https://rss3.io',
135
- item: data.map((item) => ({
136
- title: `New ${item.tag} ${item.type} action on ${item.network}`,
137
- description: `New ${item.tag} ${item.type} action on ${item.network}<br /><br />From: ${item.from}<br/>To: ${item.to}`,
138
- link: item.actions?.[0]?.related_urls?.[0],
139
- guid: item.id,
140
- author: [
141
- {
142
- name: item.owner,
143
- avatar: `https://cdn.stamp.fyi/avatar/eth:${item.owner}`,
144
- },
145
- ],
146
- })),
137
+ item: data.map((item) => {
138
+ const content = renderItemActionToHTML(camelcaseKeys(item.actions));
139
+
140
+ const description = `New ${item.tag} ${item.type} action on ${item.network}<br /><br />From: ${item.from}<br/>To: ${item.to}`;
141
+ return {
142
+ title: `New ${item.tag} ${item.type} action on ${item.network}`,
143
+ description: content ?? description,
144
+ link: item.actions?.[0]?.related_urls?.[0],
145
+ guid: item.id,
146
+ author: [
147
+ {
148
+ name: item.owner,
149
+ avatar: `https://cdn.stamp.fyi/avatar/eth:${item.owner}`,
150
+ },
151
+ ],
152
+
153
+ _extra: { raw: item },
154
+ } as DataItem;
155
+ }),
147
156
  };
148
157
  }
@@ -0,0 +1,67 @@
1
+ import {
2
+ CollectibleApproval,
3
+ CollectibleBurn,
4
+ CollectibleMint,
5
+ CollectibleTrade,
6
+ CollectibleTransfer,
7
+ ExchangeLiquidity,
8
+ ExchangeStaking,
9
+ ExchangeSwap,
10
+ MetaverseBurn,
11
+ MetaverseMint,
12
+ MetaverseTrade,
13
+ MetaverseTransfer,
14
+ SocialComment,
15
+ SocialDelete,
16
+ SocialMint,
17
+ SocialPost,
18
+ SocialProfile,
19
+ SocialProxy,
20
+ SocialRevise,
21
+ SocialReward,
22
+ SocialShare,
23
+ StakeStaking,
24
+ StakeTransaction,
25
+ StakerProfitSnapshot,
26
+ TransactionApproval,
27
+ TransactionBridge,
28
+ TransactionBurn,
29
+ TransactionEvent,
30
+ TransactionMint,
31
+ TransactionTransfer,
32
+ } from '@rss3/sdk';
33
+ export type RSS3DataModels = {
34
+ CollectibleApproval: CollectibleApproval;
35
+ CollectibleBurn: CollectibleBurn;
36
+ CollectibleMint: CollectibleMint;
37
+ CollectibleTrade: CollectibleTrade;
38
+ CollectibleTransfer: CollectibleTransfer;
39
+ MetaverseBurn: MetaverseBurn;
40
+ MetaverseMint: MetaverseMint;
41
+ MetaverseTrade: MetaverseTrade;
42
+ MetaverseTransfer: MetaverseTransfer;
43
+ SocialComment: SocialComment;
44
+ SocialDelete: SocialDelete;
45
+ SocialMint: SocialMint;
46
+ SocialPost: SocialPost;
47
+ SocialProfile: SocialProfile;
48
+ SocialProxy: SocialProxy;
49
+ SocialRevise: SocialRevise;
50
+ SocialReward: SocialReward;
51
+ SocialShare: SocialShare;
52
+ StakeStaking: StakeStaking;
53
+ StakeTransaction: StakeTransaction;
54
+ StakerProfitSnapshot: StakerProfitSnapshot;
55
+ TransactionApproval: TransactionApproval;
56
+ TransactionBridge: TransactionBridge;
57
+ TransactionBurn: TransactionBurn;
58
+ TransactionEvent: TransactionEvent;
59
+ TransactionMint: TransactionMint;
60
+ TransactionTransfer: TransactionTransfer;
61
+ ExchangeLiquidity: ExchangeLiquidity;
62
+ ExchangeStaking: ExchangeStaking;
63
+ ExchangeSwap: ExchangeSwap;
64
+ };
65
+ export type GetRSS3DataMetadata<FirstKey extends string, SecondKey extends string> = `${Capitalize<FirstKey>}${Capitalize<SecondKey>}` extends keyof RSS3DataModels
66
+ ? RSS3DataModels[`${Capitalize<FirstKey>}${Capitalize<SecondKey>}`]
67
+ : null;
@@ -1,6 +1,6 @@
1
1
  import { Route, ViewType } from '@/types';
2
- import got from '@/utils/got';
3
- import { load } from 'cheerio';
2
+ import ofetch from '@/utils/ofetch';
3
+ import * as cheerio from 'cheerio';
4
4
 
5
5
  export const route: Route = {
6
6
  path: '/routes/:lang?',
@@ -66,11 +66,9 @@ async function handler(ctx) {
66
66
  ];
67
67
  const all = await Promise.all(
68
68
  types.map(async (type) => {
69
- const response = await got(`https://docs.rsshub.app/${lang}routes/${type}`);
69
+ const response = await ofetch(`https://docs.rsshub.app/${lang}routes/${type}`);
70
70
 
71
- const data = response.data;
72
-
73
- const $ = load(data);
71
+ const $ = cheerio.load(response);
74
72
  const page = $('.page').toArray();
75
73
  const item = $('.routeBlock').toArray();
76
74
  return { page, item, type };
@@ -84,15 +82,23 @@ async function handler(ctx) {
84
82
  description: isEnglish ? 'Everything is RSSible' : '万物皆可 RSS',
85
83
  language: isEnglish ? 'en-us' : 'zh-cn',
86
84
  item: list.map(({ page, item, type }) => {
87
- const $ = load(page);
88
- item = $(item);
89
- const h2Title = item.prevAll('h2').eq(0);
90
- const h3Title = item.prevAll('h3').eq(0);
85
+ const $ = cheerio.load(page);
86
+ const $item = $(item);
87
+ const h2Title = $item.prevAll('h2').eq(0);
88
+ const h3Title = $item.prevAll('h3').eq(0);
89
+
90
+ $item.find('.VPBadge').each((_, ele) => {
91
+ const $ele = $(ele);
92
+ if ($ele.text().includes('Test')) {
93
+ $ele.remove();
94
+ }
95
+ });
96
+
91
97
  return {
92
98
  title: `${h2Title.text().trim()} - ${h3Title.text().trim()}`,
93
- description: item.html(),
99
+ description: $item.html()?.replaceAll(/<!--.*?-->/g, ''),
94
100
  link: `https://docs.rsshub.app/${lang}routes/${type}#${encodeURIComponent(h2Title.find('.header-anchor').attr('href') && h3Title.find('.header-anchor').attr('href')?.substring(1))}`,
95
- guid: item.attr('id'),
101
+ guid: $item.attr('id'),
96
102
  };
97
103
  }),
98
104
  };
@@ -3,12 +3,12 @@ import cache from '@/utils/cache';
3
3
  import { parseDate } from '@/utils/parse-date';
4
4
  import timezone from '@/utils/timezone';
5
5
  import { load } from 'cheerio';
6
- import { ofetch } from 'ofetch';
6
+ import ofetch from '@/utils/ofetch';
7
7
 
8
8
  const dict = { '434': '行业资讯', '436': '协会动态', '438': '重要通知', '440': '政策法规' };
9
9
 
10
10
  export const route: Route = {
11
- path: 'news/:typeId',
11
+ path: '/news/:typeId',
12
12
  categories: ['government'],
13
13
  example: '/samd/news/440',
14
14
  parameters: { type: '文章类型ID,见下表' },
@@ -1,7 +1,7 @@
1
1
  import { Route, DataItem } from '@/types';
2
2
  import cache from '@/utils/cache';
3
3
  import { load } from 'cheerio';
4
- import { ofetch } from 'ofetch';
4
+ import ofetch from '@/utils/ofetch';
5
5
 
6
6
  const typeMap = {
7
7
  dynamic: '协会动态',
@@ -0,0 +1,71 @@
1
+ import { Route } from '@/types';
2
+ import cache from '@/utils/cache';
3
+ import got from '@/utils/got';
4
+ import { load } from 'cheerio';
5
+ import { parseDate } from '@/utils/parse-date';
6
+ import ofetch from '@/utils/ofetch';
7
+
8
+ export const route: Route = {
9
+ path: '/gzic/media',
10
+ categories: ['university'],
11
+ example: '/scut/gzic/media',
12
+ features: {
13
+ requireConfig: false,
14
+ requirePuppeteer: false,
15
+ antiCrawler: true,
16
+ supportBT: false,
17
+ supportPodcast: false,
18
+ supportScihub: false,
19
+ },
20
+ name: '广州国际校区 - 媒体报道',
21
+ maintainers: ['gdzhht'],
22
+ handler,
23
+ description: `:::warning
24
+ 由于学校网站对非大陆 IP 的访问存在限制,可能需自行部署。
25
+ :::`,
26
+ };
27
+
28
+ async function handler() {
29
+ const url = 'https://www2.scut.edu.cn/gzic/30281/list.htm';
30
+
31
+ const { data: response } = await got(url);
32
+ const $ = load(response);
33
+
34
+ const list = $('.right-nr .row .col-lg-4')
35
+ .toArray()
36
+ .map((item) => {
37
+ item = $(item);
38
+ const a = item.find('.thr-box a');
39
+ const pubDate = item.find('.thr-box a span');
40
+ return {
41
+ title: item.find('.thr-box a p').text(),
42
+ link: a.attr('href')?.startsWith('http') ? a.attr('href') : `https://www2.scut.edu.cn${a.attr('href')}`,
43
+ pubDate: parseDate(pubDate.text()),
44
+ };
45
+ });
46
+
47
+ const items = await Promise.all(
48
+ list.map((item) =>
49
+ cache.tryGet(item.link, async () => {
50
+ try {
51
+ const response = await ofetch(item.link);
52
+ const $ = load(response);
53
+ item.description = $('div.wp_articlecontent').html();
54
+ } catch (error) {
55
+ if (error.response && error.response.status === 404) {
56
+ item.description = '';
57
+ } else {
58
+ throw error;
59
+ }
60
+ }
61
+ return item;
62
+ })
63
+ )
64
+ );
65
+
66
+ return {
67
+ title: '华南理工大学广州国际校区 - 媒体报道',
68
+ link: url,
69
+ item: items,
70
+ };
71
+ }
@@ -0,0 +1,65 @@
1
+ import { Route } from '@/types';
2
+ import cache from '@/utils/cache';
3
+ import got from '@/utils/got';
4
+ import { load } from 'cheerio';
5
+ import { parseDate } from '@/utils/parse-date';
6
+ import ofetch from '@/utils/ofetch';
7
+
8
+ export const route: Route = {
9
+ path: '/gzic/news',
10
+ categories: ['university'],
11
+ example: '/scut/gzic/news',
12
+ features: {
13
+ requireConfig: false,
14
+ requirePuppeteer: false,
15
+ antiCrawler: true,
16
+ supportBT: false,
17
+ supportPodcast: false,
18
+ supportScihub: false,
19
+ },
20
+ name: '广州国际校区 - 新闻聚焦',
21
+ maintainers: ['gdzhht'],
22
+ handler,
23
+ description: `:::warning
24
+ 由于学校网站对非大陆 IP 的访问存在限制,可能需自行部署。
25
+ :::`,
26
+ };
27
+
28
+ async function handler() {
29
+ const baseUrl = 'https://www2.scut.edu.cn';
30
+ const url = 'https://www2.scut.edu.cn/gzic/30279/list.htm';
31
+
32
+ const { data: response } = await got(url);
33
+ const $ = load(response);
34
+
35
+ const list = $('.right-nr .row .col-lg-4')
36
+ .toArray()
37
+ .map((item) => {
38
+ item = $(item);
39
+ const a = item.find('.li-img a');
40
+ const pubDate = item.find('.li-img a span');
41
+ return {
42
+ title: item.find('.li-img a p').text(),
43
+ link: a.attr('href')?.startsWith('http') ? a.attr('href') : `${baseUrl}${a.attr('href')}`,
44
+ pubDate: parseDate(pubDate.text().replaceAll(/年|月/g, '-').replaceAll('日', '')),
45
+ itunes_item_image: `${baseUrl}${item.find('.li-img img').attr('src')}`,
46
+ };
47
+ });
48
+
49
+ const items = await Promise.all(
50
+ list.map((item) =>
51
+ cache.tryGet(item.link, async () => {
52
+ const response = await ofetch(item.link);
53
+ const $ = load(response);
54
+ item.description = item.link.startsWith('https://mp.weixin.qq.com/') ? $('div.rich_media_content section').html() : $('div.wp_articlecontent').html();
55
+ return item;
56
+ })
57
+ )
58
+ );
59
+
60
+ return {
61
+ title: '华南理工大学广州国际校区 - 新闻聚焦',
62
+ link: url,
63
+ item: items,
64
+ };
65
+ }
@@ -0,0 +1,88 @@
1
+ import { Route } from '@/types';
2
+ import cache from '@/utils/cache';
3
+ import got from '@/utils/got';
4
+ import { load } from 'cheerio';
5
+ import { parseDate } from '@/utils/parse-date';
6
+ import ofetch from '@/utils/ofetch';
7
+
8
+ const categoryMap = {
9
+ xsyg: { title: '学术预告', tag: '30284' },
10
+ jytz: { title: '教研通知', tag: '30307' },
11
+ hwxx: { title: '海外学习', tag: 'hwxx' },
12
+ swtz: { title: '事务通知', tag: '30283' },
13
+ };
14
+
15
+ export const route: Route = {
16
+ path: '/gzic/notice/:category?',
17
+ categories: ['university'],
18
+ example: '/scut/gzic/notice/swtz',
19
+ parameters: { category: '通知分类,默认为 `swtz`' },
20
+ features: {
21
+ requireConfig: false,
22
+ requirePuppeteer: false,
23
+ antiCrawler: true,
24
+ supportBT: false,
25
+ supportPodcast: false,
26
+ supportScihub: false,
27
+ },
28
+ name: '广州国际校区 - 通知公告',
29
+ maintainers: ['gdzhht'],
30
+ handler,
31
+ description: `| 学术预告 | 教研通知 | 海外学习 | 事务通知 |
32
+ | -------- | -------- | -------- | -------- |
33
+ | xsyg | jytz | hwxx | swtz |
34
+
35
+ :::warning
36
+ 由于学校网站对非大陆 IP 的访问存在限制,可能需自行部署。
37
+ 部分通知详情页可能会被删除(返回 404),或在校园网外无法访问。
38
+ :::`,
39
+ };
40
+
41
+ async function handler(ctx) {
42
+ const baseUrl = 'https://www2.scut.edu.cn';
43
+
44
+ const categoryName = ctx.req.param('category') || 'swtz';
45
+ const categoryMeta = categoryMap[categoryName];
46
+ const url = `${baseUrl}/gzic/${categoryMeta.tag}/list.htm`;
47
+
48
+ const { data: response } = await got(url);
49
+ const $ = load(response);
50
+
51
+ const list = $('.right-nr .row .col-lg-4')
52
+ .toArray()
53
+ .map((item) => {
54
+ item = $(item);
55
+ const a = item.find('.thr-box a');
56
+ const pubDate = item.find('.thr-box a span');
57
+ return {
58
+ title: item.find('.thr-box a p').text(),
59
+ link: a.attr('href')?.startsWith('http') ? a.attr('href') : `${baseUrl}${a.attr('href')}`,
60
+ pubDate: parseDate(pubDate.text()),
61
+ };
62
+ });
63
+
64
+ const items = await Promise.all(
65
+ list.map((item) =>
66
+ cache.tryGet(item.link, async () => {
67
+ try {
68
+ const response = await ofetch(item.link);
69
+ const $ = load(response);
70
+ item.description = $('div.wp_articlecontent').html();
71
+ } catch (error) {
72
+ if (error.response && error.response.status === 404) {
73
+ item.description = '';
74
+ } else {
75
+ throw error;
76
+ }
77
+ }
78
+ return item;
79
+ })
80
+ )
81
+ );
82
+
83
+ return {
84
+ title: `华南理工大学广州国际校区 - ${categoryMeta.title}`,
85
+ link: url,
86
+ item: items,
87
+ };
88
+ }
@@ -2,44 +2,37 @@ const config = {
2
2
  bwc: { title: '武装部保卫处', id: 'tzgg' },
3
3
  career: { title: '本科就业信息网', id: 'tzgg', listSelector: 'ul.newsList', pubDateSelector: 'li.span2.y', descriptionSelector: '.aContent' },
4
4
  cyb: { title: '资产经营公司/产业办', id: '367' },
5
- dangban: { title: '党委办公室', id: '4014' },
5
+ dangban: { title: '党委办公室', id: '4013' },
6
6
  djfwzxdcs: { title: '党建服务中心/党建督查室', id: 'tzgg', listSelector: 'li.news', pubDateSelector: 'span.news_meta' },
7
7
  dqxy: { title: '电气工程学院', id: '2462' },
8
8
  dwllc: { title: '对外联络处', id: '2649' },
9
9
  dxxy: { title: '电子与信息工程学院', id: 'tzgg', pubDateSelector: 'div.article-publishdate' },
10
10
  energy: { title: '能源与机械工程学院', id: '892' },
11
- 'energy-saving': { title: '上海热交换系统节能工程技术研究中心', id: 'tzgg' },
12
- english: { title: 'Shanghai University of Electric Power', id: 'events' },
13
11
  fao: { title: '国际交流与合作处(港澳台办公室)', id: 'tzgg' },
14
- fgw: { title: '妇工委', id: '1411' },
15
12
  fzghc: { title: '发展规划处', id: '291' },
16
13
  gec: { title: '上海新能源人才技术教育交流中心', id: '1959' },
17
- gonghui: { title: '工会', id: '1806', listSelector: 'table.wp_article_list_table tr', pubDateSelector: 'td[align="right"]' },
14
+ gonghui: { title: '工会(妇工委)', id: '1806', listSelector: 'table.wp_article_list_table tr', pubDateSelector: 'td[align="right"]' },
18
15
  'green-energy': { title: '上海绿色能源并网技术研究中心', id: '118' },
19
- hhsyzx: { title: '能源化学实验教学中心', id: '3709' },
20
16
  hhxy: { title: '环境与化学工程学院', id: '5559', listSelector: 'li.list-item', pubDateSelector: 'div.item-publishdate' },
21
17
  hqglc: { title: '后勤管理处(后勤服务中心)', id: '1616' },
18
+ hsfdyjy: { title: '海上风电研究院', id: '5748' },
22
19
  ieetc: { title: '创新创业工程训练中心', id: 'cxcy', pubDateSelector: 'div.article-publishdate' },
23
20
  jgdw: { title: '机关党委', id: '3205' },
24
21
  jgxy: { title: '经济与管理学院', id: '3633' },
25
22
  jijian: { title: '纪委(监察专员办公室)', id: '59' },
26
23
  jjc: { title: '基建处', id: '327' },
27
24
  jjxy: { title: '继续教育学院(国际教育学院)', id: '2582' },
28
- jsjxfzzx: { title: '教师教学发展中心', id: '3909' },
29
25
  jsjxy: { title: '计算机科学与技术学院', id: 'xygg', listSelector: 'div.xylist', pubDateSelector: 'span:nth-child(2)' },
30
26
  jszyzx: { title: '技术转移中心', id: '4247' },
31
27
  jwc: { title: '教务处', id: '227', listSelector: 'div.text-list li', pubDateSelector: 'span.time' },
32
- jxfz: { title: '电力装备设计与制造虚拟仿真中心', id: '3330' },
33
28
  kczx: { title: '能源电力科创中心', id: '3946' },
34
29
  kyc: { title: '科研处/融合办', id: '834' },
35
30
  lgxq: { title: '临港新校区建设综合办公室', id: '377' },
36
31
  library: { title: '图书馆', id: '4866' },
37
32
  metc: { title: '现代教育技术中心/信息办', id: 'tzgg', pubDateSelector: 'div.article-publishdate' },
38
- mpep: { title: '上海市电力材料防护与新材料重点实验室', id: '1134' },
39
33
  news: { title: '新闻网', id: 'notice' },
40
34
  nydlzk: { title: '能源电力智库', id: 'tzgg' },
41
35
  office: { title: '校长办公室(档案馆)', id: '389' },
42
- rpstec: { title: '国家新能源电力系统实验教学示范中心', id: '1366' },
43
36
  rsc: { title: '党委教师工作部/人事处', id: '1695' },
44
37
  rwysxy: { title: '人文艺术学院', id: '3089', listSelector: 'li.list-item', pubDateSelector: 'div.item-publishdate' },
45
38
  sjc: { title: '审计处', id: '199' },
@@ -57,6 +50,7 @@ const config = {
57
50
  xsc: { title: '学生处', id: '3482' },
58
51
  xunchaban: { title: '巡查办', id: '5044' },
59
52
  xxgk: { title: '信息公开网', id: 'zxgkxx' },
53
+ xxjy: { title: '“学条例 守党纪”专题网', id: '5973', listSelector: 'li.list-item', pubDateSelector: 'div.item-publishdate' },
60
54
  yjsc: { title: '研究生院/研工部', id: '1161' },
61
55
  zdhxy: { title: '自动化工程学院', id: '2002' },
62
56
  zs: { title: '本科招生网', id: 'zxxx' },