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,56 @@
1
+ import { Route, ViewType } from '@/types';
2
+ import got from '@/utils/got';
3
+ import MarkdownIt from 'markdown-it';
4
+ const md = MarkdownIt({
5
+ html: true,
6
+ linkify: true,
7
+ });
8
+ import { parseDate } from '@/utils/parse-date';
9
+
10
+ export const route: Route = {
11
+ path: '/',
12
+ categories: ['other'],
13
+ view: ViewType.Notifications,
14
+ example: '/easynomad',
15
+ radar: [
16
+ {
17
+ source: ['easynomad.cn'],
18
+ },
19
+ ],
20
+ name: '远程工作列表',
21
+ maintainers: ['jiangsong216'],
22
+ handler,
23
+
24
+ features: {
25
+ requireConfig: false,
26
+ requirePuppeteer: false,
27
+ antiCrawler: false,
28
+ supportBT: false,
29
+ supportPodcast: false,
30
+ supportScihub: false,
31
+ },
32
+ };
33
+
34
+ async function handler() {
35
+ const host = 'https://easynomad.cn';
36
+ const url = 'https://easynomad.cn/api/posts/list?limit=15&page=1&jobCategory=&contractType=';
37
+ const response = await got({
38
+ method: 'get',
39
+ url,
40
+ });
41
+ const data = response.data.data;
42
+
43
+ const items = data.map((item) => ({
44
+ title: item.jobTitle,
45
+ description: item.descContent ? md.render(item.descContent) : 'No description',
46
+ pubDate: parseDate(item.jobPublishTime),
47
+ link: item.url,
48
+ }));
49
+
50
+ return {
51
+ title: '轻松游牧-远程工作聚合列表',
52
+ description: '支持国内远程的招聘列表,远程全职,远程兼职',
53
+ link: host,
54
+ item: items,
55
+ };
56
+ }
@@ -0,0 +1,6 @@
1
+ import type { Namespace } from '@/types';
2
+
3
+ export const namespace: Namespace = {
4
+ name: '轻松游牧-远程工作聚集地',
5
+ url: 'easynomad.cn',
6
+ };
@@ -26,6 +26,7 @@ export const route: Route = {
26
26
  };
27
27
 
28
28
  const allowedDomain = new Set(['mastodon.social', 'pawoo.net', config.mastodon.apiHost].filter(Boolean));
29
+ const activityPubTypes = new Set(['application/activity+json', 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"']);
29
30
 
30
31
  async function handler(ctx) {
31
32
  const account = ctx.req.param('account');
@@ -41,13 +42,17 @@ async function handler(ctx) {
41
42
 
42
43
  const requestOptions = {
43
44
  headers: {
44
- Accept: 'application/activity+json',
45
+ Accept: 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"',
45
46
  },
46
47
  };
47
48
 
48
- const acc = await ofetch(`https://${domain}/.well-known/webfinger?resource=acct:${account}`, requestOptions);
49
+ const acc = await ofetch(`https://${domain}/.well-known/webfinger?resource=acct:${account}`, {
50
+ headers: {
51
+ Accept: 'application/jrd+json',
52
+ },
53
+ });
49
54
 
50
- const jsonLink = acc.links.find((link) => link.rel === 'self')?.href;
55
+ const jsonLink = acc.links.find((link) => link.rel === 'self' && activityPubTypes.has(link.type))?.href;
51
56
  const link = acc.links.find((link) => link.rel === 'http://webfinger.net/rel/profile-page')?.href;
52
57
 
53
58
  const self = await ofetch(jsonLink, requestOptions);
@@ -57,25 +62,37 @@ async function handler(ctx) {
57
62
 
58
63
  const items = firstOutbox.orderedItems;
59
64
 
65
+ const itemResolvers = [] as Promise<any>[];
66
+
67
+ for (const item of items) {
68
+ if (!['Announce', 'Create', 'Update'].includes(item.type)) {
69
+ continue;
70
+ }
71
+ if (typeof item.object === 'string') {
72
+ itemResolvers.push(
73
+ (async (item) => {
74
+ item.object = await ofetch(item.object, requestOptions);
75
+ return item;
76
+ })(item)
77
+ );
78
+ } else {
79
+ itemResolvers.push(Promise.resolve(item));
80
+ }
81
+ }
82
+
83
+ const resolvedItems = await Promise.all(itemResolvers);
84
+
60
85
  return {
61
86
  title: `${self.name || self.preferredUsername} (Fediverse@${account})`,
62
87
  description: self.summary,
63
88
  image: self.icon?.url || self.image?.url,
64
89
  link,
65
- item: items.map((item) => {
66
- const object =
67
- typeof item.object === 'string'
68
- ? {
69
- content: item.object,
70
- }
71
- : item.object;
72
- return {
73
- title: object.content,
74
- description: `${object.content}\n${object.attachment?.map((attachment) => `<img src="${attachment.url}" width="${attachment.width}" height="${attachment.height}" />`).join('\n') || ''}`,
75
- link: item.url,
76
- pubDate: parseDate(item.published),
77
- guid: item.id,
78
- };
79
- }),
90
+ item: resolvedItems.map((item) => ({
91
+ title: item.object.content,
92
+ description: `${item.object.content}\n${item.object.attachment?.map((attachment) => `<img src="${attachment.url}" width="${attachment.width}" height="${attachment.height}" />`).join('\n') || ''}`,
93
+ link: item.object.url,
94
+ pubDate: parseDate(item.published),
95
+ guid: item.id,
96
+ })),
80
97
  };
81
98
  }
@@ -0,0 +1,61 @@
1
+ import { Route, Data } from '@/types';
2
+ import ofetch from '@/utils/ofetch';
3
+ import { load } from 'cheerio';
4
+ import { parseDate } from '@/utils/parse-date';
5
+
6
+ export const route: Route = {
7
+ path: '/blog',
8
+ categories: ['blog'],
9
+ example: '/flashcat/blog',
10
+ parameters: {},
11
+ features: {
12
+ requireConfig: false,
13
+ requirePuppeteer: false,
14
+ antiCrawler: false,
15
+ supportBT: false,
16
+ supportPodcast: false,
17
+ supportScihub: false,
18
+ },
19
+ radar: [
20
+ {
21
+ source: ['flashcat.cloud/blog'],
22
+ target: '/blog',
23
+ },
24
+ ],
25
+ name: '快猫星云博客',
26
+ maintainers: ['chesha1'],
27
+ handler: handlerRoute,
28
+ };
29
+
30
+ async function handlerRoute(): Promise<Data> {
31
+ const response = await ofetch('https://flashcat.cloud/blog/');
32
+ const $ = load(response);
33
+
34
+ const items = $('.post-preview')
35
+ .toArray()
36
+ .map((elem) => {
37
+ const $elem = $(elem);
38
+ return {
39
+ title: $elem.find('.post-title').text(),
40
+ description: $elem.find('.post-content-preview').text(),
41
+ link: $elem.find('a').attr('href'),
42
+ pubDate: parseDate(
43
+ $elem
44
+ .find('.post-meta')
45
+ .text()
46
+ .match(/on\s+(\w+,\s+\w+\s+\d{1,2},\s+\d{4})/)?.[1] || ''
47
+ ),
48
+ author:
49
+ $elem
50
+ .find('.post-meta')
51
+ .text()
52
+ .match(/by\s+(.+?)\s+on/)?.[1] || '',
53
+ };
54
+ });
55
+
56
+ return {
57
+ title: 'Flashcat 快猫星云博客',
58
+ link: 'https://flashcat.cloud/blog/',
59
+ item: items,
60
+ };
61
+ }
@@ -0,0 +1,6 @@
1
+ import type { Namespace } from '@/types';
2
+
3
+ export const namespace: Namespace = {
4
+ name: 'Flashcat',
5
+ url: 'flashcat.cloud',
6
+ };
@@ -0,0 +1,6 @@
1
+ import type { Namespace } from '@/types';
2
+
3
+ export const namespace: Namespace = {
4
+ name: 'Follow',
5
+ url: 'app.follow.is',
6
+ };
@@ -0,0 +1,69 @@
1
+ import { ViewType, type Data, type Route } from '@/types';
2
+ import type { Context } from 'hono';
3
+ import ofetch from '@/utils/ofetch';
4
+ import type { FollowResponse, Profile, Subscription } from './types';
5
+ import { parse } from 'tldts';
6
+
7
+ export const route: Route = {
8
+ name: 'User subscriptions',
9
+ categories: ['social-media'],
10
+ path: '/profile/:uid',
11
+ example: '/follow/profile/41279032429549568',
12
+ parameters: {
13
+ uid: 'User ID or user handle',
14
+ },
15
+ radar: [
16
+ {
17
+ source: ['app.follow.is/profile/:uid'],
18
+ target: '/profile/:uid',
19
+ },
20
+ ],
21
+ handler,
22
+ maintainers: ['KarasuShin', 'DIYgod'],
23
+ features: {
24
+ supportRadar: true,
25
+ },
26
+ view: ViewType.Notifications,
27
+ };
28
+
29
+ async function handler(ctx: Context): Promise<Data> {
30
+ const uid = ctx.req.param('uid');
31
+ const host = 'https://api.follow.is';
32
+
33
+ const profile = await ofetch<FollowResponse<Profile>>(`${host}/profiles?id=${uid}`);
34
+ const subscriptions = await ofetch<FollowResponse<Subscription[]>>(`${host}/subscriptions?userId=${profile.data.id}`);
35
+
36
+ return {
37
+ title: `${profile.data.name}'s subscriptions`,
38
+ item: subscriptions.data.map((subscription) => ({
39
+ title: subscription.feeds.title,
40
+ description: subscription.feeds.description,
41
+ link: `https://app.follow.is/feed/${subscription.feedId}`,
42
+ image: getUrlIcon(subscription.feeds.siteUrl).src,
43
+ category: [subscription.category],
44
+ })),
45
+ link: `https://app.follow.is/profile/${uid}`,
46
+ image: profile.data.image,
47
+ };
48
+ }
49
+
50
+ const getUrlIcon = (url: string, fallback?: boolean | undefined) => {
51
+ let src: string;
52
+ let fallbackUrl = '';
53
+
54
+ try {
55
+ const { host } = new URL(url);
56
+ const pureDomain = parse(host).domainWithoutSuffix;
57
+ fallbackUrl = `https://avatar.vercel.sh/${pureDomain}.svg?text=${pureDomain?.slice(0, 2).toUpperCase()}`;
58
+ src = `https://unavatar.follow.is/${host}?fallback=${fallback || false}`;
59
+ } catch {
60
+ const pureDomain = parse(url).domainWithoutSuffix;
61
+ src = `https://avatar.vercel.sh/${pureDomain}.svg?text=${pureDomain?.slice(0, 2).toUpperCase()}`;
62
+ }
63
+ const ret = {
64
+ src,
65
+ fallbackUrl,
66
+ };
67
+
68
+ return ret;
69
+ };
@@ -0,0 +1,38 @@
1
+ export interface FollowResponse<T> {
2
+ code: number;
3
+ data: T;
4
+ }
5
+
6
+ export interface Subscription {
7
+ category: string;
8
+ feedId: string;
9
+ feeds: {
10
+ checkAt: string;
11
+ description: string;
12
+ errorAt: unknown;
13
+ errorMessage: unknown;
14
+ etagHeader: string;
15
+ id: string;
16
+ image: unknown;
17
+ lastModifiedHeader: string;
18
+ ownerUserId: string | null;
19
+ siteUrl: string;
20
+ title: string;
21
+ ttl: number;
22
+ url: string;
23
+ };
24
+ isPrivate: boolean;
25
+ title: string | null;
26
+ userId: string;
27
+ view: number;
28
+ }
29
+
30
+ export interface Profile {
31
+ id: string;
32
+ name: string;
33
+ email: string;
34
+ emailVerified: unknown;
35
+ image: string;
36
+ handle: unknown;
37
+ createdAt: string;
38
+ }
@@ -0,0 +1,60 @@
1
+ import { Route } from '@/types';
2
+
3
+ import { load } from 'cheerio';
4
+ import { parseDate } from '@/utils/parse-date';
5
+ import cache from '@/utils/cache';
6
+ import ofetch from '@/utils/ofetch';
7
+
8
+ export const route: Route = {
9
+ path: '/',
10
+ categories: ['new-media'],
11
+ example: '/ftm',
12
+ parameters: {},
13
+ name: '文章',
14
+ maintainers: ['dzx-dzx'],
15
+ radar: [
16
+ {
17
+ source: ['www.ftm.eu'],
18
+ },
19
+ ],
20
+ handler,
21
+ };
22
+
23
+ async function handler(ctx) {
24
+ const rootUrl = 'https://www.ftm.eu';
25
+ const currentUrl = `${rootUrl}/articles`;
26
+ const response = await ofetch(currentUrl);
27
+
28
+ const $ = load(response);
29
+
30
+ const list = $('.article-card')
31
+ .toArray()
32
+ .map((e) => ({ link: $(e).attr('href'), title: $(e).find('h2').text() }))
33
+ .slice(0, ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : Infinity);
34
+
35
+ const items = await Promise.all(
36
+ list.map((item) =>
37
+ cache.tryGet(item.link, async () => {
38
+ const content = load(await ofetch(item.link));
39
+ const ldjson = JSON.parse(content('[type="application/ld+json"]:not([data-schema])').text());
40
+
41
+ item.pubDate = parseDate(ldjson.datePublished);
42
+ item.updated = parseDate(ldjson.dateModified);
43
+
44
+ item.author = content("[name='author']")
45
+ .toArray()
46
+ .map((e) => ({ name: $(e).attr('content') }));
47
+ item.category = content('.collection .tab').text().trim() || null;
48
+
49
+ item.description = content('.body').html();
50
+
51
+ return item;
52
+ })
53
+ )
54
+ );
55
+ return {
56
+ title: $('title').text(),
57
+ link: currentUrl,
58
+ item: items,
59
+ };
60
+ }
@@ -0,0 +1,6 @@
1
+ import type { Namespace } from '@/types';
2
+
3
+ export const namespace: Namespace = {
4
+ name: 'Follow The Money',
5
+ url: 'www.ftm.eu',
6
+ };
@@ -0,0 +1,94 @@
1
+ import { Route } from '@/types';
2
+ import { parseDate } from '@/utils/parse-date';
3
+ import ofetch from '@/utils/ofetch';
4
+
5
+ export const route: Route = {
6
+ path: '/quest/:alias',
7
+ name: 'Quest',
8
+ url: 'app.galxe.com',
9
+ maintainers: ['cxheng315'],
10
+ example: '/galxe/quest/MissionWeb3',
11
+ categories: ['other'],
12
+ features: {
13
+ requireConfig: false,
14
+ requirePuppeteer: false,
15
+ antiCrawler: false,
16
+ supportBT: false,
17
+ supportPodcast: false,
18
+ supportScihub: false,
19
+ },
20
+ radar: [
21
+ {
22
+ source: ['app.galxe.com/quest/:alias'],
23
+ target: '/quest/:alias',
24
+ },
25
+ ],
26
+ handler,
27
+ };
28
+
29
+ async function handler(ctx) {
30
+ const url = 'https://graphigo.prd.galaxy.eco/query';
31
+
32
+ const alias = ctx.req.param('alias');
33
+
34
+ const response = await ofetch(url, {
35
+ method: 'POST',
36
+ headers: {
37
+ 'Content-Type': 'application/json',
38
+ },
39
+ body: {
40
+ variables: {
41
+ alias,
42
+ campaignInput: {
43
+ first: ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 50,
44
+ excludeChildren: true,
45
+ listType: 'Newest',
46
+ },
47
+ },
48
+ query: `
49
+ query BrowseSpaceCampaigns($id: Int, $alias: String, $campaignInput: ListCampaignInput!) {
50
+ space(id: $id, alias: $alias) {
51
+ id
52
+ name
53
+ alias
54
+ info
55
+ campaigns(input: $campaignInput) {
56
+ list {
57
+ startTime
58
+ endTime
59
+ id
60
+ name
61
+ description
62
+ __typename
63
+ }
64
+ pageInfo {
65
+ endCursor
66
+ hasNextPage
67
+ __typename
68
+ }
69
+ __typename
70
+ }
71
+ __typename
72
+ }
73
+ }
74
+ `,
75
+ },
76
+ });
77
+
78
+ const space = response.data.space;
79
+
80
+ const items = space.campaigns.list.map((campaign) => ({
81
+ title: campaign.name,
82
+ link: `https://app.galxe.com/quest/${alias}/${campaign.id}`,
83
+ description: campaign.description,
84
+ pubDate: campaign.startTime ? parseDate(campaign.startTime * 1000) : null,
85
+ }));
86
+
87
+ return {
88
+ title: space.name,
89
+ description: space.info,
90
+ link: `https://app.galxe.com/quest/${alias}`,
91
+ item: items,
92
+ author: space.alias,
93
+ };
94
+ }
@@ -0,0 +1,9 @@
1
+ import type { Namespace } from '@/types';
2
+
3
+ export const namespace: Namespace = {
4
+ name: 'Galxe',
5
+ url: 'app.galxe.com',
6
+ zh: {
7
+ name: '銀河',
8
+ },
9
+ };
@@ -0,0 +1,57 @@
1
+ import type { Route } from '@/types';
2
+ import type { Context } from 'hono';
3
+ import { getArticleList, parseArticleList, getArticle, mdTableBuilder } from './utils';
4
+
5
+ const idNameMap = new Map([
6
+ ['all', { title: '热点图文', suffix: 'ent', nodeId: '20107' }],
7
+ ['qw', { title: '趣囧时间', suffix: 'ent/qw', nodeId: '20113' }],
8
+ ['movie', { title: '游民影院', suffix: 'wenku/movie', nodeId: '20111' }],
9
+ ['discovery', { title: '游观天下', suffix: 'ent/discovery', nodeId: '20114' }],
10
+ ['wp', { title: '壁纸图库', suffix: 'ent/wp', nodeId: '20117' }],
11
+ ['wenku', { title: '游民盘点', suffix: 'wenku', nodeId: '20106' }],
12
+ ['xz', { title: '游民福利', suffix: 'ent/xz', nodeId: '20119' }],
13
+ ]);
14
+
15
+ export const route: Route = {
16
+ path: '/ent/:category?',
17
+ categories: ['game'],
18
+ example: '/gamersky/ent/xz',
19
+ parameters: {
20
+ type: '分类类型,留空为 `all`',
21
+ },
22
+ features: {
23
+ requireConfig: false,
24
+ requirePuppeteer: false,
25
+ antiCrawler: false,
26
+ supportBT: false,
27
+ supportPodcast: false,
28
+ supportScihub: false,
29
+ },
30
+ radar: Object.entries(idNameMap).map(([type, { title, suffix }]) => ({
31
+ title,
32
+ source: [`www.gamersky.com/${suffix}`],
33
+ target: `/ent/${type}`,
34
+ })),
35
+ name: '娱乐',
36
+ maintainers: ['LogicJake'],
37
+ description: mdTableBuilder(Object.entries(idNameMap).map(([type, { title, nodeId }]) => ({ type, name: title, nodeId }))),
38
+ handler,
39
+ };
40
+
41
+ async function handler(ctx: Context) {
42
+ const category = ctx.req.param('category') ?? 'all';
43
+
44
+ const idName = idNameMap.get(category);
45
+ if (!idName) {
46
+ throw new Error(`Invalid type: ${category}`);
47
+ }
48
+
49
+ const response = await getArticleList(idName.nodeId);
50
+ const list = parseArticleList(response);
51
+ const fullTextList = await Promise.all(list.map((item) => getArticle(item)));
52
+ return {
53
+ title: `${idName.title} - 游民娱乐`,
54
+ link: `https://www.gamersky.com/${idName.suffix}`,
55
+ item: fullTextList,
56
+ };
57
+ }
@@ -0,0 +1,10 @@
1
+ import type { Namespace } from '@/types';
2
+
3
+ export const namespace: Namespace = {
4
+ name: 'GamerSky',
5
+ url: 'gamersky.com',
6
+
7
+ zh: {
8
+ name: '游民星空',
9
+ },
10
+ };
@@ -0,0 +1,91 @@
1
+ import type { Route } from '@/types';
2
+ import type { Context } from 'hono';
3
+ import { getArticleList, parseArticleList, getArticle, mdTableBuilder } from './utils';
4
+
5
+ const idNameMap = [
6
+ {
7
+ type: 'today',
8
+ name: '今日推荐',
9
+ nodeId: '11007',
10
+ },
11
+ {
12
+ name: '单机电玩',
13
+ type: 'pc',
14
+ nodeId: '129',
15
+ },
16
+ {
17
+ name: 'NS',
18
+ type: 'ns',
19
+ nodeId: '21160',
20
+ },
21
+ {
22
+ name: '手游',
23
+ type: 'mobile',
24
+ nodeId: '20260',
25
+ },
26
+ {
27
+ name: '网游',
28
+ type: 'web',
29
+ nodeId: '20225',
30
+ },
31
+ {
32
+ name: '业界',
33
+ type: 'industry',
34
+ nodeId: '21163',
35
+ },
36
+ {
37
+ name: '硬件',
38
+ type: 'hardware',
39
+ nodeId: '20070',
40
+ },
41
+ {
42
+ name: '科技',
43
+ type: 'tech',
44
+ nodeId: '20547',
45
+ },
46
+ ];
47
+
48
+ export const route: Route = {
49
+ path: '/news/:type?',
50
+ categories: ['game'],
51
+ example: '/gamersky/news/pc',
52
+ parameters: {
53
+ type: '资讯类型,见表,默认为 `pc`',
54
+ },
55
+ features: {
56
+ requireConfig: false,
57
+ requirePuppeteer: false,
58
+ antiCrawler: false,
59
+ supportBT: false,
60
+ supportPodcast: false,
61
+ supportScihub: false,
62
+ },
63
+ radar: [
64
+ {
65
+ source: ['www.gamersky.com/news'],
66
+ target: '/news',
67
+ },
68
+ ],
69
+ name: '资讯',
70
+ maintainers: ['yy4382'],
71
+ description: mdTableBuilder(idNameMap),
72
+ handler,
73
+ };
74
+
75
+ async function handler(ctx: Context) {
76
+ const type = ctx.req.param('type') ?? 'pc';
77
+
78
+ const idName = idNameMap.find((item) => item.type === type);
79
+ if (!idName) {
80
+ throw new Error(`Invalid type: ${type}`);
81
+ }
82
+
83
+ const response = await getArticleList(idName.nodeId);
84
+ const list = parseArticleList(response);
85
+ const fullTextList = await Promise.all(list.map((item) => getArticle(item)));
86
+ return {
87
+ title: `${idName.name} - 游民星空`,
88
+ link: 'https://www.gamersky.com/news',
89
+ item: fullTextList,
90
+ };
91
+ }