rsshub 1.0.0-master.fc5a2f6 → 1.0.0-master.fc648b5

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 (292) hide show
  1. package/lib/config.js +4 -0
  2. package/lib/middleware/anti-hotlink.js +90 -22
  3. package/lib/middleware/parameter.js +65 -32
  4. package/lib/middleware/templates/iframe.art +14 -0
  5. package/lib/radar-rules.js +0 -92
  6. package/lib/router.js +22 -22
  7. package/lib/routes/agefans/update.js +1 -1
  8. package/lib/routes/novel/biqugeinfo.js +2 -2
  9. package/lib/routes/universities/uestc/sice.js +12 -33
  10. package/lib/routes/weibo/user.js +10 -19
  11. package/lib/v2/19lou/index.js +74 -0
  12. package/lib/v2/19lou/maintainer.js +3 -0
  13. package/lib/v2/19lou/radar.js +29 -0
  14. package/lib/v2/19lou/router.js +3 -0
  15. package/lib/v2/36kr/router.js +1 -1
  16. package/lib/v2/36kr/user.js +47 -22
  17. package/lib/v2/acfun/article.js +100 -0
  18. package/lib/{routes → v2}/acfun/bangumi.js +7 -7
  19. package/lib/v2/acfun/maintainer.js +5 -0
  20. package/lib/v2/acfun/radar.js +25 -0
  21. package/lib/v2/acfun/router.js +5 -0
  22. package/lib/v2/acfun/video.js +45 -0
  23. package/lib/v2/agora0/index.js +54 -0
  24. package/lib/v2/agora0/maintainer.js +3 -0
  25. package/lib/v2/agora0/radar.js +13 -0
  26. package/lib/v2/agora0/router.js +3 -0
  27. package/lib/v2/apnews/maintainer.js +3 -0
  28. package/lib/v2/apnews/radar.js +13 -0
  29. package/lib/v2/apnews/router.js +3 -0
  30. package/lib/v2/apnews/templates/description.art +14 -0
  31. package/lib/v2/apnews/topics.js +44 -0
  32. package/lib/v2/appleinsider/index.js +59 -0
  33. package/lib/v2/appleinsider/maintainer.js +3 -0
  34. package/lib/v2/appleinsider/radar.js +13 -0
  35. package/lib/v2/appleinsider/router.js +3 -0
  36. package/lib/v2/cbnweek/index.js +46 -0
  37. package/lib/v2/cbnweek/maintainer.js +3 -0
  38. package/lib/v2/cbnweek/radar.js +13 -0
  39. package/lib/v2/cbnweek/router.js +3 -0
  40. package/lib/v2/ccac/news.js +12 -3
  41. package/lib/v2/cde/index.js +2 -2
  42. package/lib/v2/cde/maintainer.js +1 -0
  43. package/lib/v2/cde/radar.js +22 -4
  44. package/lib/v2/cde/router.js +1 -0
  45. package/lib/v2/cde/templates/xxgk/breakthroughCure.art +18 -0
  46. package/lib/v2/cde/templates/xxgk/cliniCal.art +16 -0
  47. package/lib/v2/cde/templates/xxgk/priorityApproval.art +18 -0
  48. package/lib/v2/cde/utils.js +2 -2
  49. package/lib/v2/cde/xxgk.js +73 -0
  50. package/lib/v2/chinadegrees/maintainer.js +3 -0
  51. package/lib/v2/chinadegrees/province.js +66 -0
  52. package/lib/v2/chinadegrees/radar.js +13 -0
  53. package/lib/v2/chinadegrees/router.js +3 -0
  54. package/lib/v2/chinadegrees/templates/description.art +4 -0
  55. package/lib/v2/cnjxol/index.js +94 -0
  56. package/lib/v2/cnjxol/maintainer.js +4 -0
  57. package/lib/v2/cnjxol/radar.js +19 -0
  58. package/lib/v2/cnjxol/router.js +3 -0
  59. package/lib/v2/cnjxol/templates/description.art +2 -0
  60. package/lib/v2/cscse/maintainer.js +3 -0
  61. package/lib/v2/cscse/radar.js +13 -0
  62. package/lib/v2/cscse/router.js +3 -0
  63. package/lib/v2/cscse/tzgg.js +54 -0
  64. package/lib/v2/dgjyw/index.js +67 -0
  65. package/lib/v2/dgjyw/maintainer.js +3 -0
  66. package/lib/v2/dgjyw/radar.js +13 -0
  67. package/lib/v2/dgjyw/router.js +3 -0
  68. package/lib/v2/domp4/detail.js +67 -0
  69. package/lib/v2/domp4/latest.js +31 -0
  70. package/lib/v2/domp4/maintainer.js +4 -0
  71. package/lib/v2/domp4/radar.js +25 -0
  72. package/lib/v2/domp4/router.js +4 -0
  73. package/lib/v2/domp4/utils.js +72 -0
  74. package/lib/v2/douyin/hashtag.js +5 -43
  75. package/lib/v2/douyin/live.js +68 -0
  76. package/lib/v2/douyin/maintainer.js +2 -0
  77. package/lib/v2/douyin/radar.js +8 -0
  78. package/lib/v2/douyin/router.js +1 -0
  79. package/lib/v2/douyin/user.js +5 -43
  80. package/lib/v2/douyin/utils.js +50 -0
  81. package/lib/v2/economist/full.js +6 -4
  82. package/lib/v2/elsevier/issue.js +62 -0
  83. package/lib/v2/elsevier/journal.js +72 -0
  84. package/lib/v2/elsevier/maintainer.js +2 -2
  85. package/lib/v2/elsevier/radar.js +5 -5
  86. package/lib/v2/elsevier/router.js +4 -2
  87. package/lib/v2/elsevier/templates/description.art +5 -5
  88. package/lib/v2/gov/beijing/jw/tzgg.js +58 -0
  89. package/lib/v2/gov/customs/list.js +21 -17
  90. package/lib/v2/gov/customs/utils.js +9 -5
  91. package/lib/v2/gov/maintainer.js +3 -0
  92. package/lib/v2/gov/nmpa/generic.js +76 -0
  93. package/lib/v2/gov/pbc/goutongjiaoliu.js +20 -15
  94. package/lib/v2/gov/pbc/tradeAnnouncement.js +18 -14
  95. package/lib/v2/gov/radar.js +57 -27
  96. package/lib/v2/gov/router.js +3 -0
  97. package/lib/v2/gov/xuzhou/hrss.js +54 -0
  98. package/lib/v2/hackertalk/index.js +23 -0
  99. package/lib/v2/hackertalk/maintainer.js +3 -0
  100. package/lib/v2/hackertalk/radar.js +13 -0
  101. package/lib/v2/hackertalk/router.js +3 -0
  102. package/lib/v2/hashnode/blog.js +62 -0
  103. package/lib/v2/hashnode/maintainer.js +3 -0
  104. package/lib/v2/hashnode/radar.js +13 -0
  105. package/lib/v2/hashnode/router.js +3 -0
  106. package/lib/v2/hashnode/templates/description.art +2 -0
  107. package/lib/v2/hdu/cs/{index.js → notice.js} +1 -4
  108. package/lib/v2/hdu/cs/pg.js +54 -0
  109. package/lib/v2/hdu/maintainer.js +1 -0
  110. package/lib/v2/hdu/radar.js +6 -0
  111. package/lib/v2/hdu/router.js +2 -1
  112. package/lib/v2/heu/gx/list.js +2 -2
  113. package/lib/v2/heu/job/list.js +2 -2
  114. package/lib/v2/heu/uae/list.js +2 -2
  115. package/lib/v2/heu/yjsy/list.js +2 -2
  116. package/lib/v2/hk01/channel.js +40 -0
  117. package/lib/{routes → v2}/hk01/hot.js +2 -1
  118. package/lib/v2/hk01/issue.js +41 -0
  119. package/lib/v2/hk01/maintainer.js +7 -0
  120. package/lib/v2/hk01/radar.js +37 -0
  121. package/lib/v2/hk01/router.js +7 -0
  122. package/lib/{routes → v2}/hk01/tag.js +2 -1
  123. package/lib/{routes → v2}/hk01/zone.js +3 -2
  124. package/lib/v2/hotukdeals/index.js +1 -1
  125. package/lib/v2/ieee/journal.js +78 -0
  126. package/lib/v2/ieee/maintainer.js +2 -2
  127. package/lib/v2/ieee/radar.js +4 -4
  128. package/lib/v2/ieee/{latestdate.js → recent.js} +34 -42
  129. package/lib/v2/ieee/router.js +4 -2
  130. package/lib/v2/ieee/templates/description.art +5 -5
  131. package/lib/v2/ielts/index.js +7 -2
  132. package/lib/v2/keep/maintainer.js +3 -0
  133. package/lib/v2/keep/radar.js +13 -0
  134. package/lib/v2/keep/router.js +3 -0
  135. package/lib/v2/keep/templates/user.art +16 -0
  136. package/lib/{routes → v2}/keep/user.js +14 -4
  137. package/lib/v2/mdpi/journal.js +65 -0
  138. package/lib/v2/mdpi/maintainer.js +3 -0
  139. package/lib/v2/mdpi/radar.js +13 -0
  140. package/lib/v2/mdpi/router.js +3 -0
  141. package/lib/v2/mdpi/templates/description.art +12 -0
  142. package/lib/v2/mindmeister/example.js +44 -0
  143. package/lib/v2/mindmeister/maintainer.js +3 -0
  144. package/lib/v2/mindmeister/radar.js +13 -0
  145. package/lib/v2/mindmeister/router.js +3 -0
  146. package/lib/v2/mindmeister/templates/image.art +1 -0
  147. package/lib/v2/mirror/index.js +34 -0
  148. package/lib/v2/mirror/maintainer.js +3 -0
  149. package/lib/v2/mirror/radar.js +17 -0
  150. package/lib/v2/mirror/router.js +3 -0
  151. package/lib/v2/nbd/radar.js +2 -2
  152. package/lib/v2/ncwu/maintainer.js +3 -0
  153. package/lib/v2/ncwu/notice.js +27 -0
  154. package/lib/v2/ncwu/radar.js +13 -0
  155. package/lib/v2/ncwu/router.js +3 -0
  156. package/lib/v2/netease/exclusive.js +148 -0
  157. package/lib/v2/netease/maintainer.js +1 -0
  158. package/lib/v2/netease/radar.js +8 -0
  159. package/lib/v2/netease/router.js +1 -0
  160. package/lib/v2/netease/templates/exclusive.art +11 -0
  161. package/lib/v2/nju/rczp.js +34 -24
  162. package/lib/v2/njust/utils.js +4 -0
  163. package/lib/v2/nuaa/utils/pypasswaf.js +4 -5
  164. package/lib/v2/nyaa/maintainer.js +4 -0
  165. package/lib/v2/nyaa/radar.js +32 -0
  166. package/lib/v2/nyaa/router.js +4 -0
  167. package/lib/{routes → v2}/nyaa/search.js +4 -2
  168. package/lib/v2/nytimes/daily_briefing_chinese.js +47 -41
  169. package/lib/v2/nytimes/index.js +3 -3
  170. package/lib/v2/nytimes/maintainer.js +1 -1
  171. package/lib/v2/nytimes/templates/image.art +3 -0
  172. package/lib/v2/nytimes/utils.js +7 -1
  173. package/lib/v2/oceanengine/arithmeticIndex.js +145 -0
  174. package/lib/v2/oceanengine/maintainer.js +3 -0
  175. package/lib/v2/oceanengine/radar.js +13 -0
  176. package/lib/v2/oceanengine/router.js +3 -0
  177. package/lib/v2/oceanengine/templates/content.art +14 -0
  178. package/lib/v2/openwrt/maintainer.js +3 -0
  179. package/lib/v2/openwrt/radar.js +13 -0
  180. package/lib/v2/openwrt/releases.js +25 -0
  181. package/lib/v2/openwrt/router.js +3 -0
  182. package/lib/v2/pincong/utils.js +7 -1
  183. package/lib/v2/pku/maintainer.js +3 -0
  184. package/lib/v2/pku/radar.js +20 -0
  185. package/lib/v2/pku/router.js +3 -0
  186. package/lib/v2/pku/ss/admission.js +53 -0
  187. package/lib/v2/pku/ss/notice.js +53 -0
  188. package/lib/v2/pku/ss/pg_admin.js +53 -0
  189. package/lib/v2/prestige-av/maintainer.js +3 -0
  190. package/lib/v2/prestige-av/radar.js +18 -0
  191. package/lib/v2/prestige-av/router.js +3 -0
  192. package/lib/{routes → v2}/prestige-av/series.js +8 -5
  193. package/lib/v2/qq/kg/cache.js +28 -0
  194. package/lib/v2/qq/kg/reply.js +21 -0
  195. package/lib/v2/qq/kg/user.js +50 -0
  196. package/lib/v2/qq/maintainer.js +2 -0
  197. package/lib/v2/qq/radar.js +14 -0
  198. package/lib/v2/qq/router.js +2 -0
  199. package/lib/v2/samsung/maintainer.js +3 -0
  200. package/lib/v2/samsung/radar.js +13 -0
  201. package/lib/v2/samsung/research/blog.js +49 -0
  202. package/lib/v2/samsung/router.js +3 -0
  203. package/lib/v2/{jasa/latest.js → scitation/journal.js} +24 -27
  204. package/lib/v2/scitation/maintainer.js +4 -0
  205. package/lib/v2/scitation/radar.js +19 -0
  206. package/lib/v2/scitation/router.js +4 -0
  207. package/lib/v2/scitation/section.js +90 -0
  208. package/lib/v2/scitation/templates/description.art +11 -0
  209. package/lib/v2/shuiguopai/index.js +76 -0
  210. package/lib/v2/shuiguopai/maintainer.js +3 -0
  211. package/lib/v2/shuiguopai/radar.js +13 -0
  212. package/lib/v2/shuiguopai/router.js +3 -0
  213. package/lib/v2/shuiguopai/templates/description.art +6 -0
  214. package/lib/v2/springer/journal.js +72 -0
  215. package/lib/v2/springer/maintainer.js +3 -0
  216. package/lib/v2/springer/radar.js +13 -0
  217. package/lib/v2/springer/router.js +3 -0
  218. package/lib/v2/springer/templates/description.art +12 -0
  219. package/lib/v2/supchina/index.js +67 -0
  220. package/lib/v2/supchina/maintainer.js +4 -0
  221. package/lib/v2/supchina/podcasts.js +66 -0
  222. package/lib/v2/supchina/radar.js +19 -0
  223. package/lib/v2/supchina/router.js +4 -0
  224. package/lib/v2/techflow520/index.js +34 -0
  225. package/lib/v2/techflow520/maintainer.js +4 -0
  226. package/lib/v2/techflow520/newsflash.js +32 -0
  227. package/lib/v2/techflow520/radar.js +19 -0
  228. package/lib/v2/techflow520/router.js +4 -0
  229. package/lib/v2/tencent/cloud/column.js +51 -0
  230. package/lib/v2/tencent/maintainer.js +1 -0
  231. package/lib/v2/tencent/radar.js +11 -0
  232. package/lib/v2/tencent/router.js +1 -0
  233. package/lib/v2/test/index.js +16 -1
  234. package/lib/v2/tiktok/user.js +28 -38
  235. package/lib/v2/trending/allTrending.js +169 -0
  236. package/lib/v2/trending/maintainer.js +3 -0
  237. package/lib/v2/trending/radar.js +35 -0
  238. package/lib/v2/trending/router.js +3 -0
  239. package/lib/v2/trending/templates/content.art +24 -0
  240. package/lib/v2/u3c3/index.js +59 -0
  241. package/lib/v2/u3c3/maintainer.js +3 -0
  242. package/lib/v2/u3c3/radar.js +29 -0
  243. package/lib/v2/u3c3/router.js +3 -0
  244. package/lib/v2/uraaka-joshi/uraaka-joshi-user.js +7 -1
  245. package/lib/v2/uraaka-joshi/uraaka-joshi.js +8 -1
  246. package/lib/v2/vlive/index.js +71 -0
  247. package/lib/v2/vlive/maintainer.js +3 -0
  248. package/lib/v2/vlive/radar.js +13 -0
  249. package/lib/v2/vlive/router.js +3 -0
  250. package/lib/v2/vlive/templates/post.art +8 -0
  251. package/lib/v2/vlive/templates/video.art +3 -0
  252. package/lib/v2/xiaohongshu/util.js +6 -6
  253. package/lib/v2/xjtu/2yuan/news.js +61 -0
  254. package/lib/v2/xjtu/dean.js +83 -0
  255. package/lib/{routes/universities → v2}/xjtu/ee.js +5 -5
  256. package/lib/{routes/universities → v2}/xjtu/gs/tzgg.js +6 -6
  257. package/lib/v2/xjtu/international.js +51 -0
  258. package/lib/v2/xjtu/job.js +81 -0
  259. package/lib/v2/xjtu/maintainer.js +9 -0
  260. package/lib/v2/xjtu/radar.js +53 -0
  261. package/lib/v2/xjtu/router.js +9 -0
  262. package/lib/v2/xjtu/std.js +58 -0
  263. package/lib/v2/xjtu/templates/attachments.art +3 -0
  264. package/lib/v2/xjtu/templates/std.art +4 -0
  265. package/lib/v2/xueqiu/column.js +42 -0
  266. package/lib/v2/xueqiu/maintainer.js +1 -0
  267. package/lib/v2/xueqiu/radar.js +6 -0
  268. package/lib/v2/xueqiu/router.js +1 -0
  269. package/lib/v2/zhangyoubao/index.js +42 -0
  270. package/lib/v2/zhangyoubao/maintainer.js +3 -0
  271. package/lib/v2/zhangyoubao/radar.js +13 -0
  272. package/lib/v2/zhangyoubao/router.js +3 -0
  273. package/lib/v2/zhangyoubao/templates/article.art +1 -0
  274. package/package.json +20 -19
  275. package/lib/routes/acfun/video.js +0 -44
  276. package/lib/routes/apnews/topics.js +0 -43
  277. package/lib/routes/dgjyw/index.js +0 -66
  278. package/lib/routes/hk01/channel.js +0 -22
  279. package/lib/routes/hk01/issue.js +0 -22
  280. package/lib/routes/mirror/entries.js +0 -80
  281. package/lib/routes/universities/ncwu/notice.js +0 -42
  282. package/lib/routes/universities/xjtu/dean.js +0 -86
  283. package/lib/routes/universities/xjtu/international.js +0 -53
  284. package/lib/routes/universities/xjtu/job.js +0 -50
  285. package/lib/v2/elsevier/latest.js +0 -87
  286. package/lib/v2/elsevier/volume.js +0 -75
  287. package/lib/v2/ieee/latestvol.js +0 -87
  288. package/lib/v2/jasa/maintainer.js +0 -4
  289. package/lib/v2/jasa/radar.js +0 -19
  290. package/lib/v2/jasa/router.js +0 -4
  291. package/lib/v2/jasa/section.js +0 -95
  292. package/lib/v2/jasa/templates/description.art +0 -11
@@ -0,0 +1,35 @@
1
+ module.exports = {
2
+ 'toutiao.com': {
3
+ _name: '今日头条',
4
+ so: [
5
+ {
6
+ title: '热搜关键词聚合追踪',
7
+ docs: 'https://docs.rsshub.app/social-media.html#re-sou-ju-he',
8
+ source: ['/search'],
9
+ target: (params, url) => `/trending/${new URL(url).searchParams.get('keyword')}`,
10
+ },
11
+ ],
12
+ },
13
+ 'weibo.com': {
14
+ _name: '微博',
15
+ s: [
16
+ {
17
+ title: '热搜关键词聚合追踪',
18
+ docs: 'https://docs.rsshub.app/social-media.html#re-sou-ju-he',
19
+ source: '/weibo/:keyword',
20
+ target: (params) => `/trending/${params.keyword}}`,
21
+ },
22
+ ],
23
+ },
24
+ 'zhihu.com': {
25
+ _name: '知乎',
26
+ www: [
27
+ {
28
+ title: '热搜关键词聚合追踪',
29
+ docs: 'https://docs.rsshub.app/social-media.html#re-sou-ju-he',
30
+ source: ['/search'],
31
+ target: (params, url) => `/trending/${new URL(url).searchParams.get('q')}`,
32
+ },
33
+ ],
34
+ },
35
+ };
@@ -0,0 +1,3 @@
1
+ module.exports = (router) => {
2
+ router.get('/:keywords/:numberOfDays?', require('./allTrending'));
3
+ };
@@ -0,0 +1,24 @@
1
+ <article>
2
+ <h2>热榜内容</h2>
3
+ {{each data channel}}
4
+ {{if channel.data.length !== 0}}
5
+ <h3>{{channel.name}}</h3>
6
+ <ul>
7
+ {{each channel.data item}}
8
+ <li>
9
+ <a href="{{item.url}}" rel="noopener noreferrer" target="_blank">{{item.title}}</a>
10
+ </li>
11
+ {{/each}}
12
+ </ul>
13
+ {{/if}}
14
+ {{/each}}
15
+ <h2>搜索关键词</h2>
16
+ {{each queries q}}
17
+ <h3>{{q.key}}</h3>
18
+ <p>
19
+ {{each q.links l}}
20
+ {{@l}}&nbsp&nbsp
21
+ {{/each}}
22
+ </p>
23
+ {{/each}}
24
+ </article>
@@ -0,0 +1,59 @@
1
+ const got = require('@/utils/got');
2
+ const cheerio = require('cheerio');
3
+
4
+ module.exports = async (ctx) => {
5
+ const type = ctx.params.type;
6
+ // should be:
7
+ // undefined
8
+ // U3C3
9
+ // Videos
10
+ // Photo
11
+ // Book
12
+ // Game
13
+ // Software
14
+ // Other
15
+ const rootURL = 'https://www.u3c3.com';
16
+ let currentURL;
17
+ let title;
18
+ if (typeof type === 'undefined') {
19
+ currentURL = rootURL;
20
+ title = 'home - u3c3';
21
+ } else if (type === 'search') {
22
+ const keyword = typeof ctx.params.keyword === 'undefined' ? '' : ctx.params.keyword;
23
+ currentURL = `${rootURL}/?search=${keyword}`;
24
+ title = `search ${keyword} - u3c3`;
25
+ } else {
26
+ currentURL = `${rootURL}/?type=${type}&p=1`;
27
+ title = `${type} - u3c3`;
28
+ }
29
+
30
+ const response = await got(currentURL);
31
+ const $ = cheerio.load(response.data);
32
+
33
+ const items = $('body > div.container > div.table-responsive > table > tbody > tr')
34
+ .toArray()
35
+ .map((item) => {
36
+ item = $(item);
37
+ const title = item.find('td:nth-of-type(2) > a ').attr('title');
38
+ const guid = rootURL + item.find('td:nth-of-type(2) > a').attr('href');
39
+ const link = guid;
40
+ const pubDate = item.find('td:nth-of-type(5)').text();
41
+ const enclosure_url = item.find('td:nth-of-type(3) > a:nth-of-type(2)').attr('href');
42
+ return {
43
+ title,
44
+ guid,
45
+ link,
46
+ pubDate,
47
+
48
+ enclosure_url,
49
+ enclosure_type: 'application/x-bittorrent',
50
+ };
51
+ });
52
+
53
+ ctx.state.data = {
54
+ title,
55
+ description: title,
56
+ link: currentURL,
57
+ item: items,
58
+ };
59
+ };
@@ -0,0 +1,3 @@
1
+ module.exports = {
2
+ '/:type?/:keyword?': ['noname1897'],
3
+ };
@@ -0,0 +1,29 @@
1
+ module.exports = {
2
+ 'u3c3.com': {
3
+ _name: 'u3c3',
4
+ '.': [
5
+ {
6
+ title: '分类',
7
+ docs: 'https://docs.rsshub.app/multimedia.html#u3c3-fen-lei',
8
+ source: '/',
9
+ target: (params, url) => {
10
+ const searchParams = new URL(url).searchParams;
11
+ const type = searchParams.has('type') ? searchParams.get('type') : '';
12
+ return `/u3c3/${type}`;
13
+ },
14
+ },
15
+ {
16
+ title: '关键词搜索',
17
+ docs: 'https://docs.rsshub.app/multimedia.html#u3c3-guan-jian-ci-sou-suo',
18
+ source: '/',
19
+ target: (params, url) => {
20
+ const searchParams = new URL(url).searchParams;
21
+ if (searchParams.has('search')) {
22
+ const keyword = searchParams.get('search');
23
+ return `/u3c3/search/${keyword}`;
24
+ }
25
+ },
26
+ },
27
+ ],
28
+ },
29
+ };
@@ -0,0 +1,3 @@
1
+ module.exports = function (router) {
2
+ router.get('/:type?/:keyword?', require('./index'));
3
+ };
@@ -11,8 +11,14 @@ module.exports = async (ctx) => {
11
11
  async () => {
12
12
  const browser = await require('@/utils/puppeteer')();
13
13
  const page = await browser.newPage();
14
+ await page.setRequestInterception(true);
15
+ page.on('request', (request) => {
16
+ request.resourceType() === 'document' || request.resourceType() === 'script' || request.resourceType() === 'fetch' ? request.continue() : request.abort();
17
+ });
14
18
 
15
- await page.goto(link);
19
+ await page.goto(link, {
20
+ waitUntil: 'domcontentloaded',
21
+ });
16
22
  await page.waitForSelector('#pickup03 .grid-cell');
17
23
  await page.waitForSelector('#pickup04 .grid-cell');
18
24
  await page.waitForSelector('#main-block .grid-cell');
@@ -8,7 +8,14 @@ module.exports = async (ctx) => {
8
8
  const browser = await require('@/utils/puppeteer')();
9
9
 
10
10
  const page = await browser.newPage();
11
- await page.goto(link);
11
+ await page.setRequestInterception(true);
12
+ page.on('request', (request) => {
13
+ request.resourceType() === 'document' || request.resourceType() === 'script' || request.resourceType() === 'fetch' ? request.continue() : request.abort();
14
+ });
15
+
16
+ await page.goto(link, {
17
+ waitUntil: 'domcontentloaded',
18
+ });
12
19
 
13
20
  await page.waitForSelector('#pickup03 .grid-cell');
14
21
  await page.waitForSelector('#pickup04 .grid-cell');
@@ -0,0 +1,71 @@
1
+ const got = require('@/utils/got');
2
+ const { JSDOM } = require('jsdom');
3
+ const { parseDate } = require('@/utils/parse-date');
4
+ const { art } = require('@/utils/render');
5
+ const path = require('path');
6
+
7
+ const baseUrl = 'https://www.vlive.tv';
8
+
9
+ module.exports = async (ctx) => {
10
+ const { channel, board } = ctx.params;
11
+ const link = `${baseUrl}/channel/${channel}/board/${board}`;
12
+
13
+ const response = await got(link);
14
+ const dom = new JSDOM(response.data, {
15
+ runScripts: 'dangerously',
16
+ });
17
+ const preloadedState = dom.window.__PRELOADED_STATE__;
18
+ const channelData = preloadedState.channel.channel;
19
+ const userCountry = preloadedState.common.userCountry;
20
+ const userLanguage = preloadedState.common.userLanguage;
21
+
22
+ const apiResponse = await got(`${baseUrl}/globalv-web/vam-web/post/v1.0/board-${board}/posts`, {
23
+ searchParams: {
24
+ appId: '8c6cc7b45d2568fb668be6e05b6e5a3b',
25
+ fields: 'attachments,author,availableActions,board{boardId,title,boardType,payRequired,includedCountries,excludedCountries},channel{channelName,channelCode},totalCommentCount,contentType,createdAt,emotionCount,excludedCountries,includedCountries,isCommentEnabled,isHiddenFromStar,lastModifierMember,notice,officialVideo,plainBody,postId,postVersion,reservation,starReactions,targetMember,thumbnail,title,url,writtenIn,sharedPosts,originPost,blindType',
26
+ sortType: 'LATEST',
27
+ limit: ctx.query.limit ? Number(ctx.query.limit) : 20,
28
+ gcc: userCountry,
29
+ locale: userLanguage,
30
+ },
31
+ headers: {
32
+ referer: link,
33
+ },
34
+ });
35
+
36
+ const items = apiResponse.data.data.map((item) => {
37
+ let description;
38
+ switch (item.contentType) {
39
+ case 'POST':
40
+ description = art(path.join(__dirname, 'templates/post.art'), {
41
+ post: item.plainBody?.replace(/\r\n/g, '<br><br>').replace(/\n/g, '<br>'),
42
+ images: item.attachments.photo,
43
+ });
44
+ break;
45
+ case 'VIDEO':
46
+ description = art(path.join(__dirname, 'templates/video.art'), {
47
+ link: item.url,
48
+ image: item.officialVideo.thumb,
49
+ });
50
+ break;
51
+ default:
52
+ throw `Unknown content type: ${item.contentType}`;
53
+ }
54
+
55
+ return {
56
+ title: item.title,
57
+ description,
58
+ link: item.url,
59
+ author: item.author.nickname,
60
+ pubDate: parseDate(item.createdAt),
61
+ };
62
+ });
63
+
64
+ ctx.state.data = {
65
+ title: `${channelData.channelName} Channel`,
66
+ description: channelData.channelDescription,
67
+ link,
68
+ image: channelData.channelProfileImage,
69
+ item: items,
70
+ };
71
+ };
@@ -0,0 +1,3 @@
1
+ module.exports = {
2
+ '/channel/:channel/board/:board': ['TonyRL'],
3
+ };
@@ -0,0 +1,13 @@
1
+ module.exports = {
2
+ 'vlive.tv': {
3
+ _name: 'V LIVE',
4
+ '.': [
5
+ {
6
+ title: 'Board',
7
+ docs: 'https://docs.rsshub.app/en/live.html#v-live',
8
+ source: '/channel/:board/board/:board',
9
+ target: '/vlive/channel/:board/board/:board',
10
+ },
11
+ ],
12
+ },
13
+ };
@@ -0,0 +1,3 @@
1
+ module.exports = (router) => {
2
+ router.get('/channel/:channel/board/:board', require('./index'));
3
+ };
@@ -0,0 +1,8 @@
1
+ {{ if post }}
2
+ {{@ post }}
3
+ {{ /if }}
4
+ {{ if images }}
5
+ {{ each images image }}
6
+ <img src="{{ image.url }}">
7
+ {{ /each }}
8
+ {{ /if }}
@@ -0,0 +1,3 @@
1
+ {{ if image }}
2
+ <a href="{{ link }}"><img src="{{ image }}"></a>
3
+ {{ /if }}
@@ -7,14 +7,14 @@ const getContent = (url, cache) =>
7
7
  const browser = await require('@/utils/puppeteer')();
8
8
  try {
9
9
  const page = await browser.newPage();
10
+ await page.setRequestInterception(true);
11
+ page.on('request', (request) => {
12
+ request.resourceType() === 'document' || request.resourceType() === 'script' || request.resourceType() === 'xhr' ? request.continue() : request.abort();
13
+ });
10
14
  await page.goto(url);
11
15
  await page.waitForSelector('.pc-container');
12
- let content = await page.content();
13
-
14
- content = content.replace('"RedAppLayout":undefined,', ''); // fix json parse
15
- const regex = /_SSR_STATE__\S*=([\s\S]+)<\/script>/gm;
16
- const match = regex.exec(content);
17
- return JSON.parse(match[1]).Main;
16
+ const initialSsrState = await page.evaluate(() => window.__INITIAL_SSR_STATE__);
17
+ return initialSsrState.Main;
18
18
  } finally {
19
19
  browser.close();
20
20
  }
@@ -0,0 +1,61 @@
1
+ const got = require('@/utils/got');
2
+ const cheerio = require('cheerio');
3
+ const timezone = require('@/utils/timezone');
4
+ const { parseDate } = require('@/utils/parse-date');
5
+
6
+ module.exports = async (ctx) => {
7
+ const id = ctx.params.id ?? '110';
8
+
9
+ const rootUrl = 'http://2yuan.xjtu.edu.cn';
10
+ const currentUrl = `${rootUrl}/Html/News/Columns/${id}/Index.html`;
11
+
12
+ const response = await got({
13
+ method: 'get',
14
+ url: currentUrl,
15
+ });
16
+
17
+ const $ = cheerio.load(response.data);
18
+
19
+ let items = $('.column_list h2')
20
+ .toArray()
21
+ .map((item) => {
22
+ item = $(item);
23
+ return {
24
+ title: item.find('a').attr('title'),
25
+ link: `${rootUrl}${item.find('a').attr('href')}`,
26
+ pubDate: timezone(parseDate(item.find('.dy_date').text()), +8),
27
+ };
28
+ });
29
+
30
+ items = await Promise.all(
31
+ items.map((item) =>
32
+ ctx.cache.tryGet(item.link, async () => {
33
+ const detailResponse = await got({
34
+ method: 'get',
35
+ url: item.link,
36
+ });
37
+
38
+ const content = cheerio.load(detailResponse.data);
39
+
40
+ item.description = content('#zoom').html();
41
+ item.pubDate = timezone(
42
+ parseDate(
43
+ content('.sub_tit3 strong')
44
+ .first()
45
+ .text()
46
+ .replace(/发布时间:/, '')
47
+ ),
48
+ +8
49
+ );
50
+
51
+ return item;
52
+ })
53
+ )
54
+ );
55
+
56
+ ctx.state.data = {
57
+ title: $('title').text(),
58
+ link: currentUrl,
59
+ item: items,
60
+ };
61
+ };
@@ -0,0 +1,83 @@
1
+ const got = require('@/utils/got');
2
+ const cheerio = require('cheerio');
3
+ const { parseDate } = require('@/utils/parse-date');
4
+ const timezone = require('@/utils/timezone');
5
+
6
+ const parseContent = (htmlString) => {
7
+ const $ = cheerio.load(htmlString);
8
+
9
+ const info = $('.detail_main_content > h1')
10
+ .contents()
11
+ .filter(function () {
12
+ return this.nodeType === 3;
13
+ })
14
+ .map(function () {
15
+ return $(this).text().trim();
16
+ })
17
+ .get();
18
+
19
+ const content = $('[id^="vsb_content"]');
20
+ $('form > div > ul a').each(function () {
21
+ $(this).appendTo(content);
22
+ $('<br>').appendTo(content);
23
+ });
24
+
25
+ return {
26
+ author: info[0] || '教务处',
27
+ description: content.html(),
28
+ };
29
+ };
30
+
31
+ module.exports = async (ctx) => {
32
+ const subpath = ctx.params.subpath;
33
+
34
+ const url = `http://dean.xjtu.edu.cn/${subpath.replace(/\.htm/g, '')}.htm`;
35
+ const base = url.split('/').slice(0, -1).join('/');
36
+
37
+ const list_response = await got(url);
38
+ const $ = cheerio.load(list_response.data);
39
+
40
+ const subname = $('em.ma-nav a')
41
+ .slice(1)
42
+ .map(function () {
43
+ return $(this).text();
44
+ })
45
+ .get()
46
+ .join(' - ');
47
+
48
+ const list = $('.list_main_content > .list-li')
49
+ .toArray()
50
+ .map((item) => {
51
+ item = $(item);
52
+ const title = item.find('a').attr('title');
53
+ const link = new URL(item.find('a').attr('href'), base).href;
54
+ return {
55
+ title,
56
+ link,
57
+ pubDate: timezone(parseDate(item.find('.list_time').text(), 'YYYY-MM-DD'), +8),
58
+ };
59
+ });
60
+
61
+ const out = await Promise.all(
62
+ list.map((item) =>
63
+ ctx.cache.tryGet(item.link, async () => {
64
+ try {
65
+ const response = await got(item.link);
66
+ const result = parseContent(response.data);
67
+
68
+ item.description = result.description;
69
+ item.author = result.author;
70
+ } catch (err) {
71
+ return item;
72
+ }
73
+ return item;
74
+ })
75
+ )
76
+ );
77
+
78
+ ctx.state.data = {
79
+ title: `西安交大教务处 - ${subname}`,
80
+ link: url,
81
+ item: out.filter((item) => item !== ''),
82
+ };
83
+ };
@@ -4,24 +4,23 @@ const { parseDate } = require('@/utils/parse-date');
4
4
  const timezone = require('@/utils/timezone');
5
5
 
6
6
  module.exports = async (ctx) => {
7
- const id = ctx.params.id || '1124';
7
+ const id = ctx.params.id ?? '1124';
8
8
  const rootUrl = `http://ee.xjtu.edu.cn/list.jsp?urltype=tree.TreeTempUrl&wbtreeid=${id}`;
9
9
  const baseUrl = 'http://ee.xjtu.edu.cn';
10
10
 
11
- const list_response = await got.get(rootUrl);
11
+ const list_response = await got(rootUrl);
12
12
  const $ = cheerio.load(list_response.data);
13
13
 
14
14
  const feed_title = $('span.windowstyle67278', "div[class='list_right fr']").text().trim();
15
15
 
16
16
  const list = $("div[class='list_right fr'] ul li")
17
- .slice(0, 10)
18
17
  .map((_, item) => {
19
18
  item = $(item);
20
19
  const a = item.find('a');
21
20
  const date = parseDate(item.find('span').text());
22
21
  return {
23
22
  title: a.text(),
24
- link: new URL(a.attr('href'), baseUrl),
23
+ link: new URL(a.attr('href'), baseUrl).href,
25
24
  pubDate: timezone(date, +8),
26
25
  };
27
26
  })
@@ -33,8 +32,9 @@ module.exports = async (ctx) => {
33
32
  item: await Promise.all(
34
33
  list.map((item) =>
35
34
  ctx.cache.tryGet(item.link, async () => {
36
- const res = await got.get(item.link);
35
+ const res = await got(item.link);
37
36
  const content = cheerio.load(res.data);
37
+ item.title = content('tr td[class^=titlestyle]').text();
38
38
  item.description = content('td.contentstyle67362', 'form').html();
39
39
  return item;
40
40
  })
@@ -1,6 +1,6 @@
1
- const url = require('url');
2
1
  const got = require('@/utils/got');
3
2
  const cheerio = require('cheerio');
3
+ const { parseDate } = require('@/utils/parse-date');
4
4
 
5
5
  module.exports = async (ctx) => {
6
6
  const rootUrl = 'http://gs.xjtu.edu.cn/tzgg.htm';
@@ -15,9 +15,9 @@ module.exports = async (ctx) => {
15
15
  item = $(item);
16
16
  const a = item.find('a');
17
17
  return {
18
- title: a.text(),
19
- link: url.resolve('http://gs.xjtu.edu.cn/', a.attr('href')),
20
- pubDate: new Date(item.find('span.time').text()).toUTCString(),
18
+ title: a.attr('title'),
19
+ link: new URL(a.attr('href'), 'http://gs.xjtu.edu.cn/').href,
20
+ pubDate: parseDate(item.find('span.time').text()),
21
21
  };
22
22
  })
23
23
  .get();
@@ -28,9 +28,9 @@ module.exports = async (ctx) => {
28
28
  item: await Promise.all(
29
29
  list.map((item) =>
30
30
  ctx.cache.tryGet(item.link, async () => {
31
- const res = await got({ method: 'get', url: item.link });
31
+ const res = await got(item.link);
32
32
  const content = cheerio.load(res.data);
33
- item.description = content('#vsb_content').html();
33
+ item.description = content('#vsb_content').html() + (content('form ul').length > 0 ? content('form ul').html() : '');
34
34
  return item;
35
35
  })
36
36
  )
@@ -0,0 +1,51 @@
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 subpath = ctx.params.subpath;
7
+ const base = 'http://international.xjtu.edu.cn';
8
+
9
+ const url = `${base}/${subpath.split('.')[0]}.htm`;
10
+ const resp = await got(url);
11
+
12
+ const $ = cheerio.load(resp.data);
13
+ const name = $('div.pageTitle').text();
14
+ const list = $('.news-list-a > .c')
15
+ .toArray()
16
+ .map((item) => {
17
+ item = $(item);
18
+ const title = item.find('a').attr('title');
19
+ const pubDate = parseDate(item.find('p.list-time').text());
20
+ const link = new URL(item.find('a').attr('href'), base).href;
21
+ return {
22
+ title,
23
+ pubDate,
24
+ link,
25
+ };
26
+ });
27
+
28
+ const item = await Promise.all(
29
+ list.map((item) =>
30
+ ctx.cache.tryGet(item.link, async () => {
31
+ if (new URL(item.link).pathname.startsWith === '/content.jsp') {
32
+ return item;
33
+ }
34
+ const resp = await got(item.link);
35
+
36
+ const $Des = cheerio.load(resp.data);
37
+ const description = $Des('div.ctnCont').html();
38
+
39
+ item.description = description;
40
+ return item;
41
+ })
42
+ )
43
+ );
44
+
45
+ ctx.state.data = {
46
+ title: `西安交通大学国际处 - ${name}`,
47
+ link: url,
48
+ description: `西安交通大学国际处 - ${name}`,
49
+ item,
50
+ };
51
+ };