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
package/README.md CHANGED
@@ -30,7 +30,7 @@ RSSHub can be used with browser extension [RSSHub Radar](https://github.com/DIYg
30
30
  ### Special Sponsors
31
31
 
32
32
  <p>
33
- <a href="https://xlog.app/" target="_blank"><img height="100px" src="https://i.imgur.com/JuhHTKD.png"></a>
33
+ <a href="https://rss3.io" target="_blank"><img height="50px" src="https://i.imgur.com/lb1dDGK.png"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="https://xlog.app/" target="_blank"><img height="50px" src="https://i.imgur.com/JuhHTKD.png"></a>
34
34
  </p>
35
35
 
36
36
  [![](https://opencollective.com/static/images/become_sponsor.svg)](https://docs.rsshub.app/support/)
@@ -43,7 +43,7 @@ Logo designer [sheldonrrr](https://dribbble.com/sheldonrrr)
43
43
 
44
44
  ### Backers
45
45
 
46
- <a href="https://www.cloudflare.com" target="_blank"><img height="50px" src="https://i.imgur.com/7Ph27Fq.png"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="https://www.netlify.com" target="_blank"><img height="40px" src="https://i.imgur.com/cU01915.png"></a>
46
+ <a href="https://www.cloudflare.com" target="_blank"><img height="50px" src="https://i.imgur.com/7Ph27Fq.png"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="https://www.netlify.com" target="_blank"><img height="40px" src="https://i.imgur.com/cU01915.png"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="https://1password.com" target="_blank"><img height="40px" src="https://i.imgur.com/a2XjflO.png"></a>
47
47
 
48
48
  ## Related Projects
49
49
 
@@ -78,7 +78,7 @@ Recurring donors will be rewarded via express issue response, or even have your
78
78
  - Become a Sponser on [Patreon](https://www.patreon.com/DIYgod)
79
79
  - Become a Sponser on [Open Collective](https://opencollective.com/RSSHub)
80
80
  - Become a Sponser on [爱发电](https://afdian.net/@diygod)
81
- - Contact us directly: i@diygod.me
81
+ - Contact us directly: <i@diygod.me>
82
82
 
83
83
  ### One-time Donation
84
84
 
package/lib/config.js CHANGED
@@ -1,12 +1,12 @@
1
1
  require('dotenv').config();
2
2
  const randUserAgent = require('./utils/rand-user-agent');
3
+ const got = require('got');
3
4
  let envs = process.env;
4
5
  let value;
5
6
  const TRUE_UA = 'RSSHub/1.0 (+http://github.com/DIYgod/RSSHub; like FeedFetcher-Google)';
6
7
 
7
8
  const calculateValue = () => {
8
9
  const bilibili_cookies = {};
9
- const twitter_tokens = {};
10
10
  const email_config = {};
11
11
  const discuz_cookies = {};
12
12
  const medium_cookies = {};
@@ -16,9 +16,6 @@ const calculateValue = () => {
16
16
  if (name.startsWith('BILIBILI_COOKIE_')) {
17
17
  const uid = name.slice(16);
18
18
  bilibili_cookies[uid] = envs[name];
19
- } else if (name.startsWith('TWITTER_TOKEN_')) {
20
- const id = name.slice(14);
21
- twitter_tokens[id] = envs[name];
22
19
  } else if (name.startsWith('EMAIL_CONFIG_')) {
23
20
  const id = name.slice(13);
24
21
  email_config[id] = envs[name];
@@ -85,8 +82,8 @@ const calculateValue = () => {
85
82
  pass: envs.HTTP_BASIC_AUTH_PASS || 'passw0rd',
86
83
  },
87
84
  // access control
88
- blacklist: envs.BLACKLIST && envs.BLACKLIST.split(','),
89
- whitelist: envs.WHITELIST && envs.WHITELIST.split(','),
85
+ denylist: envs.DENYLIST && envs.DENYLIST.split(','),
86
+ allowlist: envs.ALLOWLIST && envs.ALLOWLIST.split(','),
90
87
  allowLocalhost: envs.ALLOW_LOCALHOST,
91
88
  accessKey: envs.ACCESS_KEY,
92
89
  // logging
@@ -112,6 +109,14 @@ const calculateValue = () => {
112
109
  },
113
110
  suffix: envs.SUFFIX,
114
111
  titleLengthLimit: parseInt(envs.TITLE_LENGTH_LIMIT) || 150,
112
+ openai: {
113
+ apiKey: envs.OPENAI_API_KEY,
114
+ model: envs.OPENAI_MODEL || 'gpt-3.5-turbo-16k',
115
+ temperature: envs.OPENAI_TEMPERATURE || 0.2,
116
+ maxTokens: envs.OPENAI_MAX_TOKENS || null,
117
+ endpoint: envs.OPENAI_API_ENDPOINT || 'https://api.openai.com/v1',
118
+ prompt: envs.OPENAI_PROMPT || 'Please summarize the following article and reply with markdown format.',
119
+ },
115
120
 
116
121
  // Route-specific Configurations
117
122
  bilibili: {
@@ -287,10 +292,8 @@ const calculateValue = () => {
287
292
  cookie: envs.TOPHUB_COOKIE,
288
293
  },
289
294
  twitter: {
290
- consumer_key: envs.TWITTER_CONSUMER_KEY,
291
- consumer_secret: envs.TWITTER_CONSUMER_SECRET,
292
- tokens: twitter_tokens,
293
- authorization: envs.TWITTER_WEBAPI_AUTHORIZAION && envs.TWITTER_WEBAPI_AUTHORIZAION.split(','),
295
+ oauthTokens: envs.TWITTER_OAUTH_TOKEN?.split(','),
296
+ oauthTokenSecrets: envs.TWITTER_OAUTH_TOKEN_SECRET?.split(','),
294
297
  },
295
298
  weibo: {
296
299
  app_key: envs.WEIBO_APP_KEY,
@@ -327,6 +330,21 @@ const calculateValue = () => {
327
330
  };
328
331
  calculateValue();
329
332
 
333
+ if (envs.REMOTE_CONFIG) {
334
+ got.get(envs.REMOTE_CONFIG)
335
+ .then((response) => {
336
+ const data = JSON.parse(response.body);
337
+ if (data) {
338
+ envs = Object.assign(envs, data);
339
+ calculateValue();
340
+ require('@/utils/logger').info('Remote config loaded.');
341
+ }
342
+ })
343
+ .catch((error) => {
344
+ require('@/utils/logger').error('Remote config load failed.', error);
345
+ });
346
+ }
347
+
330
348
  module.exports = {
331
349
  set: (env) => {
332
350
  envs = Object.assign(process.env, env);
package/lib/maintainer.js CHANGED
@@ -37,7 +37,7 @@ for (const dir in maintainerPath) {
37
37
  }
38
38
 
39
39
  for (const key in routes) {
40
- maintainers['/' + dir + key] = routes[key];
40
+ maintainers['/' + dir + (key.endsWith('/') ? key.substring(0, key.length - 1) : key)] = routes[key];
41
41
  }
42
42
  }
43
43
 
@@ -49,4 +49,9 @@ router.stack.forEach((e) => {
49
49
  }
50
50
  });
51
51
 
52
- module.exports = maintainers;
52
+ module.exports = Object.keys(maintainers)
53
+ .sort()
54
+ .reduce((obj, path) => {
55
+ obj[path] = maintainers[path];
56
+ return obj;
57
+ }, {});
@@ -15,7 +15,7 @@ module.exports = async (ctx, next) => {
15
15
  const accessKey = ctx.query.key;
16
16
  const accessCode = ctx.query.code;
17
17
 
18
- const isControlled = config.accessKey || config.whitelist || config.blacklist;
18
+ const isControlled = config.accessKey || config.allowlist || config.denylist;
19
19
 
20
20
  const allowLocalhost = config.allowLocalhost && (await isLocalhost(ip));
21
21
 
@@ -38,14 +38,14 @@ module.exports = async (ctx, next) => {
38
38
  }
39
39
  }
40
40
 
41
- if (config.whitelist) {
42
- if (config.whitelist.find((white) => ip.includes(white) || requestPath.includes(white) || requestUA.includes(white))) {
41
+ if (config.allowlist) {
42
+ if (config.allowlist.find((item) => ip.includes(item) || requestPath.includes(item) || requestUA.includes(item))) {
43
43
  return grant();
44
44
  }
45
45
  }
46
46
 
47
- if (config.blacklist) {
48
- if (!config.blacklist.find((black) => ip.includes(black) || requestPath.includes(black) || requestUA.includes(black))) {
47
+ if (config.denylist) {
48
+ if (!config.denylist.find((item) => ip.includes(item) || requestPath.includes(item) || requestUA.includes(item))) {
49
49
  return grant();
50
50
  }
51
51
  }
@@ -4,6 +4,10 @@ const { simplecc } = require('simplecc-wasm');
4
4
  const got = require('@/utils/got');
5
5
  const config = require('@/config').value;
6
6
  const { RE2JS } = require('re2js');
7
+ const md = require('markdown-it')({
8
+ html: true,
9
+ });
10
+ const htmlToText = require('html-to-text');
7
11
 
8
12
  let mercury_parser;
9
13
 
@@ -23,6 +27,26 @@ const resolveRelativeLink = ($, elem, attr, baseUrl) => {
23
27
  }
24
28
  };
25
29
 
30
+ const summarizeArticle = async (articleText) => {
31
+ const apiUrl = `${config.openai.endpoint}/chat/completions`;
32
+ const response = await got.post(apiUrl, {
33
+ json: {
34
+ model: config.openai.model,
35
+ max_tokens: config.openai.maxTokens,
36
+ messages: [
37
+ { role: 'system', content: config.openai.prompt },
38
+ { role: 'user', content: articleText },
39
+ ],
40
+ temperature: config.openai.temperature,
41
+ },
42
+ headers: {
43
+ Authorization: `Bearer ${config.openai.apiKey}`,
44
+ },
45
+ });
46
+
47
+ return response.data.choices[0].message.content;
48
+ };
49
+
26
50
  module.exports = async (ctx, next) => {
27
51
  await next();
28
52
 
@@ -136,17 +160,19 @@ module.exports = async (ctx, next) => {
136
160
  });
137
161
  }
138
162
  }
163
+
164
+ // handle category
165
+ if (item.category) {
166
+ // convert single string to array, and filter only string type category
167
+ Array.isArray(item.category) || (item.category = [item.category]);
168
+ item.category = item.category.filter((e) => typeof e === 'string');
169
+ }
139
170
  return item;
140
171
  };
141
172
 
142
173
  ctx.state.data.item = await Promise.all(ctx.state.data.item.map(handleItem));
143
174
 
144
175
  if (ctx.query) {
145
- // limit
146
- if (ctx.query.limit) {
147
- ctx.state.data.item = ctx.state.data.item.slice(0, parseInt(ctx.query.limit));
148
- }
149
-
150
176
  // filter
151
177
  const engine = config.feature.filter_regex_engine;
152
178
  const makeRegex = (string) => {
@@ -172,8 +198,7 @@ module.exports = async (ctx, next) => {
172
198
  const title = item.title || '';
173
199
  const description = item.description || title;
174
200
  const author = item.author || '';
175
- const categoryArray = Array.isArray(item.category) ? item.category : [item.category];
176
- const category = item.category ? categoryArray : [];
201
+ const category = item.category || [];
177
202
  const isFilter =
178
203
  engine === 're2'
179
204
  ? regex.matcher(title).find() || regex.matcher(description).find() || regex.matcher(author).find() || category.some((c) => regex.matcher(c).find())
@@ -189,8 +214,7 @@ module.exports = async (ctx, next) => {
189
214
  const title = item.title || '';
190
215
  const description = item.description || title;
191
216
  const author = item.author || '';
192
- const categoryArray = Array.isArray(item.category) ? item.category : [item.category];
193
- const category = item.category ? categoryArray : [];
217
+ const category = item.category || [];
194
218
  let isFilter = true;
195
219
 
196
220
  const titleRegex = makeRegex(ctx.query.filter_title);
@@ -216,8 +240,7 @@ module.exports = async (ctx, next) => {
216
240
  const title = item.title;
217
241
  const description = item.description || title;
218
242
  const author = item.author || '';
219
- const categoryArray = Array.isArray(item.category) ? item.category : [item.category];
220
- const category = item.category ? categoryArray : [];
243
+ const category = item.category || [];
221
244
  let isFilter = true;
222
245
 
223
246
  const titleRegex = makeRegex(ctx.query.filterout_title);
@@ -247,6 +270,11 @@ module.exports = async (ctx, next) => {
247
270
  });
248
271
  }
249
272
 
273
+ // limit
274
+ if (ctx.query.limit) {
275
+ ctx.state.data.item = ctx.state.data.item.slice(0, parseInt(ctx.query.limit));
276
+ }
277
+
250
278
  // telegram instant view
251
279
  if (ctx.query.tgiv) {
252
280
  ctx.state.data.item.map((item) => {
@@ -282,6 +310,33 @@ module.exports = async (ctx, next) => {
282
310
  await Promise.all(tasks);
283
311
  }
284
312
 
313
+ // openai
314
+ if (ctx.query.chatgpt && config.openai.apiKey) {
315
+ ctx.state.data.item = await Promise.all(
316
+ ctx.state.data.item.map(async (item) => {
317
+ if (item.description) {
318
+ try {
319
+ const summary = await ctx.cache.tryGet(`openai:${item.link}`, async () => {
320
+ const text = htmlToText.htmlToText(item.description);
321
+ if (text.length < 300) {
322
+ return '';
323
+ }
324
+ const summary_md = await summarizeArticle(text);
325
+ return md.render(summary_md);
326
+ });
327
+ // 将总结结果添加到文章数据中
328
+ if (summary !== '') {
329
+ item.description = summary + '<hr/><br/>' + item.description;
330
+ }
331
+ } catch (e) {
332
+ // when openai failed, return default description and not write cache
333
+ }
334
+ }
335
+ return item;
336
+ })
337
+ );
338
+ }
339
+
285
340
  // scihub
286
341
  if (ctx.query.scihub) {
287
342
  ctx.state.data.item.map((item) => {
@@ -1,7 +1,7 @@
1
- const { art, json } = require('@/utils/render');
1
+ const { art, json, rss3Ums } = require('@/utils/render');
2
2
  const path = require('path');
3
3
  const config = require('@/config').value;
4
- const typeRegex = /\.(atom|rss|debug\.json|json|\d+\.debug\.html)$/;
4
+ const typeRegex = /\.(atom|rss|ums|debug\.json|json|\d+\.debug\.html)$/;
5
5
  const { collapseWhitespace, convertDateToISO8601 } = require('@/utils/common-utils');
6
6
 
7
7
  module.exports = async (ctx, next) => {
@@ -16,111 +16,105 @@ module.exports = async (ctx, next) => {
16
16
 
17
17
  const outputType = ctx.state.type[1] || 'rss';
18
18
 
19
- if (outputType === 'debug.json' && config.debugInfo) {
20
- ctx.set({
21
- 'Content-Type': 'application/json; charset=UTF-8',
22
- });
23
- if (ctx.state.json) {
24
- ctx.body = JSON.stringify(ctx.state.json, null, 4);
25
- } else {
26
- ctx.body = JSON.stringify({ message: 'plugin does not set debug json' });
27
- }
28
- }
29
- if (outputType.endsWith('.debug.html') && config.debugInfo) {
30
- ctx.set({
31
- 'Content-Type': 'text/html; charset=UTF-8',
32
- });
33
-
34
- const index = parseInt(outputType.match(/(\d+)\.debug\.html$/)[1]);
35
- if (!(ctx.state.data && ctx.state.data.item && ctx.state.data.item[index])) {
36
- ctx.body = `ctx.state.data.item[${index}] not found`;
37
- } else {
38
- ctx.body = ctx.state.data.item[index].description;
19
+ // only enable when debugInfo=true
20
+ if (config.debugInfo) {
21
+ if (outputType === 'debug.json') {
22
+ ctx.set({
23
+ 'Content-Type': 'application/json; charset=UTF-8',
24
+ });
25
+ if (ctx.state.json) {
26
+ ctx.body = JSON.stringify(ctx.state.json, null, 4);
27
+ } else {
28
+ ctx.body = JSON.stringify({ message: 'plugin does not set debug json' });
29
+ }
39
30
  }
40
- }
41
31
 
42
- if (outputType === 'json') {
43
- ctx.set({ 'Content-Type': 'application/feed+json; charset=UTF-8' });
32
+ if (outputType.endsWith('.debug.html')) {
33
+ ctx.set({
34
+ 'Content-Type': 'text/html; charset=UTF-8',
35
+ });
36
+
37
+ const index = parseInt(outputType.match(/(\d+)\.debug\.html$/)[1]);
38
+ if (!(ctx.state.data && ctx.state.data.item && ctx.state.data.item[index])) {
39
+ ctx.body = `ctx.state.data.item[${index}] not found`;
40
+ } else {
41
+ ctx.body = ctx.state.data.item[index].description;
42
+ }
43
+ }
44
44
  }
45
45
 
46
46
  if (!ctx.body) {
47
- let template;
48
-
49
- switch (outputType) {
50
- case 'atom':
51
- template = path.resolve(__dirname, '../views/atom.art');
52
- break;
53
- case 'rss':
54
- template = path.resolve(__dirname, '../views/rss.art');
55
- break;
56
- default:
57
- template = path.resolve(__dirname, '../views/rss.art');
58
- break;
59
- }
47
+ const templateName = outputType === 'atom' ? 'atom.art' : 'rss.art';
48
+ const template = path.resolve(__dirname, `../views/${templateName}`);
60
49
 
61
50
  if (ctx.state.data) {
62
- ctx.state.data.title = collapseWhitespace(ctx.state.data.title);
63
- ctx.state.data.subtitle = collapseWhitespace(ctx.state.data.subtitle);
64
- ctx.state.data.author = collapseWhitespace(ctx.state.data.author);
65
-
66
- ctx.state.data.item &&
67
- ctx.state.data.item.forEach((item) => {
68
- if (item.title) {
69
- item.title = collapseWhitespace(item.title);
70
- // trim title length
71
- for (let length = 0, i = 0; i < item.title.length; i++) {
72
- length += Buffer.from(item.title[i]).length !== 1 ? 2 : 1;
73
- if (length > config.titleLengthLimit) {
74
- item.title = `${item.title.slice(0, i)}...`;
75
- break;
76
- }
77
- }
51
+ const collapseWhitespaceForProperties = (properties, obj) => {
52
+ properties.forEach((prop) => {
53
+ if (obj[prop]) {
54
+ obj[prop] = collapseWhitespace(obj[prop]);
78
55
  }
79
-
80
- if (typeof item.author === 'string') {
81
- item.author = collapseWhitespace(item.author);
82
- } else if (typeof item.author === 'object' && item.author !== null) {
83
- for (const a of item.author) {
84
- a.name = collapseWhitespace(a.name);
85
- }
86
- if (outputType !== 'json') {
87
- item.author = item.author.map((a) => a.name).join(', ');
56
+ });
57
+ };
58
+
59
+ collapseWhitespaceForProperties(['title', 'subtitle', 'author'], ctx.state.data);
60
+
61
+ ctx.state.data.item?.forEach((item) => {
62
+ if (item.title) {
63
+ item.title = collapseWhitespace(item.title);
64
+ // trim title length
65
+ for (let length = 0, i = 0; i < item.title.length; i++) {
66
+ length += Buffer.from(item.title[i]).length !== 1 ? 2 : 1;
67
+ if (length > config.titleLengthLimit) {
68
+ item.title = `${item.title.slice(0, i)}...`;
69
+ break;
88
70
  }
89
71
  }
90
-
91
- if (item.itunes_duration && ((typeof item.itunes_duration === 'string' && item.itunes_duration.indexOf(':') === -1) || (typeof item.itunes_duration === 'number' && !isNaN(item.itunes_duration)))) {
92
- item.itunes_duration = +item.itunes_duration;
93
- item.itunes_duration =
94
- Math.floor(item.itunes_duration / 3600) + ':' + (Math.floor((item.itunes_duration % 3600) / 60) / 100).toFixed(2).slice(-2) + ':' + (((item.itunes_duration % 3600) % 60) / 100).toFixed(2).slice(-2);
95
- }
96
-
97
- if (outputType !== 'rss') {
98
- item.pubDate = convertDateToISO8601(item.pubDate);
99
- item.updated = convertDateToISO8601(item.updated);
72
+ }
73
+
74
+ if (typeof item.author === 'string') {
75
+ item.author = collapseWhitespace(item.author);
76
+ } else if (typeof item.author === 'object' && item.author !== null) {
77
+ item.author.forEach((a) => (a.name = collapseWhitespace(a.name)));
78
+ if (outputType !== 'json') {
79
+ item.author = item.author.map((a) => a.name).join(', ');
100
80
  }
101
- });
81
+ }
82
+
83
+ if (item.itunes_duration && ((typeof item.itunes_duration === 'string' && item.itunes_duration.indexOf(':') === -1) || (typeof item.itunes_duration === 'number' && !isNaN(item.itunes_duration)))) {
84
+ item.itunes_duration = +item.itunes_duration;
85
+ item.itunes_duration =
86
+ Math.floor(item.itunes_duration / 3600) + ':' + (Math.floor((item.itunes_duration % 3600) / 60) / 100).toFixed(2).slice(-2) + ':' + (((item.itunes_duration % 3600) % 60) / 100).toFixed(2).slice(-2);
87
+ }
88
+
89
+ if (outputType !== 'rss') {
90
+ item.pubDate = convertDateToISO8601(item.pubDate);
91
+ item.updated = convertDateToISO8601(item.updated);
92
+ }
93
+ });
102
94
  }
103
95
 
104
- const routeTtl = (config.cache.routeExpire / 60) | 0;
105
-
96
+ const currentDate = new Date();
106
97
  const data = {
107
- lastBuildDate: new Date().toUTCString(),
108
- updated: new Date().toISOString(),
109
- ttl: routeTtl,
98
+ lastBuildDate: currentDate.toUTCString(),
99
+ updated: currentDate.toISOString(),
100
+ ttl: (config.cache.routeExpire / 60) | 0,
110
101
  atomlink: ctx.request.href,
111
102
  ...ctx.state.data,
112
103
  };
104
+
113
105
  if (config.isPackage) {
114
106
  ctx.body = data;
115
107
  return;
116
108
  }
117
- if (!template) {
118
- return;
119
- }
120
- if (outputType !== 'json') {
109
+
110
+ if (outputType === 'ums') {
111
+ ctx.set({ 'Content-Type': 'application/json; charset=UTF-8' });
112
+ ctx.body = rss3Ums(data);
113
+ } else if (outputType === 'json') {
114
+ ctx.set({ 'Content-Type': 'application/feed+json; charset=UTF-8' });
115
+ ctx.body = json(data);
116
+ } else {
121
117
  ctx.body = art(template, data);
122
- return;
123
118
  }
124
- ctx.body = json(data);
125
119
  }
126
120
  };
package/lib/router.js CHANGED
@@ -126,8 +126,8 @@ router.get('/sexinsex/:id/:type?', lazyloadRouteHandler('./routes/sexinsex/index
126
126
  router.get('/one', lazyloadRouteHandler('./routes/one/index'));
127
127
 
128
128
  // Firefox
129
- router.get('/firefox/release/:platform', lazyloadRouteHandler('./routes/firefox/release'));
130
- router.get('/firefox/addons/:id', lazyloadRouteHandler('./routes/firefox/addons'));
129
+ // router.get('/firefox/release/:platform', lazyloadRouteHandler('./routes/firefox/release'));
130
+ // router.get('/firefox/addons/:id', lazyloadRouteHandler('./routes/firefox/addons'));
131
131
 
132
132
  // Thunderbird
133
133
  router.get('/thunderbird/release', lazyloadRouteHandler('./routes/thunderbird/release'));
@@ -171,7 +171,7 @@ router.get('/wikipedia/mainland', lazyloadRouteHandler('./routes/wikipedia/mainl
171
171
  router.get('/un/scveto', lazyloadRouteHandler('./routes/un/scveto'));
172
172
 
173
173
  // e 公司
174
- router.get('/egsea/flash', lazyloadRouteHandler('./routes/egsea/flash'));
174
+ // router.get('/egsea/flash', lazyloadRouteHandler('./routes/egsea/flash'));
175
175
 
176
176
  // 选股宝
177
177
  router.get('/xuangubao/subject/:subject_id', lazyloadRouteHandler('./routes/xuangubao/subject'));
@@ -374,7 +374,7 @@ router.get('/henu/:type?', lazyloadRouteHandler('./routes/universities/henu/news
374
374
  router.get('/nku/jwc/:type?', lazyloadRouteHandler('./routes/universities/nku/jwc/index'));
375
375
 
376
376
  // 北京航空航天大学
377
- router.get('/buaa/news/:type', lazyloadRouteHandler('./routes/universities/buaa/news/index'));
377
+ // router.get('/buaa/news/:type', lazyloadRouteHandler('./routes/universities/buaa/news/index'));
378
378
 
379
379
  // 浙江工业大学
380
380
  router.get('/zjut/:type', lazyloadRouteHandler('./routes/universities/zjut/index'));
@@ -992,7 +992,7 @@ router.get('/polimi/news/:language?', lazyloadRouteHandler('./routes/polimi/news
992
992
  router.get('/dekudeals/:type', lazyloadRouteHandler('./routes/dekudeals'));
993
993
 
994
994
  // Metacritic
995
- router.get('/metacritic/release/:platform/:type/:sort?', lazyloadRouteHandler('./routes/metacritic/release'));
995
+ // router.get('/metacritic/release/:platform/:type/:sort?', lazyloadRouteHandler('./routes/metacritic/release'));
996
996
 
997
997
  // 快科技(原驱动之家)
998
998
  // router.get('/kkj/news', lazyloadRouteHandler('./routes/kkj/news'));
@@ -1047,8 +1047,8 @@ router.get('/im2maker/:channel?', lazyloadRouteHandler('./routes/im2maker/index'
1047
1047
  router.get('/cninfo/announcement/:column/:code/:orgId/:category?/:search?', lazyloadRouteHandler('./routes/cninfo/announcement'));
1048
1048
 
1049
1049
  // 中华人民共和国农业农村部
1050
- router.get('/gov/moa/sjzxfb', lazyloadRouteHandler('./routes/gov/moa/sjzxfb'));
1051
- router.get('/gov/moa/:suburl(.*)', lazyloadRouteHandler('./routes/gov/moa/moa'));
1050
+ // router.get('/gov/moa/sjzxfb', lazyloadRouteHandler('./routes/gov/moa/sjzxfb'));
1051
+ // router.get('/gov/moa/:suburl(.*)', lazyloadRouteHandler('./routes/gov/moa/moa'));
1052
1052
 
1053
1053
  // 香水时代
1054
1054
  router.get('/nosetime/:id/:type/:sort?', lazyloadRouteHandler('./routes/nosetime/comment'));
@@ -1090,8 +1090,8 @@ router.get('/wikihow/index', lazyloadRouteHandler('./routes/wikihow/index.js'));
1090
1090
  router.get('/wikihow/category/:category/:type', lazyloadRouteHandler('./routes/wikihow/category.js'));
1091
1091
 
1092
1092
  // 正版中国
1093
- router.get('/getitfree/category/:category?', lazyloadRouteHandler('./routes/getitfree/category.js'));
1094
- router.get('/getitfree/search/:keyword?', lazyloadRouteHandler('./routes/getitfree/search.js'));
1093
+ // router.get('/getitfree/category/:category?', lazyloadRouteHandler('./routes/getitfree/category.js'));
1094
+ // router.get('/getitfree/search/:keyword?', lazyloadRouteHandler('./routes/getitfree/search.js'));
1095
1095
 
1096
1096
  // 万联网
1097
1097
  router.get('/10000link/news/:category?', lazyloadRouteHandler('./routes/10000link/news'));
@@ -1269,8 +1269,8 @@ router.get('/wineyun/:category', lazyloadRouteHandler('./routes/wineyun'));
1269
1269
  router.get('/kzfeed/topic/:id', lazyloadRouteHandler('./routes/kzfeed/topic'));
1270
1270
 
1271
1271
  // X-MOL化学资讯平台
1272
- router.get('/x-mol/news/:tag?', lazyloadRouteHandler('./routes/x-mol/news.js'));
1273
- router.get('/x-mol/paper/:type/:magazine', lazyloadRouteHandler('./routes/x-mol/paper'));
1272
+ // router.get('/x-mol/news/:tag?', lazyloadRouteHandler('./routes/x-mol/news.js'));
1273
+ // router.get('/x-mol/paper/:type/:magazine', lazyloadRouteHandler('./routes/x-mol/paper'));
1274
1274
 
1275
1275
  // 知识分子
1276
1276
  router.get('/zhishifenzi/news/:type?', lazyloadRouteHandler('./routes/zhishifenzi/news'));
@@ -1390,7 +1390,7 @@ router.get('/vulture/:tag/:excludetags?', lazyloadRouteHandler('./routes/vulture
1390
1390
  router.get('/xinwenlianbo/index', lazyloadRouteHandler('./routes/xinwenlianbo/index'));
1391
1391
 
1392
1392
  // Paul Graham - Essays
1393
- router.get('/blogs/paulgraham', lazyloadRouteHandler('./routes/blogs/paulgraham'));
1393
+ // router.get('/blogs/paulgraham', lazyloadRouteHandler('./routes/blogs/paulgraham'));
1394
1394
 
1395
1395
  // invisionapp
1396
1396
  router.get('/invisionapp/inside-design', lazyloadRouteHandler('./routes/invisionapp/inside-design'));
@@ -1607,7 +1607,7 @@ router.get('/hbut/cs/:type', lazyloadRouteHandler('./routes/universities/hbut/cs
1607
1607
  router.get('/acwifi', lazyloadRouteHandler('./routes/acwifi'));
1608
1608
 
1609
1609
  // MIT科技评论
1610
- router.get('/mittrchina/:type', lazyloadRouteHandler('./routes/mittrchina'));
1610
+ // router.get('/mittrchina/:type', lazyloadRouteHandler('./routes/mittrchina'));
1611
1611
 
1612
1612
  // iYouPort
1613
1613
  router.get('/iyouport/article', lazyloadRouteHandler('./routes/iyouport'));
@@ -1732,7 +1732,7 @@ router.get('/jijitang/article/:id', lazyloadRouteHandler('./routes/jijitang/arti
1732
1732
  router.get('/jijitang/publication', lazyloadRouteHandler('./routes/jijitang/publication'));
1733
1733
 
1734
1734
  // Grub Street
1735
- router.get('/grubstreet', lazyloadRouteHandler('./routes/grubstreet/index'));
1735
+ // router.get('/grubstreet', lazyloadRouteHandler('./routes/grubstreet/index'));
1736
1736
 
1737
1737
  // 漫画堆
1738
1738
  router.get('/manhuadui/manhua/:name/:serial?', lazyloadRouteHandler('./routes/manhuadui/manhua'));
@@ -2033,7 +2033,7 @@ router.get('/icity/:id', lazyloadRouteHandler('./routes/icity/index'));
2033
2033
  router.get('/anki/changes', lazyloadRouteHandler('./routes/anki/changes'));
2034
2034
 
2035
2035
  // ABC News
2036
- router.get('/abc/:id?', lazyloadRouteHandler('./routes/abc'));
2036
+ // router.get('/abc/:id?', lazyloadRouteHandler('./routes/abc'));
2037
2037
 
2038
2038
  // 台湾中央通讯社
2039
2039
  // router.get('/cna/:id?', lazyloadRouteHandler('./routes/cna/index'));
@@ -2064,7 +2064,7 @@ router.get('/nobelprize/:caty?', lazyloadRouteHandler('./routes/nobelprize/index
2064
2064
  router.get('/gov/taiwan/mnd', lazyloadRouteHandler('./routes/gov/taiwan/mnd'));
2065
2065
 
2066
2066
  // 中国人大网
2067
- router.get('/npc/:caty', lazyloadRouteHandler('./routes/npc/index'));
2067
+ // router.get('/npc/:caty', lazyloadRouteHandler('./routes/npc/index'));
2068
2068
 
2069
2069
  // 高科技行业门户
2070
2070
  router.get('/ofweek/news', lazyloadRouteHandler('./routes/ofweek/news'));
@@ -2116,7 +2116,7 @@ router.get('/sagawa/:id', lazyloadRouteHandler('./routes/sagawa/index'));
2116
2116
  router.get('/qnap/release-notes/:id', lazyloadRouteHandler('./routes/qnap/release-notes'));
2117
2117
 
2118
2118
  // Liquipedia
2119
- router.get('/liquipedia/dota2/matches/:id', lazyloadRouteHandler('./routes/liquipedia/dota2_matches.js'));
2119
+ // router.get('/liquipedia/dota2/matches/:id', lazyloadRouteHandler('./routes/liquipedia/dota2_matches.js'));
2120
2120
 
2121
2121
  // 哈尔滨市科技局
2122
2122
  router.get('/gov/harbin/kjj', lazyloadRouteHandler('./routes/gov/harbin/kjj'));
@@ -2545,8 +2545,8 @@ router.get('/wanwansub/info/:id', lazyloadRouteHandler('./routes/wanwansub/info'
2545
2545
  router.get('/wanwansub/:id?', lazyloadRouteHandler('./routes/wanwansub/index'));
2546
2546
 
2547
2547
  // FIX 字幕侠
2548
- router.get('/zimuxia/portfolio/:id', lazyloadRouteHandler('./routes/zimuxia/portfolio'));
2549
- router.get('/zimuxia/:category?', lazyloadRouteHandler('./routes/zimuxia/index'));
2548
+ // router.get('/zimuxia/portfolio/:id', lazyloadRouteHandler('./routes/zimuxia/portfolio'));
2549
+ // router.get('/zimuxia/:category?', lazyloadRouteHandler('./routes/zimuxia/index'));
2550
2550
 
2551
2551
  // Hugo 更新日志
2552
2552
  router.get('/hugo/releases', lazyloadRouteHandler('./routes/hugo/releases'));
@@ -2594,7 +2594,7 @@ router.get('/cbndata/information/:category?', lazyloadRouteHandler('./routes/cbn
2594
2594
  router.get('/tanchinese/:category?', lazyloadRouteHandler('./routes/tanchinese'));
2595
2595
 
2596
2596
  // Harvard
2597
- router.get('/harvard/health/blog', lazyloadRouteHandler('./routes/universities/harvard/health/blog'));
2597
+ // router.get('/harvard/health/blog', lazyloadRouteHandler('./routes/universities/harvard/health/blog'));
2598
2598
 
2599
2599
  // yuzu emulator
2600
2600
  router.get('/yuzu-emu/entry', lazyloadRouteHandler('./routes/yuzu-emu/entry'));