rsshub 1.0.0-master.c034cfb → 1.0.0-master.c06353f

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 (454) hide show
  1. package/README.md +3 -3
  2. package/lib/config.js +28 -10
  3. package/lib/maintainer.js +7 -2
  4. package/lib/middleware/access-control.js +5 -5
  5. package/lib/middleware/parameter.js +66 -11
  6. package/lib/middleware/template.js +79 -85
  7. package/lib/router.js +20 -20
  8. package/lib/routes/index.js +6 -13
  9. package/lib/routes/universities/ynnu/edu/news.js +3 -3
  10. package/lib/utils/rand-user-agent.js +2 -1
  11. package/lib/utils/render.js +2 -0
  12. package/lib/v2/2048/index.js +18 -13
  13. package/lib/v2/95mm/utils.js +3 -2
  14. package/lib/v2/abc/index.js +162 -0
  15. package/lib/v2/abc/maintainer.js +3 -0
  16. package/lib/v2/abc/radar.js +13 -0
  17. package/lib/v2/abc/router.js +3 -0
  18. package/lib/v2/abc/templates/description.art +21 -0
  19. package/lib/v2/aliyun/notice.js +1 -1
  20. package/lib/v2/aljazeera/index.js +1 -1
  21. package/lib/v2/apnews/topics.js +1 -0
  22. package/lib/v2/apple/apps.js +88 -17
  23. package/lib/v2/apple/maintainer.js +1 -1
  24. package/lib/v2/apple/radar.js +3 -3
  25. package/lib/v2/apple/router.js +1 -1
  26. package/lib/v2/asiantolick/index.js +73 -27
  27. package/lib/v2/asiantolick/maintainer.js +5 -3
  28. package/lib/v2/asiantolick/radar.js +34 -12
  29. package/lib/v2/asiantolick/router.js +2 -2
  30. package/lib/v2/asiantolick/templates/description.art +9 -3
  31. package/lib/v2/bangumi/maintainer.js +2 -0
  32. package/lib/v2/bangumi/radar.js +12 -0
  33. package/lib/v2/bangumi/router.js +2 -0
  34. package/lib/v2/bangumi/tv/other/followrank.js +42 -0
  35. package/lib/v2/bangumi/tv/user/wish.js +38 -0
  36. package/lib/v2/bilibili/cache.js +10 -7
  37. package/lib/v2/bilibili/fav.js +2 -0
  38. package/lib/v2/bilibili/maintainer.js +1 -0
  39. package/lib/v2/bilibili/platform.js +43 -0
  40. package/lib/v2/bilibili/radar.js +8 -0
  41. package/lib/v2/bilibili/router.js +1 -0
  42. package/lib/v2/bilibili/userFav.js +2 -0
  43. package/lib/v2/bilibili/video.js +8 -1
  44. package/lib/v2/bnu/dwxgb.js +17 -22
  45. package/lib/v2/booru/maintainer.js +3 -0
  46. package/lib/v2/booru/mmda.js +47 -0
  47. package/lib/v2/booru/radar.js +12 -0
  48. package/lib/v2/booru/router.js +3 -0
  49. package/lib/v2/bossdesign/index.js +41 -0
  50. package/lib/v2/bossdesign/maintainer.js +3 -0
  51. package/lib/v2/bossdesign/radar.js +13 -0
  52. package/lib/v2/bossdesign/router.js +3 -0
  53. package/lib/v2/brave/latest.js +4 -2
  54. package/lib/v2/buaa/maintainer.js +4 -0
  55. package/lib/v2/buaa/news/index.js +46 -0
  56. package/lib/v2/buaa/radar.js +21 -0
  57. package/lib/v2/buaa/router.js +4 -0
  58. package/lib/v2/buaa/sme.js +59 -0
  59. package/lib/v2/bytes/maintainer.js +0 -1
  60. package/lib/v2/caixin/blog.js +68 -45
  61. package/lib/v2/caixin/router.js +1 -1
  62. package/lib/v2/caixinglobal/latest.js +64 -0
  63. package/lib/v2/caixinglobal/maintainer.js +3 -0
  64. package/lib/v2/caixinglobal/radar.js +13 -0
  65. package/lib/v2/caixinglobal/router.js +3 -0
  66. package/lib/v2/cbc/topics.js +3 -1
  67. package/lib/v2/china/finance/finance.js +61 -0
  68. package/lib/v2/china/maintainer.js +1 -0
  69. package/lib/v2/china/news/military/news.js +5 -6
  70. package/lib/v2/china/radar.js +9 -0
  71. package/lib/v2/china/router.js +1 -0
  72. package/lib/v2/chinafactcheck/index.js +20 -21
  73. package/lib/v2/chinafactcheck/utils.js +16 -16
  74. package/lib/v2/chinaisa/index.js +83 -0
  75. package/lib/v2/chinaisa/maintainer.js +3 -0
  76. package/lib/v2/chinaisa/radar.js +18 -0
  77. package/lib/v2/chinaisa/router.js +3 -0
  78. package/lib/v2/cma/channel.js +87 -0
  79. package/lib/v2/cma/maintainer.js +3 -0
  80. package/lib/v2/cma/radar.js +18 -0
  81. package/lib/v2/cma/router.js +3 -0
  82. package/lib/v2/cma/templates/description.art +13 -0
  83. package/lib/v2/cmpxchg8b/articles.js +43 -0
  84. package/lib/v2/cmpxchg8b/maintainer.js +3 -0
  85. package/lib/v2/cmpxchg8b/radar.js +13 -0
  86. package/lib/v2/cmpxchg8b/router.js +3 -0
  87. package/lib/v2/cna/index.js +1 -0
  88. package/lib/v2/cna/maintainer.js +1 -0
  89. package/lib/v2/cna/radar.js +6 -0
  90. package/lib/v2/cna/router.js +1 -0
  91. package/lib/v2/cna/web/index.js +62 -0
  92. package/lib/v2/cnbeta/type.js +15 -9
  93. package/lib/v2/cnbeta/utils.js +3 -0
  94. package/lib/v2/cqwu/index.js +11 -8
  95. package/lib/v2/cqwu/radar.js +2 -2
  96. package/lib/v2/creative-comic/book.js +40 -34
  97. package/lib/v2/creative-comic/utils.js +1 -2
  98. package/lib/v2/cyzone/maintainer.js +1 -1
  99. package/lib/v2/deadline/maintainer.js +0 -1
  100. package/lib/v2/dlsite/ci-en/article.js +1 -1
  101. package/lib/v2/dongqiudi/special.js +13 -21
  102. package/lib/v2/dongqiudi/utils.js +26 -2
  103. package/lib/v2/douban/maintainer.js +4 -2
  104. package/lib/v2/douban/other/discussion.js +58 -0
  105. package/lib/v2/douban/other/doulist.js +9 -7
  106. package/lib/v2/douban/other/list.js +28 -19
  107. package/lib/v2/douban/other/recommended.js +68 -0
  108. package/lib/v2/douban/people/status.js +1 -1
  109. package/lib/v2/douban/radar.js +8 -0
  110. package/lib/v2/douban/router.js +3 -1
  111. package/lib/v2/egsea/flash.js +30 -0
  112. package/lib/v2/egsea/maintainer.js +3 -0
  113. package/lib/v2/egsea/radar.js +13 -0
  114. package/lib/v2/egsea/router.js +3 -0
  115. package/lib/v2/ehentai/ehapi.js +3 -1
  116. package/lib/v2/epicgames/index.js +18 -11
  117. package/lib/v2/epicgames/templates/description.art +1 -0
  118. package/lib/v2/farmatters/index.js +85 -0
  119. package/lib/v2/farmatters/maintainer.js +7 -0
  120. package/lib/v2/farmatters/radar.js +36 -0
  121. package/lib/v2/farmatters/router.js +6 -0
  122. package/lib/v2/farmatters/templates/description.art +9 -0
  123. package/lib/{routes → v2}/firefox/addons.js +3 -1
  124. package/lib/v2/firefox/breaches.js +38 -0
  125. package/lib/v2/firefox/maintainer.js +2 -0
  126. package/lib/v2/firefox/radar.js +17 -0
  127. package/lib/{routes → v2}/firefox/release.js +3 -3
  128. package/lib/v2/firefox/router.js +3 -1
  129. package/lib/v2/foresightnews/maintainer.js +0 -1
  130. package/lib/v2/fuliba/latest.js +25 -0
  131. package/lib/v2/fuliba/maintainer.js +3 -0
  132. package/lib/v2/fuliba/radar.js +15 -0
  133. package/lib/v2/fuliba/router.js +3 -0
  134. package/lib/v2/gcores/category.js +1 -0
  135. package/lib/v2/gcores/radio.js +1 -0
  136. package/lib/v2/gdsrx/index.js +72 -0
  137. package/lib/v2/gdsrx/maintainer.js +3 -0
  138. package/lib/v2/gdsrx/radar.js +61 -0
  139. package/lib/v2/gdsrx/router.js +3 -0
  140. package/lib/v2/getitfree/index.js +42 -34
  141. package/lib/v2/getitfree/maintainer.js +3 -1
  142. package/lib/v2/getitfree/radar.js +19 -2
  143. package/lib/v2/getitfree/router.js +10 -2
  144. package/lib/v2/getitfree/util.js +326 -0
  145. package/lib/v2/github/topic.js +26 -10
  146. package/lib/v2/gocn/jobs.js +14 -9
  147. package/lib/v2/gocn/maintainer.js +3 -1
  148. package/lib/v2/gocn/news.js +31 -0
  149. package/lib/v2/gocn/radar.js +8 -2
  150. package/lib/v2/gocn/router.js +3 -1
  151. package/lib/v2/gocn/topics.js +15 -7
  152. package/lib/v2/gocn/utils.js +38 -0
  153. package/lib/v2/gogoanimehd/radar.js +1 -1
  154. package/lib/v2/gogoanimehd/recent-releases.js +1 -1
  155. package/lib/v2/google/alerts.js +33 -0
  156. package/lib/v2/google/maintainer.js +1 -0
  157. package/lib/v2/google/router.js +1 -0
  158. package/lib/v2/gov/forestry/gjlckjdjt.js +96 -0
  159. package/lib/v2/gov/forestry/templates/description.art +15 -0
  160. package/lib/v2/gov/maintainer.js +12 -3
  161. package/lib/v2/gov/mem/sgcc.js +64 -0
  162. package/lib/v2/gov/moa/zdscxx.js +104 -0
  163. package/lib/v2/gov/mot/index.js +66 -0
  164. package/lib/v2/gov/nifdc/index.js +40 -33
  165. package/lib/v2/gov/npc/index.js +47 -0
  166. package/lib/v2/gov/radar.js +290 -2
  167. package/lib/v2/gov/router.js +12 -2
  168. package/lib/v2/gov/samr/templates/description.art +26 -0
  169. package/lib/v2/gov/samr/xgzlyhd.js +100 -0
  170. package/lib/v2/gov/zhejiang/gwy.js +84 -0
  171. package/lib/v2/gov/zhengce/index.js +99 -0
  172. package/lib/v2/greasyfork/maintainer.js +1 -0
  173. package/lib/v2/greasyfork/router.js +1 -0
  174. package/lib/v2/greasyfork/scripts.js +25 -20
  175. package/lib/v2/grubstreet/maintainer.js +3 -0
  176. package/lib/v2/grubstreet/radar.js +13 -0
  177. package/lib/v2/grubstreet/router.js +3 -0
  178. package/lib/v2/grubstreet/utils.js +84 -0
  179. package/lib/v2/guangdiu/maintainer.js +1 -0
  180. package/lib/v2/guangdiu/radar.js +6 -0
  181. package/lib/v2/guangdiu/router.js +1 -0
  182. package/lib/v2/guangdiu/search.js +40 -0
  183. package/lib/v2/guanhai/maintainer.js +0 -1
  184. package/lib/{routes/universities → v2}/harvard/health/blog.js +8 -7
  185. package/lib/v2/harvard/maintainer.js +3 -0
  186. package/lib/v2/harvard/radar.js +13 -0
  187. package/lib/v2/harvard/router.js +3 -0
  188. package/lib/v2/hebtv/maintainer.js +3 -0
  189. package/lib/v2/hebtv/nong-bo-shi-zai-xing-dong.js +109 -0
  190. package/lib/v2/hebtv/radar.js +13 -0
  191. package/lib/v2/hebtv/router.js +3 -0
  192. package/lib/v2/hebtv/templates/description.art +24 -0
  193. package/lib/v2/hostmonit/cloudflareyes.js +91 -0
  194. package/lib/v2/hostmonit/maintainer.js +3 -0
  195. package/lib/v2/hostmonit/radar.js +17 -0
  196. package/lib/v2/hostmonit/router.js +8 -0
  197. package/lib/v2/hostmonit/templates/description.art +28 -0
  198. package/lib/v2/hostmonit/templates/title.art +1 -0
  199. package/lib/v2/ianspriggs/index.js +90 -0
  200. package/lib/v2/ianspriggs/maintainer.js +3 -0
  201. package/lib/v2/ianspriggs/radar.js +17 -0
  202. package/lib/v2/ianspriggs/router.js +3 -0
  203. package/lib/v2/ianspriggs/templates/description.art +13 -0
  204. package/lib/v2/instagram/templates/images.art +8 -2
  205. package/lib/v2/instagram/templates/video.art +4 -1
  206. package/lib/v2/instagram/web-api/index.js +21 -11
  207. package/lib/v2/instagram/web-api/utils.js +86 -15
  208. package/lib/v2/iqilu/maintainer.js +3 -0
  209. package/lib/v2/iqilu/program.js +98 -0
  210. package/lib/v2/iqilu/radar.js +107 -0
  211. package/lib/v2/iqilu/router.js +3 -0
  212. package/lib/v2/iqilu/templates/description.art +24 -0
  213. package/lib/v2/javbus/index.js +6 -0
  214. package/lib/v2/javlibrary/maintainer.js +1 -0
  215. package/lib/v2/javlibrary/maker.js +10 -0
  216. package/lib/v2/javlibrary/router.js +1 -0
  217. package/lib/v2/javlibrary/utils.js +1 -0
  218. package/lib/v2/kamen-rider-official/news.js +1 -1
  219. package/lib/v2/kemono/index.js +28 -4
  220. package/lib/v2/kemono/radar.js +1 -1
  221. package/lib/v2/leetcode/articles.js +14 -10
  222. package/lib/v2/leetcode/dailyquestion-solution-cn.js +6 -3
  223. package/lib/v2/leetcode/dailyquestion-solution-en.js +7 -4
  224. package/lib/v2/liquipedia/cs_matches.js +52 -0
  225. package/lib/v2/liquipedia/dota2_matches.js +47 -0
  226. package/lib/v2/liquipedia/maintainer.js +4 -0
  227. package/lib/v2/liquipedia/radar.js +19 -0
  228. package/lib/v2/liquipedia/router.js +4 -0
  229. package/lib/v2/logclub/index.js +134 -0
  230. package/lib/v2/logclub/maintainer.js +9 -0
  231. package/lib/v2/logclub/radar.js +139 -0
  232. package/lib/v2/logclub/report.js +98 -0
  233. package/lib/v2/logclub/router.js +5 -0
  234. package/lib/v2/logclub/templates/description.art +33 -0
  235. package/lib/v2/metacritic/index.js +121 -0
  236. package/lib/v2/metacritic/maintainer.js +5 -0
  237. package/lib/v2/metacritic/radar.js +43 -0
  238. package/lib/v2/metacritic/router.js +3 -0
  239. package/lib/v2/metacritic/templates/description.art +19 -0
  240. package/lib/v2/metacritic/util.js +42 -0
  241. package/lib/v2/mittrchina/index.js +104 -0
  242. package/lib/v2/mittrchina/maintainer.js +3 -0
  243. package/lib/v2/mittrchina/radar.js +31 -0
  244. package/lib/v2/mittrchina/router.js +3 -0
  245. package/lib/v2/mittrchina/templates/movie.art +5 -0
  246. package/lib/v2/modb/maintainer.js +3 -0
  247. package/lib/v2/modb/radar.js +13 -0
  248. package/lib/v2/modb/router.js +3 -0
  249. package/lib/v2/modb/topic.js +59 -0
  250. package/lib/v2/mymusicsheet/maintainer.js +3 -0
  251. package/lib/v2/mymusicsheet/radar.js +13 -0
  252. package/lib/v2/mymusicsheet/router.js +3 -0
  253. package/lib/v2/mymusicsheet/templates/description.art +41 -0
  254. package/lib/v2/mymusicsheet/usersheets.js +120 -0
  255. package/lib/v2/nature/cover.js +32 -42
  256. package/lib/v2/nature/highlight.js +2 -2
  257. package/lib/v2/nature/news-and-comment.js +2 -2
  258. package/lib/v2/nature/news.js +2 -2
  259. package/lib/v2/nature/research.js +2 -2
  260. package/lib/v2/nature/siteindex.js +5 -5
  261. package/lib/v2/nature/utils.js +124 -5
  262. package/lib/v2/nbd/index.js +4 -1
  263. package/lib/v2/nbd/maintainer.js +1 -1
  264. package/lib/v2/nbd/radar.js +3 -3
  265. package/lib/v2/nbd/router.js +1 -1
  266. package/lib/v2/netflav/index.js +39 -0
  267. package/lib/v2/netflav/maintainer.js +3 -0
  268. package/lib/v2/netflav/radar.js +13 -0
  269. package/lib/v2/netflav/router.js +3 -0
  270. package/lib/v2/netflav/templates/description.art +8 -0
  271. package/lib/v2/niaogebiji/maintainer.js +0 -1
  272. package/lib/v2/npr/radar.js +2 -2
  273. package/lib/v2/oschina/news.js +1 -0
  274. package/lib/v2/ouc/it-tx.js +44 -0
  275. package/lib/v2/ouc/it.js +2 -2
  276. package/lib/v2/ouc/maintainer.js +2 -1
  277. package/lib/v2/ouc/radar.js +6 -0
  278. package/lib/v2/ouc/router.js +1 -0
  279. package/lib/v2/paulgraham/article.js +62 -0
  280. package/lib/v2/paulgraham/maintainer.js +3 -0
  281. package/lib/v2/paulgraham/radar.js +13 -0
  282. package/lib/v2/paulgraham/router.js +5 -0
  283. package/lib/v2/people/index.js +15 -24
  284. package/lib/v2/people/router.js +1 -2
  285. package/lib/v2/pixiv/ranking.js +1 -0
  286. package/lib/v2/pixiv/user.js +2 -1
  287. package/lib/v2/pixiv/utils.js +2 -2
  288. package/lib/v2/pku/cls/announcement.js +42 -0
  289. package/lib/v2/pku/maintainer.js +1 -0
  290. package/lib/v2/pku/radar.js +6 -0
  291. package/lib/v2/pku/router.js +1 -0
  292. package/lib/v2/qbitai/category.js +27 -0
  293. package/lib/v2/qbitai/maintainer.js +4 -0
  294. package/lib/v2/qbitai/radar.js +19 -0
  295. package/lib/v2/qbitai/router.js +4 -0
  296. package/lib/v2/qbitai/tag.js +27 -0
  297. package/lib/v2/qqorw/maintainer.js +1 -1
  298. package/lib/v2/reactnewsletter/maintainer.js +0 -1
  299. package/lib/v2/readhub/index.js +92 -83
  300. package/lib/v2/readhub/maintainer.js +1 -1
  301. package/lib/v2/readhub/radar.js +6 -2
  302. package/lib/v2/readhub/router.js +1 -4
  303. package/lib/v2/readhub/templates/description.art +40 -0
  304. package/lib/v2/reuters/common.js +19 -6
  305. package/lib/v2/reuters/maintainer.js +0 -2
  306. package/lib/v2/reuters/router.js +0 -2
  307. package/lib/v2/rfi/maintainer.js +1 -1
  308. package/lib/v2/rfi/news.js +35 -22
  309. package/lib/v2/rfi/radar.js +5 -5
  310. package/lib/v2/rfi/router.js +1 -1
  311. package/lib/v2/runtrail/maintainer.js +0 -1
  312. package/lib/v2/scau/maintainer.js +1 -0
  313. package/lib/v2/scau/radar.js +8 -0
  314. package/lib/v2/scau/router.js +1 -0
  315. package/lib/v2/scau/yjs.js +2 -2
  316. package/lib/v2/scau/yjsy.js +27 -0
  317. package/lib/v2/science/utils.js +4 -4
  318. package/lib/v2/scmp/index.js +61 -85
  319. package/lib/v2/scmp/utils.js +60 -0
  320. package/lib/v2/segmentfault/blogs.js +6 -23
  321. package/lib/v2/segmentfault/channel.js +18 -30
  322. package/lib/v2/segmentfault/user.js +6 -32
  323. package/lib/v2/segmentfault/utils.js +32 -0
  324. package/lib/v2/showstart/artist.js +15 -0
  325. package/lib/v2/showstart/brand.js +15 -0
  326. package/lib/v2/showstart/const.js +4 -0
  327. package/lib/v2/showstart/event.js +18 -0
  328. package/lib/v2/showstart/maintainer.js +6 -0
  329. package/lib/v2/showstart/radar.js +40 -0
  330. package/lib/v2/showstart/router.js +6 -0
  331. package/lib/v2/showstart/search.js +51 -0
  332. package/lib/v2/showstart/service.js +166 -0
  333. package/lib/v2/showstart/utils.js +92 -0
  334. package/lib/v2/sohu/mp.js +48 -35
  335. package/lib/v2/sohu/templates/video.art +7 -0
  336. package/lib/v2/tableau/maintainer.js +3 -0
  337. package/lib/v2/tableau/radar.js +11 -0
  338. package/lib/v2/tableau/router.js +3 -0
  339. package/lib/v2/tableau/viz-of-the-day.js +26 -0
  340. package/lib/v2/techpowerup/maintainer.js +0 -1
  341. package/lib/v2/telegram/maintainer.js +3 -3
  342. package/lib/v2/tesla/cx.js +119 -0
  343. package/lib/v2/tesla/maintainer.js +1 -0
  344. package/lib/v2/tesla/radar.js +13 -1
  345. package/lib/v2/tesla/router.js +1 -0
  346. package/lib/v2/tesla/templates/description.art +140 -0
  347. package/lib/v2/test/index.js +46 -0
  348. package/lib/v2/tfc-taiwan/maintainer.js +0 -1
  349. package/lib/v2/thepaper/featured.js +1 -1
  350. package/lib/v2/thepaper/utils.js +18 -12
  351. package/lib/v2/thoughtco/index.js +95 -0
  352. package/lib/v2/thoughtco/maintainer.js +3 -0
  353. package/lib/v2/thoughtco/radar.js +155 -0
  354. package/lib/v2/thoughtco/router.js +3 -0
  355. package/lib/v2/thoughtco/templates/description.art +16 -0
  356. package/lib/v2/threads/index.js +20 -150
  357. package/lib/v2/threads/utils.js +147 -0
  358. package/lib/v2/twitch/live.js +88 -0
  359. package/lib/v2/twitch/maintainer.js +5 -0
  360. package/lib/v2/twitch/radar.js +37 -0
  361. package/lib/v2/twitch/router.js +5 -0
  362. package/lib/v2/twitch/schedule.js +75 -0
  363. package/lib/v2/twitch/video.js +64 -0
  364. package/lib/v2/twitter/keyword.js +1 -3
  365. package/lib/v2/twitter/media.js +1 -5
  366. package/lib/v2/twitter/user.js +1 -3
  367. package/lib/v2/twitter/utils.js +5 -3
  368. package/lib/v2/twitter/web-api/constants.js +80 -68
  369. package/lib/v2/twitter/web-api/twitter-api.js +96 -103
  370. package/lib/v2/udn/breaking-news.js +6 -2
  371. package/lib/v2/uniqlo/maintainer.js +3 -0
  372. package/lib/v2/uniqlo/new.js +62 -0
  373. package/lib/v2/uniqlo/radar.js +12 -0
  374. package/lib/v2/uniqlo/router.js +3 -0
  375. package/lib/v2/v1tx/maintainer.js +0 -1
  376. package/lib/v2/weekendhk/maintainer.js +0 -1
  377. package/lib/v2/weibo/maintainer.js +1 -1
  378. package/lib/v2/weibo/oasis/user.js +4 -3
  379. package/lib/v2/weibo/radar.js +1 -1
  380. package/lib/v2/weibo/router.js +1 -1
  381. package/lib/v2/weibo/search/hot.js +118 -7
  382. package/lib/v2/weibo/search/template/digest.art +17 -0
  383. package/lib/v2/whu/hyxt.js +50 -0
  384. package/lib/v2/whu/maintainer.js +2 -1
  385. package/lib/v2/whu/news.js +48 -80
  386. package/lib/v2/whu/radar.js +252 -4
  387. package/lib/v2/whu/router.js +2 -1
  388. package/lib/v2/whu/templates/description.art +39 -0
  389. package/lib/v2/whu/util.js +148 -0
  390. package/lib/v2/x-mol/maintainer.js +4 -0
  391. package/lib/v2/x-mol/news.js +63 -0
  392. package/lib/v2/x-mol/paper.js +73 -0
  393. package/lib/v2/x-mol/radar.js +25 -0
  394. package/lib/v2/x-mol/router.js +4 -0
  395. package/lib/v2/x-mol/templates/description.art +6 -0
  396. package/lib/v2/x-mol/utils.js +3 -0
  397. package/lib/v2/xiaohongshu/user.js +33 -9
  398. package/lib/v2/xiaohongshu/util.js +26 -20
  399. package/lib/v2/xmnn/docs.js +0 -0
  400. package/lib/v2/xmnn/maintainer.js +1 -0
  401. package/lib/v2/xmnn/news.js +65 -0
  402. package/lib/v2/xmnn/radar.js +67 -1
  403. package/lib/v2/xmnn/router.js +1 -0
  404. package/lib/v2/yomujp/level.js +101 -0
  405. package/lib/v2/yomujp/maintainer.js +3 -0
  406. package/lib/v2/yomujp/radar.js +13 -0
  407. package/lib/v2/yomujp/router.js +3 -0
  408. package/lib/v2/yuque/utils.js +1 -0
  409. package/lib/v2/zcool/maintainer.js +1 -1
  410. package/lib/v2/zhubai/radar.js +2 -1
  411. package/lib/v2/zhubai/templates/description.art +41 -13
  412. package/lib/v2/zhubai/top20.js +31 -22
  413. package/lib/{routes → v2}/zimuxia/index.js +16 -8
  414. package/lib/v2/zimuxia/maintainer.js +4 -0
  415. package/lib/v2/zimuxia/portfolio.js +52 -0
  416. package/lib/v2/zimuxia/radar.js +19 -0
  417. package/lib/v2/zimuxia/router.js +4 -0
  418. package/lib/v2/zjuvag/blog.js +33 -0
  419. package/lib/v2/zjuvag/maintainer.js +3 -0
  420. package/lib/v2/zjuvag/radar.js +11 -0
  421. package/lib/v2/zjuvag/router.js +3 -0
  422. package/lib/views/rss3-ums.js +62 -0
  423. package/package.json +60 -60
  424. package/lib/routes/abc/documentId.js +0 -7272
  425. package/lib/routes/abc/id.js +0 -7272
  426. package/lib/routes/abc/index.js +0 -74
  427. package/lib/routes/blogs/paulgraham.js +0 -46
  428. package/lib/routes/egsea/flash.js +0 -40
  429. package/lib/routes/getitfree/category.js +0 -59
  430. package/lib/routes/getitfree/search.js +0 -25
  431. package/lib/routes/getitfree/utils.js +0 -47
  432. package/lib/routes/gov/moa/sjzxfb.js +0 -20
  433. package/lib/routes/growincity/news.js +0 -49
  434. package/lib/routes/grubstreet/utils.js +0 -78
  435. package/lib/routes/liquipedia/dota2_matches.js +0 -50
  436. package/lib/routes/mittrchina/index.js +0 -45
  437. package/lib/routes/npc/index.js +0 -42
  438. package/lib/routes/uniqlo/stylingbook.js +0 -24
  439. package/lib/routes/universities/buaa/news/index.js +0 -66
  440. package/lib/routes/universities/buaa/utils.js +0 -57
  441. package/lib/routes/x-mol/news.js +0 -48
  442. package/lib/routes/x-mol/paper.js +0 -78
  443. package/lib/routes/x-mol/utils.js +0 -16
  444. package/lib/routes/zimuxia/portfolio.js +0 -39
  445. package/lib/v2/chinafactcheck/templates/description.art +0 -1
  446. package/lib/v2/firefox/index.js +0 -74
  447. package/lib/v2/gocn/util.js +0 -17
  448. package/lib/v2/gov/zhengce/zuixin.js +0 -39
  449. package/lib/v2/nbd/article.js +0 -50
  450. package/lib/v2/reuters/migration_prompt.js +0 -3
  451. package/lib/v2/twitter/web-api/twitter-got.js +0 -113
  452. /package/lib/{routes → v2}/gov/moa/moa.js +0 -0
  453. /package/lib/{routes → v2}/grubstreet/index.js +0 -0
  454. /package/lib/{routes → v2}/metacritic/release.js +0 -0
@@ -1,7 +1,6 @@
1
1
  const config = require('@/config').value;
2
2
  const art = require('art-template');
3
3
  const path = require('path');
4
- const pidusage = require('pidusage');
5
4
 
6
5
  let gitHash;
7
6
  try {
@@ -10,7 +9,9 @@ try {
10
9
  gitHash = (process.env.HEROKU_SLUG_COMMIT && process.env.HEROKU_SLUG_COMMIT.slice(0, 7)) || (process.env.VERCEL_GIT_COMMIT_SHA && process.env.VERCEL_GIT_COMMIT_SHA.slice(0, 7)) || 'unknown';
11
10
  }
12
11
 
13
- module.exports = async (ctx) => {
12
+ const startTime = Date.now();
13
+
14
+ module.exports = (ctx) => {
14
15
  ctx.set({
15
16
  'Content-Type': 'text/html; charset=UTF-8',
16
17
  'Cache-Control': 'no-cache',
@@ -47,7 +48,7 @@ module.exports = async (ctx) => {
47
48
  }
48
49
  const { disallowRobot } = config;
49
50
 
50
- const stats = await pidusage(process.pid);
51
+ const duration = Date.now() - startTime;
51
52
 
52
53
  ctx.body = art(path.resolve(__dirname, '../views/welcome.art'), {
53
54
  showDebug,
@@ -69,7 +70,7 @@ module.exports = async (ctx) => {
69
70
  },
70
71
  {
71
72
  name: 'Request Frequency',
72
- value: ((ctx.debug.request / (stats.elapsed / 1000)) * 60).toFixed(3) + ' times/minute',
73
+ value: ((ctx.debug.request / (duration / 1000)) * 60).toFixed(3) + ' times/minute',
73
74
  },
74
75
  {
75
76
  name: 'Cache Hit Ratio',
@@ -79,17 +80,9 @@ module.exports = async (ctx) => {
79
80
  name: 'ETag Matched',
80
81
  value: ctx.debug.etag,
81
82
  },
82
- {
83
- name: 'Memory Usage',
84
- value: stats.memory / 1000000 + ' MB',
85
- },
86
- {
87
- name: 'CPU Usage',
88
- value: stats.cpu + '%',
89
- },
90
83
  {
91
84
  name: 'Run Time',
92
- value: (stats.elapsed / 3600000).toFixed(2) + ' hour(s)',
85
+ value: (duration / 3600000).toFixed(2) + ' hour(s)',
93
86
  },
94
87
  {
95
88
  name: 'Hot Routes',
@@ -6,7 +6,7 @@ const timezone = require('@/utils/timezone');
6
6
 
7
7
  module.exports = async (ctx) => {
8
8
  const baseUrl = 'https://ostudy.ynnedu.cn/';
9
- const blacklist = ['ynnu-mv.html', 'https://chjiao.ynnu.edu.cn/zsgz/zsjz.htm', 'https://chjiao.ynnu.edu.cn/info/1006/1404.htm', 'https://chjiao.ynnu.edu.cn/zsgz/dksw.htm'];
9
+ const denylist = ['ynnu-mv.html', 'https://chjiao.ynnu.edu.cn/zsgz/zsjz.htm', 'https://chjiao.ynnu.edu.cn/info/1006/1404.htm', 'https://chjiao.ynnu.edu.cn/zsgz/dksw.htm'];
10
10
  const { body } = await got(baseUrl);
11
11
  const $index = cheerio.load(body);
12
12
  ctx.state.data = {
@@ -16,7 +16,7 @@ module.exports = async (ctx) => {
16
16
  // 顶部幻灯片抓取
17
17
  Promise.all(
18
18
  $index('div[carousel-item] > div')
19
- .filter((_, element) => !blacklist.includes($index(element).find('a').attr('href')))
19
+ .filter((_, element) => !denylist.includes($index(element).find('a').attr('href')))
20
20
  .map((_, element) => {
21
21
  const $element = $index(element);
22
22
  const $a = $element.find('a');
@@ -46,7 +46,7 @@ module.exports = async (ctx) => {
46
46
  Promise.all(
47
47
  cheerio
48
48
  .load($index('#serviceInform-tpl').html())('.news-li:not(:last-child)')
49
- .filter((_, element) => !blacklist.includes($index(element).find('a').attr('href')))
49
+ .filter((_, element) => !denylist.includes($index(element).find('a').attr('href')))
50
50
  .map((_, element) => {
51
51
  const $element = $index(element);
52
52
  const $a = $element.find('a');
@@ -1,4 +1,5 @@
1
- const randUserAgent = require('rand-user-agent');
1
+ const { randUserAgent } = require('@tonyrl/rand-user-agent');
2
+ require.resolve('@tonyrl/rand-user-agent/data/user-agents.json'); // workaround for @vercel/nft removing datastore
2
3
 
3
4
  /**
4
5
  * A handy function to help generate a legit useragent.
@@ -1,9 +1,11 @@
1
1
  const art = require('art-template');
2
2
  const json = require('@/views/json');
3
+ const rss3Ums = require('@/views/rss3-ums');
3
4
 
4
5
  // We may add more control over it later
5
6
 
6
7
  module.exports = {
7
8
  art,
8
9
  json, // This should be used by RSSHub middleware only.
10
+ rss3Ums,
9
11
  };
@@ -11,7 +11,11 @@ module.exports = async (ctx) => {
11
11
  const rootUrl = 'https://hjd2048.com';
12
12
 
13
13
  const entranceDomain = await ctx.cache.tryGet('2048:entranceDomain', async () => {
14
- const { data: response } = await got('https://hjd.tw');
14
+ const { data: response } = await got('https://hjd.tw', {
15
+ headers: {
16
+ accept: '*/*',
17
+ },
18
+ });
15
19
  const $ = cheerio.load(response);
16
20
  return $('ul li a')
17
21
  .toArray()
@@ -36,14 +40,16 @@ module.exports = async (ctx) => {
36
40
  .nextAll('.tr3')
37
41
  .toArray()
38
42
  .map((item) => {
39
- item = $(item).find('.subject');
43
+ item = $(item).find('a.subject');
40
44
 
41
45
  return {
42
46
  title: item.text(),
43
47
  link: `${currentHost}/2048/${item.attr('href')}`,
44
48
  guid: `${rootUrl}/2048/${item.attr('href')}`,
45
49
  };
46
- });
50
+ })
51
+ .filter((item) => !item.link.includes('undefined'));
52
+
47
53
  const items = await Promise.all(
48
54
  list.map((item) =>
49
55
  ctx.cache.tryGet(item.guid, async () => {
@@ -60,15 +66,8 @@ module.exports = async (ctx) => {
60
66
  content(this).replaceWith(`<img src="${content(this).find('img').attr('src')}">`);
61
67
  });
62
68
 
63
- item.author = content('.fl.black').text();
64
- item.pubDate = timezone(
65
- parseDate(
66
- content('.fl.gray')
67
- .text()
68
- .replace(/发表于: /, '')
69
- ),
70
- +8
71
- );
69
+ item.author = content('.fl.black').first().text();
70
+ item.pubDate = timezone(parseDate(content('span.fl.gray').first().attr('title')), +8);
72
71
 
73
72
  const downloadLink = content('#read_tpc').first().find('a').last();
74
73
 
@@ -93,7 +92,13 @@ module.exports = async (ctx) => {
93
92
  );
94
93
  }
95
94
 
96
- item.description = content('#read_tpc').first().html();
95
+ const desp = content('#read_tpc').first();
96
+
97
+ content('.showhide img').each(function () {
98
+ desp.append(`<br><img style="max-width: 100%;" src="${content(this).attr('src')}">`);
99
+ });
100
+
101
+ item.description = desp.html();
97
102
 
98
103
  return item;
99
104
  })
@@ -3,7 +3,7 @@ const cheerio = require('cheerio');
3
3
  const { art } = require('@/utils/render');
4
4
  const path = require('path');
5
5
 
6
- const rootUrl = 'https://www.95mm.org';
6
+ const rootUrl = 'https://www.95mm.vip';
7
7
 
8
8
  module.exports = {
9
9
  rootUrl,
@@ -28,6 +28,7 @@ module.exports = {
28
28
  return {
29
29
  title: a.text(),
30
30
  link: a.attr('href'),
31
+ guid: a.attr('href').replace('95mm.vip', '95mm.org'),
31
32
  };
32
33
  });
33
34
 
@@ -42,7 +43,7 @@ module.exports = {
42
43
  const images = detailResponse.data.match(/src": '(.*?)',"width/g);
43
44
 
44
45
  item.description = art(path.join(__dirname, 'templates/description.art'), {
45
- images: images.map((i) => i.split("'")[1]),
46
+ images: images.map((i) => i.split("'")[1].replaceAll('\\/', '/')),
46
47
  });
47
48
 
48
49
  return item;
@@ -0,0 +1,162 @@
1
+ const got = require('@/utils/got');
2
+ const cheerio = require('cheerio');
3
+ const { parseDate } = require('@/utils/parse-date');
4
+ const { art } = require('@/utils/render');
5
+ const path = require('path');
6
+
7
+ module.exports = async (ctx) => {
8
+ const { category = 'news/justin' } = ctx.params;
9
+ const limit = ctx.query.limit ? parseInt(ctx.query.limit, 10) : 30;
10
+
11
+ const rootUrl = 'https://www.abc.net.au';
12
+ const apiUrl = new URL('news-web/api/loader/channelrefetch', rootUrl).href;
13
+
14
+ let currentUrl = '';
15
+ let documentId = undefined;
16
+
17
+ if (!isNaN(category)) {
18
+ documentId = category;
19
+ const feedUrl = new URL(`news/feed/${documentId}/rss.xml`, rootUrl).href;
20
+
21
+ const { data: feedResponse } = await got(feedUrl);
22
+ currentUrl = feedResponse.match(/<link>([\w-.:/?]+)<\/link>/)[1];
23
+ } else {
24
+ currentUrl = new URL(category, rootUrl).href;
25
+ }
26
+
27
+ const { data: currentResponse } = await got(currentUrl);
28
+
29
+ const $ = cheerio.load(currentResponse);
30
+
31
+ documentId = documentId ?? $('div[data-uri^="coremedia://collection/"]').first().prop('data-uri').split(/\//).pop();
32
+
33
+ const { data: response } = await got(apiUrl, {
34
+ searchParams: {
35
+ name: 'PaginationArticles',
36
+ documentId,
37
+ size: limit,
38
+ },
39
+ });
40
+
41
+ let items = response.collection.slice(0, limit).map((i) => {
42
+ const item = {
43
+ title: i.title.children ?? i.title,
44
+ link: new URL(i.link.to, rootUrl).href,
45
+ description: art(path.join(__dirname, 'templates/description.art'), {
46
+ image: i.image
47
+ ? {
48
+ src: i.image.imgSrc.split(/\?/)[0],
49
+ alt: i.image.alt,
50
+ }
51
+ : undefined,
52
+ }),
53
+ author: i.newsBylineProps?.authors?.map((a) => a.name).join('/') ?? undefined,
54
+ guid: `abc-${i.id}`,
55
+ pubDate: parseDate(i.timestamp.dates.firstPublished),
56
+ updated: i.timestamp.dates.lastUpdated ? parseDate(i.timestamp.dates.lastUpdated) : undefined,
57
+ };
58
+
59
+ if (i.mediaIndicator) {
60
+ item.enclosure_type = 'audio/mpeg';
61
+ item.itunes_item_image = i.image?.imgSrc.split(/\?/)[0] ?? undefined;
62
+ item.itunes_duration = i.mediaIndicator.duration;
63
+ }
64
+
65
+ return item;
66
+ });
67
+
68
+ items = await Promise.all(
69
+ items.map((item) =>
70
+ ctx.cache.tryGet(item.link, async () => {
71
+ try {
72
+ const { data: detailResponse } = await got(item.link);
73
+
74
+ const content = cheerio.load(detailResponse);
75
+
76
+ content('aside, header, [data-print="inline-media"], [data-component="EmbedBlock"]').remove();
77
+
78
+ content('#body *, div[data-component="FeatureMedia"]')
79
+ .children()
80
+ .each(function () {
81
+ const element = content(this);
82
+ if (element.prop('tagName').toLowerCase() === 'figure') {
83
+ element.replaceWith(
84
+ art(path.join(__dirname, 'templates/description.art'), {
85
+ image: {
86
+ src: element.find('img').prop('src').split(/\?/)[0],
87
+ alt: element.find('figcaption').text().trim(),
88
+ },
89
+ })
90
+ );
91
+ } else {
92
+ element.removeAttr('id class role data-component data-uri');
93
+ }
94
+ });
95
+
96
+ item.title = content('meta[property="og:title"]').prop('content');
97
+ item.description = '';
98
+
99
+ const enclosurePattern = '"(?:MIME|content)?Type":"([\\w]+/[\\w]+)".*?"(?:fileS|s)?ize":(\\d+),.*?"url":"([\\w-.:/?]+)"';
100
+
101
+ const enclosureMatches = detailResponse.match(new RegExp(enclosurePattern, 'g'));
102
+
103
+ if (enclosureMatches) {
104
+ const enclosureMatch = enclosureMatches
105
+ .map((e) => e.match(new RegExp(enclosurePattern)))
106
+ .sort((a, b) => parseInt(a[2], 10) - parseInt(b[2], 10))
107
+ .pop();
108
+
109
+ item.enclosure_url = enclosureMatch[3];
110
+ item.enclosure_length = enclosureMatch[2];
111
+ item.enclosure_type = enclosureMatch[1];
112
+
113
+ item.description = art(path.join(__dirname, 'templates/description.art'), {
114
+ enclosure: {
115
+ src: item.enclosure_url,
116
+ type: item.enclosure_type,
117
+ },
118
+ });
119
+ }
120
+
121
+ item.description =
122
+ art(path.join(__dirname, 'templates/description.art'), {
123
+ description: (content('div[data-component="FeatureMedia"]').html() || '') + (content('#body div[data-component="LayoutContainer"] div').first().html() || ''),
124
+ }) + item.description;
125
+
126
+ item.category = content('meta[property="article:tag"]')
127
+ .toArray()
128
+ .map((c) =>
129
+ content(c)
130
+ .prop('content')
131
+ .split(/,/)
132
+ .map((c) => c.trim())
133
+ )
134
+ .flat();
135
+ item.guid = `abc-${content('meta[name="ContentId"]').prop('content')}`;
136
+ item.pubDate = parseDate(content('meta[property="article:published_time"]').prop('content'));
137
+ item.updated = parseDate(content('meta[property="article:modified_time"]').prop('content'));
138
+ } catch (e) {
139
+ // eslint-disable-next-line
140
+ }
141
+
142
+ return item;
143
+ })
144
+ )
145
+ );
146
+
147
+ const icon = new URL($('link[rel="apple-touch-icon"]').prop('href'), rootUrl).href;
148
+
149
+ ctx.state.data = {
150
+ item: items,
151
+ title: $('title').first().text(),
152
+ link: currentUrl,
153
+ description: $('meta[property="og:description"]').prop('content'),
154
+ language: $('html').prop('lang'),
155
+ image: $('meta[property="og:image"]').prop('content').split('?')[0],
156
+ icon,
157
+ logo: icon,
158
+ subtitle: $('meta[property="og:title"]').prop('content'),
159
+ author: $('meta[name="generator"]').prop('content'),
160
+ allowEmpty: true,
161
+ };
162
+ };
@@ -0,0 +1,3 @@
1
+ module.exports = {
2
+ '/:category?': ['nczitzk'],
3
+ };
@@ -0,0 +1,13 @@
1
+ module.exports = {
2
+ 'abc.net.au': {
3
+ _name: 'ABC News',
4
+ '.': [
5
+ {
6
+ title: 'Channel & Topic',
7
+ docs: 'https://docs.rsshub.app/routes/traditional-media#abc-news',
8
+ source: ['/:category*'],
9
+ target: '/abc/:category',
10
+ },
11
+ ],
12
+ },
13
+ };
@@ -0,0 +1,3 @@
1
+ module.exports = (router) => {
2
+ router.get('/:category*', require('./'));
3
+ };
@@ -0,0 +1,21 @@
1
+ {{ if image }}
2
+ <figure>
3
+ <img src="{{ image.src }}" alt="{{ image.alt }}">
4
+ <figcaption>{{ image.alt }}</figcaption>
5
+ </figure>
6
+ {{ /if }}
7
+
8
+ {{ if enclosure }}
9
+ <{{ enclosure.type.split(/\//)[0] }} controls>
10
+ <source
11
+ src="{{ enclosure.src }}"
12
+ type="{{ enclosure.type }}">
13
+ <object data="{{ enclosure.src }}">
14
+ <embed src="{{ enclosure.src }}">
15
+ </object>
16
+ </{{ enclosure.type.split(/\//)[0] }}>
17
+ {{ /if }}
18
+
19
+ {{ if description }}
20
+ {{@ description }}
21
+ {{ /if }}
@@ -20,7 +20,7 @@ module.exports = async (ctx) => {
20
20
  const url = `https://help.aliyun.com/noticelist/${typeMap[type] || typeMap[0]}.html`;
21
21
  const response = await got({ method: 'get', url });
22
22
  const $ = cheerio.load(response.data);
23
- const list = $('ul > li.y-clear')
23
+ const list = $('ul > li.notice-li')
24
24
  .map((i, e) => {
25
25
  const element = $(e);
26
26
  const title = element.find('a').text().trim();
@@ -68,7 +68,7 @@ module.exports = async (ctx) => {
68
68
 
69
69
  item.title = content('h1').first().text();
70
70
  item.author = content('.author').text();
71
- item.pubDate = parseDate(detailResponse.data.match(/"datePublished": "(.*?)",/)[1]);
71
+ item.pubDate = parseDate(detailResponse.data.match(/"datePublished": ?"(.*?)",/)[1]);
72
72
  item.description = art(path.join(__dirname, 'templates/description.art'), {
73
73
  image: content('.article-featured-image').html(),
74
74
  description: content('.wysiwyg').html(),
@@ -17,6 +17,7 @@ module.exports = async (ctx) => {
17
17
  title: $(e).find('span.PagePromoContentIcons-text').text(),
18
18
  link: $(e).find('a').attr('href'),
19
19
  }))
20
+ .filter((e) => typeof e.link === 'string')
20
21
  .map((item) =>
21
22
  ctx.cache.tryGet(item.link, async () => {
22
23
  const { data: response } = await got(item.link);
@@ -2,32 +2,103 @@ const got = require('@/utils/got');
2
2
  const cheerio = require('cheerio');
3
3
  const { parseDate } = require('@/utils/parse-date');
4
4
 
5
+ const platformIds = {
6
+ osx: 'macOS',
7
+ ios: 'iOS',
8
+ appletvos: 'tvOS',
9
+ };
10
+
11
+ const platforms = {
12
+ macos: 'osx',
13
+ ios: 'ios',
14
+ tvos: 'appletvos',
15
+ };
16
+
5
17
  module.exports = async (ctx) => {
6
- const { id, country } = ctx.params;
7
- const url = `https://apps.apple.com/${country}/app/${id}`;
18
+ const { country, id } = ctx.params;
19
+ let { platform } = ctx.params;
20
+
21
+ let platformId;
22
+
23
+ if (platform) {
24
+ platform = platform.toLowerCase();
25
+ platformId = platforms.hasOwnProperty(platform) ? platforms[platform] : platform;
26
+ }
27
+ platform = undefined;
28
+
29
+ const limit = ctx.query.limit ? parseInt(ctx.query.limit, 10) : 100;
30
+
31
+ const rootUrl = 'https://apps.apple.com';
32
+ const currentUrl = new URL(`${country}/app/${id}`, rootUrl).href;
8
33
 
9
- const res = await got(url);
10
- const $ = cheerio.load(res.data);
34
+ const { data: response } = await got(currentUrl);
11
35
 
12
- const webPlatform = $('.we-localnav__title__product').text();
36
+ const $ = cheerio.load(response);
37
+
38
+ const subtitle = $('h2.whats-new__headline').text() || "What's New";
13
39
 
14
40
  const appData = JSON.parse(Object.values(JSON.parse($('script#shoebox-media-api-cache-apps').text()))[0]);
15
- const appName = appData.d[0].attributes.name;
16
- const platform = Object.values(appData.d[0].attributes.platformAttributes)[0]; // may incldes osx appletvos, ios, etc.
41
+ const attributes = appData.d[0].attributes;
42
+
43
+ const appName = attributes.name;
44
+ const artistName = attributes.artistName;
45
+ const platformAttributes = attributes.platformAttributes;
46
+
47
+ let items = [];
48
+ let title = '';
49
+ let description = '';
50
+
51
+ if (platformId && platformAttributes.hasOwnProperty(platformId)) {
52
+ platform = platformIds.hasOwnProperty(platformId) ? platformIds[platformId] : platformId;
53
+
54
+ const platformAttribute = platformAttributes[platformId];
55
+
56
+ items = platformAttribute.versionHistory;
57
+ title = `${appName}${platform ? ` for ${platform} ` : ' '}${subtitle}`;
58
+ description = platformAttribute.description.standard;
59
+ } else {
60
+ title = `${appName} ${subtitle}`;
61
+ for (const pid of Object.keys(platformAttributes)) {
62
+ const platformAttribute = platformAttributes[pid];
63
+ items = [
64
+ ...items,
65
+ ...platformAttribute.versionHistory.map((v) => ({
66
+ ...v,
67
+ platformId: pid,
68
+ })),
69
+ ];
70
+ description += platformAttribute.description.standard;
71
+ }
72
+ }
73
+
74
+ items = items.slice(0, limit).map((item) => {
75
+ const pid = item.platformId ?? platformId;
76
+ const p = platform ? platform : platformIds.hasOwnProperty(pid) ? platformIds[pid] : pid;
77
+
78
+ return {
79
+ title: `${appName} ${item.versionDisplay} for ${p}`,
80
+ link: currentUrl,
81
+ description: item.releaseNotes?.replace(/\n/g, '<br>'),
82
+ category: [p],
83
+ guid: `apple/apps/${country}/${id}/${pid}#${item.versionDisplay}`,
84
+ pubDate: parseDate(item.releaseTimestamp),
85
+ };
86
+ });
17
87
 
18
- const items = platform.versionHistory.map((item) => ({
19
- title: `${appName} ${item.versionDisplay}`,
20
- description: item.releaseNotes?.replace(/\n/g, '<br>'),
21
- pubDate: parseDate(item.releaseTimestamp),
22
- guid: `apple:apps:update:${country}:${id}:${item.versionDisplay}`,
23
- link: url,
24
- }));
88
+ const icon = new URL('favicon.ico', rootUrl).href;
25
89
 
26
90
  ctx.state.data = {
27
- title: `${appName} for ${webPlatform === 'App Store' ? 'iOS' : 'macOS'} ${country === 'cn' ? '更新' : 'Update'}`,
28
- description: platform.description.standard?.replace(/\n/g, ' '),
29
- link: url,
30
91
  item: items,
92
+ title,
93
+ link: currentUrl,
94
+ description: description?.replace(/\n/g, ' '),
95
+ language: $('html').prop('lang'),
96
+ image: $('meta[property="og:image"]').prop('content'),
97
+ icon,
98
+ logo: icon,
99
+ subtitle: appName,
100
+ author: artistName,
101
+ allowEmpty: true,
31
102
  };
32
103
 
33
104
  ctx.state.json = {
@@ -1,4 +1,4 @@
1
1
  module.exports = {
2
- '/apps/update/:country/:id': ['EkkoG'],
2
+ '/apps/update/:country/:id/:platform?': ['EkkoG', 'nczitzk'],
3
3
  '/exchange_repair/:country?': ['metowolf', 'HenryQW', 'kt286'],
4
4
  };
@@ -4,9 +4,9 @@ module.exports = {
4
4
  apps: [
5
5
  {
6
6
  title: 'App Update',
7
- docs: 'https://docs.rsshub.app/routes/program-update#app-store-mac-app-store',
8
- source: ['/:contry/app/:appSlug/:id', '/:contry/app/:id'],
9
- target: '/appstore/apps/update/:country/:id',
7
+ docs: 'https://docs.rsshub.app/routes/program-update#app-store-mac-app-store-app-update',
8
+ source: ['/:country/app/:appSlug/:id', '/:country/app/:id'],
9
+ target: '/apple/apps/update/:country/:id',
10
10
  },
11
11
  ],
12
12
  support: [
@@ -1,4 +1,4 @@
1
1
  module.exports = function (router) {
2
- router.get('/apps/update/:country/:id', require('./apps'));
2
+ router.get('/apps/update/:country/:id/:platform?', require('./apps'));
3
3
  router.get('/exchange_repair/:country?', require('./exchange_repair'));
4
4
  };