rsshub 1.0.0-master.cdb6f6f → 1.0.0-master.cdc36d3

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 (345) hide show
  1. package/lib/config.js +6 -0
  2. package/lib/middleware/anti-hotlink.js +1 -0
  3. package/lib/middleware/parameter.js +2 -1
  4. package/lib/router.js +8 -8
  5. package/lib/routes/disqus/posts.js +1 -1
  6. package/lib/routes/fanfou/favorites.js +1 -1
  7. package/lib/routes/fanfou/home-timeline.js +1 -1
  8. package/lib/routes/fanfou/public-timeline.js +1 -1
  9. package/lib/routes/fanfou/user-timeline.js +1 -1
  10. package/lib/routes/gocomics/index.js +1 -1
  11. package/lib/routes/lastfm/loved.js +1 -1
  12. package/lib/routes/lastfm/recent.js +1 -1
  13. package/lib/routes/lastfm/top.js +1 -1
  14. package/lib/routes/miniflux/get-entries.js +1 -1
  15. package/lib/routes/miniflux/get-feeds.js +1 -1
  16. package/lib/routes/us/supremecourt/argument-audio.js +9 -6
  17. package/lib/v2/12306/index.js +1 -1
  18. package/lib/v2/163/music/playlist.js +1 -1
  19. package/lib/v2/4gamers/category.js +31 -0
  20. package/lib/v2/4gamers/maintainer.js +6 -0
  21. package/lib/v2/4gamers/radar.js +31 -0
  22. package/lib/v2/4gamers/router.js +6 -0
  23. package/lib/v2/4gamers/tag.js +23 -0
  24. package/lib/v2/4gamers/templates/description.art +3 -0
  25. package/lib/v2/4gamers/templates/image.art +3 -0
  26. package/lib/v2/4gamers/topic.js +22 -0
  27. package/lib/v2/4gamers/utils.js +73 -0
  28. package/lib/v2/56kog/class.js +10 -0
  29. package/lib/v2/56kog/maintainer.js +4 -0
  30. package/lib/v2/56kog/radar.js +85 -0
  31. package/lib/v2/56kog/router.js +4 -0
  32. package/lib/v2/56kog/templates/description.art +32 -0
  33. package/lib/v2/56kog/top.js +10 -0
  34. package/lib/v2/56kog/util.js +111 -0
  35. package/lib/v2/591/list.js +1 -1
  36. package/lib/v2/acfun/article.js +3 -3
  37. package/lib/v2/aisixiang/thinktank.js +1 -1
  38. package/lib/v2/alistapart/radar.js +2 -2
  39. package/lib/v2/auto-stats/index.js +65 -0
  40. package/lib/v2/auto-stats/maintainer.js +3 -0
  41. package/lib/v2/auto-stats/radar.js +35 -0
  42. package/lib/v2/auto-stats/router.js +3 -0
  43. package/lib/v2/brooklynmuseum/radar.js +1 -1
  44. package/lib/v2/bsky/posts.js +1 -1
  45. package/lib/v2/bulianglin/bulianglin.js +32 -0
  46. package/lib/v2/bulianglin/maintainer.js +3 -0
  47. package/lib/v2/bulianglin/radar.js +13 -0
  48. package/lib/v2/bulianglin/router.js +3 -0
  49. package/lib/v2/bytes/radar.js +1 -1
  50. package/lib/v2/caam/index.js +64 -0
  51. package/lib/v2/caam/maintainer.js +3 -0
  52. package/lib/v2/caam/radar.js +2677 -0
  53. package/lib/v2/caam/router.js +3 -0
  54. package/lib/v2/caixin/weekly.js +8 -2
  55. package/lib/v2/cas/genetics/index.js +63 -0
  56. package/lib/v2/cas/maintainer.js +1 -1
  57. package/lib/v2/cas/radar.js +3 -3
  58. package/lib/v2/cas/router.js +1 -1
  59. package/lib/v2/cfmmc/index.js +72 -0
  60. package/lib/v2/cfmmc/maintainer.js +3 -0
  61. package/lib/v2/cfmmc/radar.js +17 -0
  62. package/lib/v2/cfmmc/router.js +3 -0
  63. package/lib/v2/chinamoney/channels.js +57 -0
  64. package/lib/v2/chinamoney/maintainer.js +3 -0
  65. package/lib/v2/chinamoney/notice.js +61 -0
  66. package/lib/v2/chinamoney/radar.js +11 -0
  67. package/lib/v2/chinamoney/router.js +3 -0
  68. package/lib/v2/chuanliu/maintainer.js +3 -0
  69. package/lib/v2/chuanliu/nice.js +76 -0
  70. package/lib/v2/chuanliu/radar.js +13 -0
  71. package/lib/v2/chuanliu/router.js +3 -0
  72. package/lib/v2/chuanliu/templates/description.art +23 -0
  73. package/lib/v2/cna/web/index.js +1 -1
  74. package/lib/v2/cntheory/maintainer.js +3 -0
  75. package/lib/v2/cntheory/paper.js +87 -0
  76. package/lib/v2/cntheory/radar.js +13 -0
  77. package/lib/v2/cntheory/router.js +3 -0
  78. package/lib/v2/cntheory/templates/description.art +2 -0
  79. package/lib/v2/comicskingdom/index.js +1 -1
  80. package/lib/v2/cs/index.js +83 -0
  81. package/lib/v2/cs/maintainer.js +5 -0
  82. package/lib/v2/cs/radar.js +229 -0
  83. package/lib/v2/cs/router.js +13 -0
  84. package/lib/v2/cs/video.js +70 -0
  85. package/lib/v2/curiouscat/radar.js +1 -1
  86. package/lib/v2/daily/radar.js +3 -3
  87. package/lib/v2/deadline/radar.js +1 -1
  88. package/lib/v2/discord/radar.js +1 -1
  89. package/lib/v2/dnaindia/radar.js +2 -2
  90. package/lib/v2/douban/other/list.js +46 -32
  91. package/lib/v2/ehentai/favorites.js +1 -1
  92. package/lib/v2/fansly/maintainer.js +4 -0
  93. package/lib/v2/fansly/post.js +29 -0
  94. package/lib/v2/fansly/radar.js +19 -0
  95. package/lib/v2/fansly/router.js +4 -0
  96. package/lib/v2/fansly/tag.js +30 -0
  97. package/lib/v2/fansly/templates/media.art +8 -0
  98. package/lib/v2/fansly/templates/poll.art +4 -0
  99. package/lib/v2/fansly/templates/tip-goal.art +2 -0
  100. package/lib/v2/fansly/utils.js +176 -0
  101. package/lib/v2/firefox/release.js +13 -7
  102. package/lib/v2/firefox/router.js +1 -1
  103. package/lib/v2/fisher-spb/radar.js +1 -1
  104. package/lib/v2/foresightnews/util.js +1 -1
  105. package/lib/v2/free/maintainer.js +3 -0
  106. package/lib/v2/free/radar.js +13 -0
  107. package/lib/v2/free/router.js +3 -0
  108. package/lib/v2/free/rss.js +19 -0
  109. package/lib/v2/freecomputerbooks/radar.js +2 -2
  110. package/lib/v2/freewechat/profile.js +4 -2
  111. package/lib/v2/ft/radar.js +1 -1
  112. package/lib/v2/gdut/news.js +2 -2
  113. package/lib/v2/github/follower.js +1 -1
  114. package/lib/v2/github/star.js +1 -1
  115. package/lib/v2/github/starred-repos.js +1 -1
  116. package/lib/v2/gov/beijing/bjedu/gh.js +48 -0
  117. package/lib/v2/gov/maintainer.js +1 -0
  118. package/lib/v2/gov/radar.js +12 -1
  119. package/lib/v2/gov/router.js +1 -0
  120. package/lib/v2/gov/suzhou/news.js +1 -1
  121. package/lib/v2/guanhai/index.js +15 -10
  122. package/lib/v2/guokr/channel.js +1 -1
  123. package/lib/v2/hitwh/today.js +10 -2
  124. package/lib/v2/huanqiu/index.js +5 -5
  125. package/lib/v2/huggingface/daily-papers.js +10 -7
  126. package/lib/v2/huxiu/util.js +1 -1
  127. package/lib/v2/indiansinkuwait/radar.js +1 -1
  128. package/lib/v2/indienova/article.js +24 -0
  129. package/lib/v2/indienova/column.js +20 -0
  130. package/lib/v2/indienova/gamedb.js +55 -0
  131. package/lib/v2/indienova/maintainer.js +6 -0
  132. package/lib/v2/indienova/radar.js +37 -0
  133. package/lib/v2/indienova/router.js +6 -0
  134. package/lib/v2/indienova/usergames.js +42 -0
  135. package/lib/v2/indienova/utils.js +43 -0
  136. package/lib/v2/instagram/common-utils.js +1 -1
  137. package/lib/v2/iresearch/weekly.js +2 -2
  138. package/lib/v2/javlibrary/utils.js +1 -1
  139. package/lib/v2/jewishmuseum/radar.js +1 -1
  140. package/lib/v2/jiemian/lists.js +1 -1
  141. package/lib/v2/jike/topic.js +3 -0
  142. package/lib/v2/jinse/catalogue.js +101 -0
  143. package/lib/v2/jinse/lives.js +87 -0
  144. package/lib/v2/jinse/maintainer.js +5 -0
  145. package/lib/v2/jinse/radar.js +187 -0
  146. package/lib/v2/jinse/router.js +5 -0
  147. package/lib/v2/jinse/templates/description.art +34 -0
  148. package/lib/v2/jinse/timeline.js +96 -0
  149. package/lib/v2/jjwxc/author.js +68 -0
  150. package/lib/v2/jjwxc/book.js +106 -0
  151. package/lib/v2/jjwxc/maintainer.js +4 -0
  152. package/lib/v2/jjwxc/radar.js +29 -0
  153. package/lib/v2/jjwxc/router.js +4 -0
  154. package/lib/v2/jjwxc/templates/author.art +28 -0
  155. package/lib/v2/jjwxc/templates/book.art +44 -0
  156. package/lib/v2/kcna/news.js +2 -3
  157. package/lib/v2/keepass/maintainer.js +3 -0
  158. package/lib/v2/keepass/news.js +46 -0
  159. package/lib/v2/keepass/radar.js +13 -0
  160. package/lib/v2/keepass/router.js +3 -0
  161. package/lib/v2/konghq/blog-posts.js +52 -0
  162. package/lib/v2/konghq/maintainer.js +3 -0
  163. package/lib/v2/konghq/radar.js +13 -0
  164. package/lib/v2/konghq/router.js +3 -0
  165. package/lib/v2/kuwaitlocal/radar.js +2 -2
  166. package/lib/v2/laimanhua/index.js +41 -0
  167. package/lib/v2/laimanhua/maintainer.js +3 -0
  168. package/lib/v2/laimanhua/radar.js +13 -0
  169. package/lib/v2/laimanhua/router.js +3 -0
  170. package/lib/v2/layoffs/radar.js +1 -1
  171. package/lib/v2/linkedin/radar.js +1 -1
  172. package/lib/v2/lofter/tag.js +69 -34
  173. package/lib/v2/lofter/user.js +1 -1
  174. package/lib/v2/lxixsxa/radar.js +4 -4
  175. package/lib/v2/manhuagui/subscribe.js +1 -1
  176. package/lib/v2/mastodon/utils.js +1 -1
  177. package/lib/v2/metacritic/index.js +1 -1
  178. package/lib/v2/metmuseum/radar.js +1 -1
  179. package/lib/v2/mihoyo/bbs/cache.js +40 -0
  180. package/lib/v2/mihoyo/bbs/follow-list.js +50 -0
  181. package/lib/v2/mihoyo/bbs/img-ranking.js +2 -27
  182. package/lib/v2/mihoyo/bbs/official.js +3 -20
  183. package/lib/v2/mihoyo/bbs/timeline.js +41 -0
  184. package/lib/v2/mihoyo/bbs/user-post.js +32 -0
  185. package/lib/v2/mihoyo/bbs/utils.js +34 -0
  186. package/lib/v2/mihoyo/maintainer.js +3 -0
  187. package/lib/v2/mihoyo/radar.js +61 -32
  188. package/lib/v2/mihoyo/router.js +3 -0
  189. package/lib/v2/modrinth/api.d.ts +101 -0
  190. package/lib/v2/modrinth/maintainer.js +3 -0
  191. package/lib/v2/modrinth/radar.js +13 -0
  192. package/lib/v2/modrinth/router.js +3 -0
  193. package/lib/v2/modrinth/templates/version.art +8 -0
  194. package/lib/v2/modrinth/versions.js +75 -0
  195. package/lib/v2/mrm/index.js +42 -0
  196. package/lib/v2/mrm/maintainer.js +3 -0
  197. package/lib/v2/mrm/radar.js +13 -0
  198. package/lib/v2/mrm/router.js +3 -0
  199. package/lib/v2/nautil/radar.js +1 -1
  200. package/lib/v2/nber/radar.js +2 -2
  201. package/lib/v2/newmuseum/radar.js +1 -1
  202. package/lib/v2/news/maintainer.js +1 -1
  203. package/lib/v2/news/radar.js +2 -2
  204. package/lib/v2/news/router.js +2 -1
  205. package/lib/v2/news/templates/description.art +21 -0
  206. package/lib/v2/news/xhsxw.js +81 -0
  207. package/lib/v2/nju/radar.js +4 -4
  208. package/lib/v2/njust/cwc.js +1 -1
  209. package/lib/v2/njust/dgxg.js +1 -1
  210. package/lib/v2/njust/eo.js +1 -1
  211. package/lib/v2/njust/eoe.js +1 -1
  212. package/lib/v2/njust/jwc.js +1 -1
  213. package/lib/v2/notion/database.js +1 -1
  214. package/lib/v2/onehu/common.js +28 -0
  215. package/lib/v2/onehu/maintainer.js +3 -0
  216. package/lib/v2/onehu/radar.js +11 -0
  217. package/lib/v2/onehu/router.js +3 -0
  218. package/lib/v2/openai/radar.js +3 -3
  219. package/lib/v2/parliament/maintainer.js +3 -0
  220. package/lib/v2/parliament/radar.js +22 -0
  221. package/lib/v2/parliament/router.js +3 -0
  222. package/lib/v2/parliament/section77.js +161 -0
  223. package/lib/v2/pianyuan/search.js +1 -1
  224. package/lib/v2/pianyuan/utils.js +2 -2
  225. package/lib/v2/picnob/radar.js +1 -1
  226. package/lib/v2/pikabu/radar.js +3 -3
  227. package/lib/v2/pixabay/radar.js +1 -1
  228. package/lib/v2/pixiv/bookmarks.js +2 -2
  229. package/lib/v2/pixiv/illustfollow.js +2 -2
  230. package/lib/v2/pixiv/ranking.js +2 -2
  231. package/lib/v2/pixiv/search.js +2 -2
  232. package/lib/v2/pixiv/user.js +2 -2
  233. package/lib/v2/playpcesor/maintainer.js +3 -0
  234. package/lib/v2/playpcesor/radar.js +13 -0
  235. package/lib/v2/playpcesor/router.js +3 -0
  236. package/lib/v2/playpcesor/rss.js +32 -0
  237. package/lib/v2/pwc/maintainer.js +3 -0
  238. package/lib/v2/pwc/radar.js +13 -0
  239. package/lib/v2/pwc/router.js +3 -0
  240. package/lib/v2/pwc/sustainability.js +58 -0
  241. package/lib/v2/qdu/houqin.js +63 -0
  242. package/lib/v2/qdu/maintainer.js +1 -0
  243. package/lib/v2/qdu/radar.js +8 -0
  244. package/lib/v2/qdu/router.js +1 -0
  245. package/lib/v2/rarehistoricalphotos/radar.js +1 -1
  246. package/lib/v2/rattibha/radar.js +1 -1
  247. package/lib/v2/reactnewsletter/radar.js +1 -1
  248. package/lib/v2/scmp/index.js +2 -31
  249. package/lib/v2/scmp/maintainer.js +2 -0
  250. package/lib/v2/scmp/radar.js +7 -1
  251. package/lib/v2/scmp/router.js +2 -0
  252. package/lib/v2/scmp/topic.js +66 -0
  253. package/lib/v2/scmp/utils.js +32 -0
  254. package/lib/v2/secrss/author.js +18 -7
  255. package/lib/v2/secrss/category.js +19 -8
  256. package/lib/v2/secrss/maintainer.js +2 -2
  257. package/lib/v2/seekingalpha/radar.js +1 -1
  258. package/lib/v2/sehuatang/user.js +1 -1
  259. package/lib/v2/shoac/maintainer.js +3 -0
  260. package/lib/v2/shoac/radar.js +13 -0
  261. package/lib/v2/shoac/recent-show.js +72 -0
  262. package/lib/v2/shoac/router.js +3 -0
  263. package/lib/v2/shoac/templates/detail.art +25 -0
  264. package/lib/v2/smashingmagazine/radar.js +2 -2
  265. package/lib/v2/spotify/top.js +1 -1
  266. package/lib/v2/spotify/utils.js +2 -2
  267. package/lib/v2/sspai/author.js +1 -1
  268. package/lib/v2/stockedge/radar.js +1 -1
  269. package/lib/v2/stratechery/radar.js +1 -1
  270. package/lib/v2/tass/maintainer.js +3 -0
  271. package/lib/v2/tass/news.js +58 -0
  272. package/lib/v2/tass/radar.js +13 -0
  273. package/lib/v2/tass/router.js +3 -0
  274. package/lib/v2/techpowerup/radar.js +2 -2
  275. package/lib/v2/telegram/channel.js +1 -1
  276. package/lib/v2/telegram/stickerpack.js +1 -1
  277. package/lib/v2/tencent/news/author.js +34 -26
  278. package/lib/v2/tencent/templates/news/image.art +1 -1
  279. package/lib/v2/test/index.js +11 -0
  280. package/lib/v2/thehindu/radar.js +1 -1
  281. package/lib/v2/thepaper/utils.js +1 -1
  282. package/lib/v2/threads/radar.js +1 -1
  283. package/lib/v2/tiktok/radar.js +1 -1
  284. package/lib/v2/tradingview/pine.js +54 -0
  285. package/lib/v2/tradingview/radar.js +6 -0
  286. package/lib/v2/tradingview/router.js +1 -0
  287. package/lib/v2/transcriptforest/index.js +116 -0
  288. package/lib/v2/transcriptforest/maintainer.js +3 -0
  289. package/lib/v2/transcriptforest/radar.js +307 -0
  290. package/lib/v2/transcriptforest/router.js +3 -0
  291. package/lib/v2/transcriptforest/templates/description.art +23 -0
  292. package/lib/v2/twitter/likes.js +1 -1
  293. package/lib/v2/twitter/list.js +1 -1
  294. package/lib/v2/twitter/trends.js +1 -1
  295. package/lib/v2/twitter/utils.js +13 -4
  296. package/lib/v2/twitter/web-api/constants.js +6 -0
  297. package/lib/v2/twitter/web-api/login.js +183 -0
  298. package/lib/v2/twitter/web-api/media.js +2 -0
  299. package/lib/v2/twitter/web-api/search.js +2 -0
  300. package/lib/v2/twitter/web-api/token.js +44 -0
  301. package/lib/v2/twitter/web-api/tweet.js +2 -0
  302. package/lib/v2/twitter/web-api/twitter-api.js +13 -17
  303. package/lib/v2/twitter/web-api/user.js +2 -0
  304. package/lib/v2/unusualwhales/radar.js +1 -1
  305. package/lib/v2/urbandictionary/radar.js +1 -1
  306. package/lib/v2/ustc/eeis.js +1 -1
  307. package/lib/v2/ustc/gs.js +1 -1
  308. package/lib/v2/ustc/sist.js +1 -1
  309. package/lib/v2/verfghbw/radar.js +1 -1
  310. package/lib/v2/weibo/friends.js +122 -0
  311. package/lib/v2/weibo/group.js +1 -1
  312. package/lib/v2/weibo/maintainer.js +1 -0
  313. package/lib/v2/weibo/radar.js +7 -1
  314. package/lib/v2/weibo/router.js +1 -0
  315. package/lib/v2/weibo/user.js +3 -1
  316. package/lib/v2/weibo/utils.js +4 -1
  317. package/lib/v2/wmc-bj/maintainer.js +3 -0
  318. package/lib/v2/wmc-bj/publish.js +58 -0
  319. package/lib/v2/wmc-bj/radar.js +17 -0
  320. package/lib/v2/wmc-bj/router.js +3 -0
  321. package/lib/v2/wmc-bj/templates/description.art +5 -0
  322. package/lib/v2/xueqiu/hots.js +2 -1
  323. package/lib/v2/xueqiu/router.js +1 -1
  324. package/lib/v2/xueqiu/stock-comments.js +2 -2
  325. package/lib/v2/xueqiu/stock-info.js +2 -1
  326. package/lib/v2/xueqiu/user.js +2 -1
  327. package/lib/v2/yoasobi-music/radar.js +4 -4
  328. package/lib/v2/youtube/custom.js +1 -1
  329. package/lib/v2/youtube/playlist.js +1 -1
  330. package/lib/v2/youtube/subscriptions.js +1 -1
  331. package/lib/v2/zhihu/maintainer.js +1 -1
  332. package/lib/v2/zhihu/router.js +1 -1
  333. package/lib/v2/zhihu/topic.js +93 -50
  334. package/lib/v2/zhihu/utils.js +0 -1
  335. package/package.json +26 -24
  336. package/lib/routes/4gamers/category.js +0 -20
  337. package/lib/routes/4gamers/tag.js +0 -20
  338. package/lib/routes/4gamers/topic.js +0 -20
  339. package/lib/routes/cs/news.js +0 -69
  340. package/lib/routes/indienova/article.js +0 -53
  341. package/lib/routes/jinse/catalogue.js +0 -20
  342. package/lib/routes/jinse/lives.js +0 -20
  343. package/lib/routes/jinse/timeline.js +0 -21
  344. package/lib/v2/cas/genetics/xshd.js +0 -29
  345. package/lib/v2/news/whxw.js +0 -68
@@ -0,0 +1,111 @@
1
+ const got = require('@/utils/got');
2
+ const cheerio = require('cheerio');
3
+ const iconv = require('iconv-lite');
4
+ const timezone = require('@/utils/timezone');
5
+ const { parseDate } = require('@/utils/parse-date');
6
+ const { art } = require('@/utils/render');
7
+ const path = require('path');
8
+
9
+ const rootUrl = 'https://www.56kog.com';
10
+
11
+ const fetchItems = async (limit, currentUrl, tryGet) => {
12
+ const { data: response } = await got(currentUrl, {
13
+ responseType: 'buffer',
14
+ });
15
+
16
+ const $ = cheerio.load(iconv.decode(response, 'gbk'));
17
+
18
+ let items = $('p.line')
19
+ .toArray()
20
+ .map((item) => {
21
+ item = $(item);
22
+
23
+ const a = item.find('a');
24
+
25
+ return {
26
+ title: a.text(),
27
+ link: new URL(a.prop('href'), rootUrl).href,
28
+ author: item.find('span').last().text(),
29
+ };
30
+ });
31
+
32
+ items = await Promise.all(
33
+ items.map((item) =>
34
+ tryGet(item.link, async () => {
35
+ try {
36
+ const { data: detailResponse } = await got(item.link, {
37
+ responseType: 'buffer',
38
+ });
39
+
40
+ const content = cheerio.load(iconv.decode(detailResponse, 'gbk'));
41
+
42
+ const details = content('div.mohe-content p')
43
+ .toArray()
44
+ .map((detail) => {
45
+ detail = content(detail);
46
+ const as = detail.find('a');
47
+
48
+ return {
49
+ label: detail.find('span.c-l-depths').text().split(/:/)[0],
50
+ value:
51
+ as.length === 0
52
+ ? content(
53
+ detail
54
+ .contents()
55
+ .toArray()
56
+ .find((c) => c.nodeType === 3)
57
+ )
58
+ .text()
59
+ .trim()
60
+ : {
61
+ href: new URL(as.first().prop('href'), rootUrl).href,
62
+ text: as.first().text().trim(),
63
+ },
64
+ };
65
+ });
66
+
67
+ const pubDate = details.find((detail) => detail.label === '更新').value;
68
+
69
+ item.title = content('h1').contents().first().text();
70
+ item.description = art(path.join(__dirname, 'templates/description.art'), {
71
+ images: [
72
+ {
73
+ src: new URL(content('a.mohe-imgs img').prop('src'), rootUrl).href,
74
+ alt: item.title,
75
+ },
76
+ ],
77
+ details,
78
+ });
79
+ item.author = details.find((detail) => detail.label === '作者').value;
80
+ item.category = [details.find((detail) => detail.label === '状态').value, details.find((detail) => detail.label === '类型').value.text].filter(Boolean);
81
+ item.guid = `56kog-${item.link.match(/\/(\d+)\.html$/)[1]}#${pubDate}`;
82
+ item.pubDate = timezone(parseDate(pubDate), +8);
83
+ } catch {
84
+ // no-empty
85
+ }
86
+
87
+ return item;
88
+ })
89
+ )
90
+ );
91
+
92
+ const icon = new URL('favicon.ico', rootUrl).href;
93
+
94
+ return {
95
+ item: items.filter((item) => item.description).slice(0, limit),
96
+ title: $('title').text(),
97
+ link: currentUrl,
98
+ description: $('meta[name="description"]').prop('content'),
99
+ language: $('html').prop('lang'),
100
+ icon,
101
+ logo: icon,
102
+ subtitle: $('meta[name="keywords"]').prop('content'),
103
+ author: $('div.uni_footer a').text(),
104
+ allowEmpty: true,
105
+ };
106
+ };
107
+
108
+ module.exports = {
109
+ rootUrl,
110
+ fetchItems,
111
+ };
@@ -30,7 +30,7 @@ async function getToken() {
30
30
  const csrfToken = $('meta[name="csrf-token"]').attr('content');
31
31
 
32
32
  if (!csrfToken) {
33
- throw 'CSRF token not found';
33
+ throw new Error('CSRF token not found');
34
34
  }
35
35
 
36
36
  return csrfToken;
@@ -35,13 +35,13 @@ const timeRangeEnum = new Set(['all', 'oneDay', 'threeDay', 'oneWeek', 'oneMonth
35
35
  module.exports = async (ctx) => {
36
36
  const { categoryId, sortType = 'createTime', timeRange = 'all' } = ctx.params;
37
37
  if (!categoryMap[categoryId]) {
38
- throw `Invalid category Id: ${categoryId}`;
38
+ throw new Error(`Invalid category Id: ${categoryId}`);
39
39
  }
40
40
  if (!sortTypeEnum.has(sortType)) {
41
- throw `Invalid sort type: ${sortType}`;
41
+ throw new Error(`Invalid sort type: ${sortType}`);
42
42
  }
43
43
  if (!timeRangeEnum.has(timeRange)) {
44
- throw `Invalid time range: ${timeRange}`;
44
+ throw new Error(`Invalid time range: ${timeRange}`);
45
45
  }
46
46
 
47
47
  const url = `${baseUrl}/v/list${categoryId}/index.htm`;
@@ -21,7 +21,7 @@ module.exports = async (ctx) => {
21
21
  .toArray()
22
22
  .filter((h) => (type ? $(h).text() === type : true));
23
23
  if (!targetList) {
24
- throw `Not found ${type} in ${id}: ${currentUrl}`;
24
+ throw new Error(`Not found ${type} in ${id}: ${currentUrl}`);
25
25
  }
26
26
 
27
27
  for (const l of targetList) {
@@ -4,13 +4,13 @@ module.exports = {
4
4
  '.': [
5
5
  {
6
6
  title: 'Articles',
7
- docs: 'https://docs.rsshub.app/routes/en/programming#a-list-apart',
7
+ docs: 'https://docs.rsshub.app/routes/programming#a-list-apart',
8
8
  source: ['/articles/'],
9
9
  target: '/alistapart',
10
10
  },
11
11
  {
12
12
  title: 'Topics',
13
- docs: 'https://docs.rsshub.app/routes/en/programming#a-list-apart',
13
+ docs: 'https://docs.rsshub.app/routes/programming#a-list-apart',
14
14
  source: ['/blog/topic/:topic'],
15
15
  target: '/alistapart/:topic',
16
16
  },
@@ -0,0 +1,65 @@
1
+ const got = require('@/utils/got');
2
+ const cheerio = require('cheerio');
3
+ const iconv = require('iconv-lite');
4
+ const timezone = require('@/utils/timezone');
5
+ const { parseDate } = require('@/utils/parse-date');
6
+
7
+ module.exports = async (ctx) => {
8
+ const { category = 'xxkd' } = ctx.params;
9
+ const limit = ctx.query.limit ? Number.parseInt(ctx.query.limit, 10) : 30;
10
+
11
+ const rootUrl = 'http://www.auto-stats.org.cn';
12
+ const currentUrl = new URL(`${category}.asp`, rootUrl).href;
13
+
14
+ const { data: response } = await got(currentUrl, {
15
+ responseType: 'buffer',
16
+ });
17
+
18
+ const $ = cheerio.load(iconv.decode(response, 'gbk'));
19
+
20
+ let items = $('a.dnews font')
21
+ .slice(0, limit)
22
+ .toArray()
23
+ .map((item) => {
24
+ item = $(item);
25
+
26
+ const title = item.text();
27
+ const pubDate = title.match(/(\d{4}(?:\/\d{1,2}){2}\s\d{1,2}(?::\d{2}){2})/)?.[1] ?? undefined;
28
+
29
+ return {
30
+ title: title.replace(/●/, '').split(/(\d+/)[0],
31
+ link: new URL(item.parent().prop('href'), rootUrl).href,
32
+ pubDate: timezone(parseDate(pubDate, 'YYYY/M/D H:mm:ss'), +8),
33
+ };
34
+ });
35
+
36
+ items = await Promise.all(
37
+ items.map((item) =>
38
+ ctx.cache.tryGet(item.link, async () => {
39
+ const { data: detailResponse } = await got(item.link, {
40
+ responseType: 'buffer',
41
+ });
42
+
43
+ const content = cheerio.load(iconv.decode(detailResponse, 'gbk'));
44
+
45
+ item.description = content('table tbody tr td.dd').last().html();
46
+
47
+ return item;
48
+ })
49
+ )
50
+ );
51
+
52
+ const subtitle = $('title').text().split(/——/).pop();
53
+ const image = new URL('images/logo.jpg', rootUrl).href;
54
+
55
+ ctx.state.data = {
56
+ item: items,
57
+ title: $('title').text(),
58
+ link: currentUrl,
59
+ description: subtitle,
60
+ language: 'zh',
61
+ image,
62
+ subtitle,
63
+ allowEmpty: true,
64
+ };
65
+ };
@@ -0,0 +1,3 @@
1
+ module.exports = {
2
+ '/:category?': ['nczitzk'],
3
+ };
@@ -0,0 +1,35 @@
1
+ module.exports = {
2
+ 'auto-stats.org.cn': {
3
+ _name: '中国汽车工业协会统计信息网',
4
+ '.': [
5
+ {
6
+ title: '分类',
7
+ docs: 'https://docs.rsshub.app/routes/other#zhong-guo-qi-che-xie-hui-tong-ji-xin-xi-wang-fen-lei',
8
+ source: ['/:category'],
9
+ target: (params) => {
10
+ const category = params.category;
11
+
12
+ return `/auto-stats${category ? `/${category.replace(/\.asp$/, '')}` : ''}`;
13
+ },
14
+ },
15
+ {
16
+ title: '信息快递',
17
+ docs: 'https://docs.rsshub.app/routes/other#zhong-guo-qi-che-xie-hui-tong-ji-xin-xi-wang-fen-lei',
18
+ source: ['/xxkd.asp'],
19
+ target: '/auto-stats/xxkd',
20
+ },
21
+ {
22
+ title: '工作动态',
23
+ docs: 'https://docs.rsshub.app/routes/other#zhong-guo-qi-che-xie-hui-tong-ji-xin-xi-wang-fen-lei',
24
+ source: ['/gzdt.asp'],
25
+ target: '/auto-stats/gzdt',
26
+ },
27
+ {
28
+ title: '专题分析',
29
+ docs: 'https://docs.rsshub.app/routes/other#zhong-guo-qi-che-xie-hui-tong-ji-xin-xi-wang-fen-lei',
30
+ source: ['/ztfx.asp'],
31
+ target: '/auto-stats/ztfx',
32
+ },
33
+ ],
34
+ },
35
+ };
@@ -0,0 +1,3 @@
1
+ module.exports = (router) => {
2
+ router.get('/:category?', require('./'));
3
+ };
@@ -4,7 +4,7 @@ module.exports = {
4
4
  www: [
5
5
  {
6
6
  title: 'Exhibitions',
7
- docs: 'https://docs.rsshub.app/routes/en/travel#brooklyn-museum',
7
+ docs: 'https://docs.rsshub.app/routes/travel#brooklyn-museum',
8
8
  },
9
9
  ],
10
10
  },
@@ -26,7 +26,7 @@ module.exports = async (ctx) => {
26
26
 
27
27
  ctx.state.data = {
28
28
  title: `${profile.displayName} (@${profile.handle}) — Bluesky`,
29
- description: profile.description.replaceAll('\n', ' '),
29
+ description: profile.description?.replaceAll('\n', ' '),
30
30
  link: `https://bsky.app/profile/${profile.handle}`,
31
31
  image: profile.banner,
32
32
  icon: profile.avatar,
@@ -0,0 +1,32 @@
1
+ const { parseDate } = require('@/utils/parse-date');
2
+ const got = require('@/utils/got');
3
+ const cheerio = require('cheerio');
4
+
5
+ module.exports = async (ctx) => {
6
+ const url = 'https://bulianglin.com/';
7
+ const response = await got({ method: 'get', url });
8
+ const $ = cheerio.load(response.data);
9
+
10
+ const list = $('div.single-post')
11
+ .map((i, e) => {
12
+ const element = $(e);
13
+ const title = element.find('h2 > a').text();
14
+ const link = element.find('h2 > a').attr('href');
15
+ const description = element.find('p.summary').text();
16
+ const dateraw = element.find('div.text-muted').find('li').eq(1).text();
17
+
18
+ return {
19
+ title,
20
+ description,
21
+ link,
22
+ pubDate: parseDate(dateraw, 'YYYY 年 MM 月 DD 日'),
23
+ };
24
+ })
25
+ .get();
26
+
27
+ ctx.state.data = {
28
+ title: '不良林',
29
+ link: url,
30
+ item: list,
31
+ };
32
+ };
@@ -0,0 +1,3 @@
1
+ module.exports = {
2
+ '/': ['cnkmmk'],
3
+ };
@@ -0,0 +1,13 @@
1
+ module.exports = {
2
+ 'bulianglin.com': {
3
+ _name: '不良林',
4
+ '.': [
5
+ {
6
+ title: '博客',
7
+ docs: 'https://docs.rsshub.app/routes/blog#bu-liang-lin',
8
+ source: ['/'],
9
+ target: '/bulianglin',
10
+ },
11
+ ],
12
+ },
13
+ };
@@ -0,0 +1,3 @@
1
+ module.exports = function (router) {
2
+ router.get('/', require('./bulianglin'));
3
+ };
@@ -4,7 +4,7 @@ module.exports = {
4
4
  '.': [
5
5
  {
6
6
  title: 'BYTES - Your weekly dose of JS',
7
- docs: 'https://docs.rsshub.app/routes/en/programming#ui-dev-bytes',
7
+ docs: 'https://docs.rsshub.app/routes/programming#ui-dev-bytes',
8
8
  source: ['/archives', '/'],
9
9
  target: '/bytes',
10
10
  },
@@ -0,0 +1,64 @@
1
+ const got = require('@/utils/got');
2
+ const cheerio = require('cheerio');
3
+ const { parseDate } = require('@/utils/parse-date');
4
+
5
+ module.exports = async (ctx) => {
6
+ const { category = '1' } = ctx.params;
7
+ const limit = ctx.query.limit ? Number.parseInt(ctx.query.limit, 10) : 30;
8
+
9
+ const rootUrl = 'http://www.caam.org.cn';
10
+ const currentUrl = new URL(`chn/1/cate_${category}/list_1.html`, rootUrl).href;
11
+
12
+ const { data: response } = await got(currentUrl);
13
+
14
+ const $ = cheerio.load(response);
15
+
16
+ let items = $('span.cont')
17
+ .slice(0, limit)
18
+ .toArray()
19
+ .map((item) => {
20
+ item = $(item);
21
+
22
+ const a = item.parent();
23
+
24
+ return {
25
+ title: item.text(),
26
+ link: new URL(a.prop('href'), currentUrl).href,
27
+ pubDate: parseDate(a.find('span.time').text(), '[YYYY.MM.DD]'),
28
+ };
29
+ });
30
+
31
+ items = await Promise.all(
32
+ items.map((item) =>
33
+ ctx.cache.tryGet(item.link, async () => {
34
+ const { data: detailResponse } = await got(item.link);
35
+
36
+ const content = cheerio.load(detailResponse);
37
+
38
+ const infoEls = content('div.fourTop em');
39
+
40
+ item.title = content('div.fourTop h2').text();
41
+ item.description = content('div.fourBox').html();
42
+ item.author = infoEls.length <= 1 ? undefined : content('div.fourTop em').last().text();
43
+ item.pubDate = parseDate(infoEls.first().text());
44
+
45
+ return item;
46
+ })
47
+ )
48
+ );
49
+
50
+ const author = $('div.footer a').first().text();
51
+ const subtitle = $('div.topMeuns ul li a').last().text();
52
+ const image = new URL('images/header-back-7.png', rootUrl).href;
53
+
54
+ ctx.state.data = {
55
+ item: items,
56
+ title: `${author} - ${subtitle}`,
57
+ link: currentUrl,
58
+ description: $('meta[property="og:description"]').prop('content'),
59
+ language: $('html').prop('lang'),
60
+ image,
61
+ subtitle,
62
+ author,
63
+ };
64
+ };
@@ -0,0 +1,3 @@
1
+ module.exports = {
2
+ '/:category?': ['nczitzk'],
3
+ };