rsshub 1.0.0-master.d65e83a → 1.0.0-master.d72dce4

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 (301) hide show
  1. package/lib/config.js +3 -0
  2. package/lib/middleware/parameter.js +5 -3
  3. package/lib/radar-rules.js +0 -187
  4. package/lib/router.js +40 -100
  5. package/lib/routes/bookwalkertw/news.js +2 -2
  6. package/lib/routes/coolapk/utils.js +2 -0
  7. package/lib/routes/dongqiudi/result.js +13 -25
  8. package/lib/routes/dsndsht23/index.js +1 -1
  9. package/lib/routes/eastday/sh.js +4 -12
  10. package/lib/routes/ehentai/ehapi.js +0 -1
  11. package/lib/routes/{flyertea → flyert}/creditcard.js +3 -2
  12. package/lib/routes/{flyertea → flyert}/preferential.js +2 -2
  13. package/lib/routes/{flyertea → flyert}/utils.js +5 -5
  14. package/lib/routes/futunn/highlights.js +39 -37
  15. package/lib/routes/gamer/gnn_index.js +1 -1
  16. package/lib/routes/mi/youpin/new.js +13 -31
  17. package/lib/routes/mirror/entries.js +80 -0
  18. package/lib/routes/universities/sjtu/jwc.js +51 -53
  19. package/lib/routes/vgn/index.js +1 -1
  20. package/lib/routes/who/news-room.js +2 -2
  21. package/lib/routes/yxdzqb/index.js +5 -5
  22. package/lib/routes/zhihu/collection.js +26 -2
  23. package/lib/routes/zhihu/pin/utils.js +17 -7
  24. package/lib/routes/zhihu/posts.js +2 -1
  25. package/lib/routes/zhihu/topic.js +10 -2
  26. package/lib/routes/zhihu/zhuanlan.js +12 -1
  27. package/lib/v2/abmedia/category.js +30 -0
  28. package/lib/v2/abmedia/index.js +26 -0
  29. package/lib/v2/abmedia/maintainer.js +3 -0
  30. package/lib/v2/abmedia/radar.js +19 -0
  31. package/lib/v2/abmedia/router.js +4 -0
  32. package/lib/v2/acm-ecnu/contest.js +44 -0
  33. package/lib/v2/acm-ecnu/maintainer.js +3 -0
  34. package/lib/v2/acm-ecnu/radar.js +19 -0
  35. package/lib/v2/acm-ecnu/router.js +3 -0
  36. package/lib/v2/acm-ecnu/templates/description.art +3 -0
  37. package/lib/v2/agirls/index.js +71 -0
  38. package/lib/v2/agirls/maintainer.js +5 -0
  39. package/lib/v2/agirls/radar.js +25 -0
  40. package/lib/v2/agirls/router.js +5 -0
  41. package/lib/v2/agirls/templates/description.art +1 -0
  42. package/lib/v2/agirls/topic.js +71 -0
  43. package/lib/v2/agirls/topic_list.js +44 -0
  44. package/lib/v2/appledaily/index.js +69 -0
  45. package/lib/v2/appledaily/maintainer.js +3 -0
  46. package/lib/v2/appledaily/radar.js +157 -0
  47. package/lib/v2/appledaily/router.js +3 -0
  48. package/lib/v2/appledaily/templates/content.art +7 -0
  49. package/lib/v2/atcoder/contest.js +64 -0
  50. package/lib/v2/atcoder/maintainer.js +4 -0
  51. package/lib/v2/atcoder/post.js +38 -0
  52. package/lib/v2/atcoder/radar.js +22 -0
  53. package/lib/v2/atcoder/router.js +4 -0
  54. package/lib/v2/baozimh/index.js +49 -0
  55. package/lib/v2/baozimh/maintainer.js +3 -0
  56. package/lib/v2/baozimh/radar.js +13 -0
  57. package/lib/v2/baozimh/router.js +3 -0
  58. package/lib/v2/blockbeats/index.js +50 -0
  59. package/lib/v2/blockbeats/maintainer.js +3 -0
  60. package/lib/v2/blockbeats/radar.js +19 -0
  61. package/lib/v2/blockbeats/router.js +3 -0
  62. package/lib/v2/changba/maintainer.js +3 -0
  63. package/lib/v2/changba/radar.js +13 -0
  64. package/lib/v2/changba/router.js +3 -0
  65. package/lib/v2/changba/templates/work_description.art +2 -0
  66. package/lib/v2/changba/user.js +84 -0
  67. package/lib/v2/codeforces/contests.js +37 -0
  68. package/lib/v2/codeforces/maintainer.js +3 -0
  69. package/lib/v2/codeforces/radar.js +13 -0
  70. package/lib/v2/codeforces/router.js +3 -0
  71. package/lib/v2/codeforces/templates/contest.art +11 -0
  72. package/lib/v2/consumer/index.js +55 -0
  73. package/lib/v2/consumer/maintainer.js +3 -0
  74. package/lib/v2/consumer/radar.js +13 -0
  75. package/lib/v2/consumer/router.js +3 -0
  76. package/lib/{routes → v2}/dockerhub/build.js +3 -1
  77. package/lib/v2/dockerhub/maintainer.js +4 -0
  78. package/lib/v2/dockerhub/radar.js +19 -0
  79. package/lib/v2/dockerhub/router.js +4 -0
  80. package/lib/v2/dockerhub/tag.js +33 -0
  81. package/lib/v2/dockerhub/utils.js +10 -0
  82. package/lib/{routes → v2}/douban/book/rank.js +0 -0
  83. package/lib/{routes → v2}/douban/channel/subject.js +0 -0
  84. package/lib/{routes → v2}/douban/channel/topic.js +0 -0
  85. package/lib/{routes → v2}/douban/commercialpress/latest.js +0 -0
  86. package/lib/{routes → v2}/douban/event/hot.js +0 -0
  87. package/lib/v2/douban/maintainer.js +27 -0
  88. package/lib/{routes/douban → v2/douban/other}/bookstore.js +0 -0
  89. package/lib/{routes/douban → v2/douban/other}/celebrity.js +0 -0
  90. package/lib/{routes/douban → v2/douban/other}/classification.js +0 -0
  91. package/lib/{routes/douban → v2/douban/other}/doulist.js +0 -0
  92. package/lib/v2/douban/other/explore.js +50 -0
  93. package/lib/{routes/douban → v2/douban/other}/explore_column.js +0 -0
  94. package/lib/{routes/douban → v2/douban/other}/group.js +1 -1
  95. package/lib/v2/douban/other/jobs.js +33 -0
  96. package/lib/{routes/douban → v2/douban/other}/later.js +0 -0
  97. package/lib/{routes/douban → v2/douban/other}/latest_book.js +0 -0
  98. package/lib/{routes/douban → v2/douban/other}/latest_music.js +0 -0
  99. package/lib/{routes/douban → v2/douban/other}/playing.js +0 -0
  100. package/lib/{routes/douban → v2/douban/other}/replied.js +0 -0
  101. package/lib/{routes/douban → v2/douban/other}/replies.js +0 -0
  102. package/lib/{routes/douban → v2/douban/other}/topic.js +0 -0
  103. package/lib/{routes/douban → v2/douban/other}/ustop.js +0 -0
  104. package/lib/{routes/douban → v2/douban/other}/weekly_best.js +0 -0
  105. package/lib/{routes → v2}/douban/people/status.js +0 -0
  106. package/lib/{routes → v2}/douban/people/wish.js +0 -0
  107. package/lib/v2/douban/radar.js +54 -0
  108. package/lib/v2/douban/router.js +27 -0
  109. package/lib/v2/douban/templates/explore.art +7 -0
  110. package/lib/v2/dushu/fuzhou/index.js +42 -0
  111. package/lib/v2/dushu/fuzhou/templates/message.art +9 -0
  112. package/lib/v2/dushu/maintainer.js +3 -0
  113. package/lib/v2/dushu/radar.js +24 -0
  114. package/lib/v2/dushu/router.js +3 -0
  115. package/lib/v2/e-hentai/index.js +115 -0
  116. package/lib/v2/e-hentai/maintainer.js +5 -0
  117. package/lib/v2/e-hentai/radar.js +25 -0
  118. package/lib/v2/e-hentai/router.js +3 -0
  119. package/lib/v2/e-hentai/templates/images.art +3 -0
  120. package/lib/v2/ecust-jxjy/maintainer.js +3 -0
  121. package/lib/v2/ecust-jxjy/news.js +47 -0
  122. package/lib/v2/ecust-jxjy/radar.js +13 -0
  123. package/lib/v2/ecust-jxjy/router.js +3 -0
  124. package/lib/v2/epicgames/router.js +1 -1
  125. package/lib/{routes/everything → v2}/eventernote/actors.js +0 -0
  126. package/lib/v2/eventernote/maintainer.js +3 -0
  127. package/lib/v2/eventernote/radar.js +13 -0
  128. package/lib/v2/eventernote/router.js +3 -0
  129. package/lib/{routes → v2}/ezone/index.js +13 -5
  130. package/lib/v2/ezone/maintainer.js +3 -0
  131. package/lib/v2/ezone/radar.js +13 -0
  132. package/lib/v2/ezone/router.js +3 -0
  133. package/lib/v2/firefox/index.js +69 -0
  134. package/lib/v2/firefox/maintainer.js +3 -0
  135. package/lib/v2/firefox/radar.js +13 -0
  136. package/lib/v2/firefox/router.js +3 -0
  137. package/lib/v2/firefox/templates/description.art +5 -0
  138. package/lib/{routes → v2}/ft/channel.js +1 -0
  139. package/lib/v2/ft/maintainer.js +4 -0
  140. package/lib/v2/ft/myft.js +44 -0
  141. package/lib/v2/ft/radar.js +24 -0
  142. package/lib/v2/ft/router.js +4 -0
  143. package/lib/{routes → v2}/ft/utils.js +19 -19
  144. package/lib/{routes → v2}/gamer/hot.js +15 -4
  145. package/lib/v2/gamer/maintainer.js +3 -0
  146. package/lib/v2/gamer/radar.js +13 -0
  147. package/lib/v2/gamer/router.js +3 -0
  148. package/lib/{routes → v2}/github/branches.js +0 -0
  149. package/lib/v2/github/comments.js +64 -0
  150. package/lib/{routes → v2}/github/contributors.js +0 -0
  151. package/lib/{routes → v2}/github/file.js +0 -0
  152. package/lib/{routes → v2}/github/follower.js +0 -0
  153. package/lib/{routes → v2}/github/issue.js +0 -0
  154. package/lib/v2/github/maintainer.js +15 -0
  155. package/lib/{routes → v2}/github/pulls.js +0 -0
  156. package/lib/v2/github/radar.js +79 -0
  157. package/lib/{routes → v2}/github/repos.js +0 -0
  158. package/lib/v2/github/router.js +15 -0
  159. package/lib/{routes → v2}/github/search.js +0 -0
  160. package/lib/{routes → v2}/github/star.js +0 -0
  161. package/lib/{routes → v2}/github/starred_repos.js +0 -0
  162. package/lib/v2/github/templates/comments-description.art +1 -0
  163. package/lib/{routes → v2}/github/topic.js +0 -0
  164. package/lib/{routes → v2}/github/trending.js +3 -3
  165. package/lib/{routes → v2}/google/album.js +0 -0
  166. package/lib/{routes → v2}/google/citations.js +0 -0
  167. package/lib/{routes → v2}/google/doodles.js +0 -0
  168. package/lib/v2/google/fonts.js +43 -0
  169. package/lib/v2/google/maintainer.js +8 -0
  170. package/lib/{routes → v2}/google/news.js +0 -0
  171. package/lib/v2/google/radar.js +64 -0
  172. package/lib/v2/google/router.js +8 -0
  173. package/lib/{routes → v2}/google/scholar.js +0 -0
  174. package/lib/{routes → v2}/google/sites.js +0 -0
  175. package/lib/v2/google/templates/fonts.art +15 -0
  176. package/lib/v2/gov/beijing/kw/index.js +44 -0
  177. package/lib/v2/gov/maintainer.js +3 -0
  178. package/lib/v2/gov/radar.js +295 -0
  179. package/lib/v2/gov/router.js +3 -0
  180. package/lib/v2/gov/shenzhen/hrss/szksy/index.js +41 -0
  181. package/lib/v2/gov/shenzhen/zzb/index.js +40 -0
  182. package/lib/v2/hex-rays/index.js +47 -0
  183. package/lib/v2/hex-rays/maintainer.js +3 -0
  184. package/lib/v2/hex-rays/radar.js +13 -0
  185. package/lib/v2/hex-rays/router.js +3 -0
  186. package/lib/v2/hkepc/index.js +198 -0
  187. package/lib/v2/hkepc/maintainer.js +3 -0
  188. package/lib/v2/hkepc/radar.js +19 -0
  189. package/lib/v2/hkepc/router.js +3 -0
  190. package/lib/v2/hkepc/templates/description.art +1 -0
  191. package/lib/v2/hkepc/templates/image.art +1 -0
  192. package/lib/v2/houxu/index.js +85 -0
  193. package/lib/v2/houxu/maintainer.js +4 -0
  194. package/lib/v2/houxu/radar.js +19 -0
  195. package/lib/v2/houxu/router.js +3 -0
  196. package/lib/v2/houxu/templates/description.art +9 -0
  197. package/lib/v2/informs/index.js +74 -0
  198. package/lib/v2/informs/maintainer.js +3 -0
  199. package/lib/v2/informs/radar.js +109 -0
  200. package/lib/v2/informs/router.js +3 -0
  201. package/lib/v2/informs/templates/content.art +3 -0
  202. package/lib/v2/ithome/zt.js +9 -1
  203. package/lib/v2/jandan/index.js +6 -1
  204. package/lib/v2/latepost/index.js +62 -0
  205. package/lib/v2/latepost/maintainer.js +3 -0
  206. package/lib/v2/latepost/radar.js +13 -0
  207. package/lib/v2/latepost/router.js +3 -0
  208. package/lib/v2/leiphone/index.js +1 -1
  209. package/lib/v2/leiphone/radar.js +1 -1
  210. package/lib/v2/leiphone/router.js +1 -1
  211. package/lib/v2/logonews/index.js +76 -0
  212. package/lib/v2/logonews/maintainer.js +8 -0
  213. package/lib/v2/logonews/radar.js +43 -0
  214. package/lib/v2/logonews/router.js +5 -0
  215. package/lib/v2/logonews/templates/description.art +4 -0
  216. package/lib/v2/mvm/index.js +6 -6
  217. package/lib/v2/nifd/maintainer.js +3 -0
  218. package/lib/v2/nifd/radar.js +117 -0
  219. package/lib/v2/nifd/research.js +52 -0
  220. package/lib/v2/nifd/router.js +3 -0
  221. package/lib/v2/nippon/index.js +31 -0
  222. package/lib/v2/nippon/maintainer.js +3 -0
  223. package/lib/v2/nippon/radar.js +13 -0
  224. package/lib/v2/nippon/router.js +3 -0
  225. package/lib/{routes → v2}/odaily/activity.js +7 -6
  226. package/lib/v2/odaily/maintainer.js +6 -0
  227. package/lib/{routes → v2}/odaily/newsflash.js +4 -3
  228. package/lib/{routes → v2}/odaily/post.js +16 -10
  229. package/lib/v2/odaily/radar.js +60 -0
  230. package/lib/v2/odaily/router.js +6 -0
  231. package/lib/{routes → v2}/odaily/user.js +8 -7
  232. package/lib/v2/odaily/utils.js +3 -0
  233. package/lib/v2/people/index.js +83 -0
  234. package/lib/v2/people/maintainer.js +3 -0
  235. package/lib/v2/people/radar.js +9 -1
  236. package/lib/v2/people/router.js +3 -0
  237. package/lib/{routes → v2}/people/xjpjh.js +0 -0
  238. package/lib/v2/qq/ac/comic.js +43 -0
  239. package/lib/v2/qq/ac/rank.js +20 -0
  240. package/lib/v2/qq/ac/templates/description.art +9 -0
  241. package/lib/v2/qq/ac/utils.js +71 -0
  242. package/lib/v2/qq/maintainer.js +2 -0
  243. package/lib/v2/qq/radar.js +14 -0
  244. package/lib/v2/qq/router.js +2 -0
  245. package/lib/v2/radio-canada/latest.js +43 -0
  246. package/lib/v2/radio-canada/maintainer.js +3 -0
  247. package/lib/v2/radio-canada/radar.js +13 -0
  248. package/lib/v2/radio-canada/router.js +3 -0
  249. package/lib/v2/storm/index.js +57 -0
  250. package/lib/v2/storm/maintainer.js +3 -0
  251. package/lib/v2/storm/radar.js +13 -0
  252. package/lib/v2/storm/router.js +3 -0
  253. package/lib/v2/taobao/maintainer.js +3 -0
  254. package/lib/v2/taobao/radar.js +117 -0
  255. package/lib/v2/taobao/router.js +3 -0
  256. package/lib/v2/taobao/templates/zhongchou.art +4 -0
  257. package/lib/{routes → v2}/taobao/zhongchou.js +6 -7
  258. package/lib/{routes → v2}/telegram/blog.js +3 -3
  259. package/lib/{routes → v2}/telegram/channel.js +2 -1
  260. package/lib/v2/telegram/maintainer.js +5 -0
  261. package/lib/v2/telegram/radar.js +35 -0
  262. package/lib/v2/telegram/router.js +5 -0
  263. package/lib/{routes → v2}/telegram/stickerpack.js +0 -0
  264. package/lib/v2/topys/index.js +66 -0
  265. package/lib/v2/topys/maintainer.js +3 -0
  266. package/lib/v2/topys/radar.js +13 -0
  267. package/lib/v2/topys/router.js +3 -0
  268. package/lib/v2/wechat/feeddd.js +13 -5
  269. package/lib/v2/wechat/maintainer.js +1 -1
  270. package/lib/{routes/people/cpc/24h.js → v2/whoscall/index.js} +17 -14
  271. package/lib/v2/whoscall/maintainer.js +5 -0
  272. package/lib/v2/whoscall/radar.js +25 -0
  273. package/lib/v2/whoscall/router.js +3 -0
  274. package/lib/v2/zaker/index.js +65 -0
  275. package/lib/v2/zaker/maintainer.js +3 -0
  276. package/lib/v2/zaker/radar.js +19 -0
  277. package/lib/v2/zaker/router.js +3 -0
  278. package/lib/{routes → v2}/zaobao/index.js +0 -0
  279. package/lib/{routes → v2}/zaobao/interactive.js +0 -0
  280. package/lib/v2/zaobao/maintainer.js +6 -0
  281. package/lib/v2/zaobao/radar.js +28 -0
  282. package/lib/{routes → v2}/zaobao/realtime.js +3 -1
  283. package/lib/v2/zaobao/router.js +6 -0
  284. package/lib/v2/zaobao/templates/zaobao.art +17 -0
  285. package/lib/{routes → v2}/zaobao/util.js +55 -18
  286. package/lib/{routes → v2}/zaobao/znews.js +0 -3
  287. package/package.json +1 -1
  288. package/lib/routes/changba/user.js +0 -71
  289. package/lib/routes/douban/explore.js +0 -33
  290. package/lib/routes/ft/myft.js +0 -46
  291. package/lib/routes/hex-rays/index.js +0 -28
  292. package/lib/routes/hkepc/index.js +0 -164
  293. package/lib/routes/houxu/events.js +0 -27
  294. package/lib/routes/houxu/live.js +0 -39
  295. package/lib/routes/houxu/lives.js +0 -58
  296. package/lib/routes/latepost/index.js +0 -84
  297. package/lib/routes/people/env.js +0 -73
  298. package/lib/routes/people/opinion.js +0 -69
  299. package/lib/routes/topys/article.js +0 -55
  300. package/lib/routes/zaker/focusread.js +0 -65
  301. package/lib/routes/zaker/source.js +0 -66
@@ -6,24 +6,16 @@ module.exports = async (ctx) => {
6
6
  const domain = 'http://wap.eastday.com';
7
7
 
8
8
  const response = await got({
9
- method: 'post',
10
- url: `https://apin.eastday.com/api/news/list`,
11
- json: {
12
- channelId: '15',
13
- currentPage: 1,
14
- pageSize: 20,
15
- appId: '190504',
16
- deviceId: '00000000',
17
- version: '0.0.0.2',
18
- },
9
+ method: 'get',
10
+ url: `https://apin.eastday.com/apiplus/special/specialnewslistbyurl?specialUrl=1632798465040016&skipCount=0&limitCount=20`,
19
11
  });
20
12
 
21
13
  const result = await Promise.all(
22
- response.data.list.map(async (item) => {
14
+ response.data.data.list.map(async (item) => {
23
15
  const link = item.url;
24
16
  const entity = {
25
17
  title: item.title,
26
- description: item.abstracts + '...',
18
+ description: item.abstracts,
27
19
  pubDate: new Date(item.time).toUTCString(),
28
20
  link,
29
21
  };
@@ -82,7 +82,6 @@ function getBittorrent(cache, bittorrent_page_url) {
82
82
  if (match_p) {
83
83
  p = match_p[1];
84
84
  }
85
- break;
86
85
  }
87
86
  }
88
87
  }
@@ -4,7 +4,7 @@ const util = require('./utils');
4
4
  const iconv = require('iconv-lite');
5
5
 
6
6
  const gbk2utf8 = (s) => iconv.decode(s, 'gbk');
7
- const host = 'https://www.flyertea.com';
7
+ const host = 'https://www.flyert.com';
8
8
 
9
9
  module.exports = async (ctx) => {
10
10
  const bank = ctx.params.bank;
@@ -72,13 +72,14 @@ module.exports = async (ctx) => {
72
72
  });
73
73
 
74
74
  const $ = cheerio.load(gbk2utf8(response.data));
75
+
75
76
  const list = $("[id*='normalthread']").get();
76
77
 
77
78
  const result = await util.ProcessFeed(list, ctx.cache);
78
79
 
79
80
  ctx.state.data = {
80
81
  title: `飞客茶馆信用卡 - ${bankname}`,
81
- link: 'https://www.flyertea.com/',
82
+ link: 'https://www.flyert.com/',
82
83
  description: `飞客茶馆信用卡 - ${bankname}`,
83
84
  item: result,
84
85
  };
@@ -3,7 +3,7 @@ const cheerio = require('cheerio');
3
3
  const iconv = require('iconv-lite');
4
4
 
5
5
  const gbk2utf8 = (s) => iconv.decode(s, 'gbk');
6
- const host = 'https://www.flyertea.com';
6
+ const host = 'https://www.flyert.com';
7
7
  const target = `${host}/forum.php?mod=forumdisplay&sum=all&fid=all&catid=322`;
8
8
 
9
9
  module.exports = async (ctx) => {
@@ -15,7 +15,7 @@ module.exports = async (ctx) => {
15
15
  const items = $('.comiis_wzli');
16
16
  ctx.state.data = {
17
17
  title: '飞客茶馆优惠',
18
- link: 'https://www.flyertea.com/',
18
+ link: 'https://www.flyert.com/',
19
19
  description: '飞客茶馆优惠',
20
20
  item:
21
21
  items &&
@@ -32,15 +32,15 @@ async function load(link) {
32
32
  return { description };
33
33
  }
34
34
 
35
- const ProcessFeed = (list, caches) => {
36
- const host = 'https://www.flyertea.com';
35
+ const ProcessFeed = async (list, caches) => {
36
+ const host = 'https://www.flyert.com';
37
37
 
38
- return Promise.all(
38
+ return await Promise.all(
39
39
  list.map(async (item) => {
40
40
  const $ = cheerio.load(item);
41
41
 
42
42
  const $label = $(".comiis_common a[data-track='版块页主题分类']");
43
- const $title = $(".comiis_common a[data-track='版块页帖子']");
43
+ const $title = $(".comiis_common a[data-track='版块页文章']");
44
44
  // 还原相对链接为绝对链接
45
45
  const itemUrl = url.resolve(host, $title.attr('href'));
46
46
 
@@ -53,7 +53,7 @@ const ProcessFeed = (list, caches) => {
53
53
 
54
54
  // 使用tryGet方法从缓存获取内容。
55
55
  // 当缓存中无法获取到链接内容的时候,则使用load方法加载文章内容。
56
- const other = await caches.tryGet(itemUrl, () => load(itemUrl));
56
+ const other = await caches.tryGet(itemUrl, async () => await load(itemUrl));
57
57
 
58
58
  // 合并解析后的结果集作为该篇文章最终的输出结果
59
59
  return Promise.resolve(Object.assign({}, single, other));
@@ -1,56 +1,58 @@
1
1
  const got = require('@/utils/got');
2
2
  const cheerio = require('cheerio');
3
- const date_util = require('@/utils/date');
3
+ const timezone = require('@/utils/timezone');
4
+ const { parseDate } = require('@/utils/parse-date');
4
5
 
5
6
  module.exports = async (ctx) => {
6
7
  const link = `https://news.futunn.com/main`;
7
8
 
8
9
  const response = await got.get(link);
9
10
  const $ = cheerio.load(response.data);
10
- // extract json from 'window._params = {...};'
11
- const params = $('script:not([src])').html().trim().slice(17, -1);
11
+
12
+ const contents = $('script:not([src]):contains("window._params")');
13
+ const params = contents.html().trim().slice(17, -1);
12
14
 
13
15
  const newslist = JSON.parse(params).preList;
14
16
 
15
17
  const out = await Promise.all(
16
- newslist.map(async (info) => {
17
- const title = info.title;
18
- const itemUrl = info.url;
19
-
20
- const cache = await ctx.cache.get(itemUrl);
21
- if (cache) {
22
- return Promise.resolve(JSON.parse(cache));
23
- }
24
-
25
- const response = await got({
26
- url: itemUrl,
27
- method: 'get',
28
- headers: {
29
- Referer: link,
30
- },
31
- });
32
-
33
- const $ = cheerio.load(response.data);
34
-
35
- const description = $('div.newsDetailBox div.main div.inner').html() || '原文已被删除';
36
-
37
- const date = $('div.timeBar').text();
38
-
39
- const single = {
40
- title,
41
- link: itemUrl,
42
- description,
43
- pubDate: date_util(date, 8),
44
- };
45
- ctx.cache.set(itemUrl, JSON.stringify(single));
46
- return Promise.resolve(single);
47
- })
18
+ newslist
19
+ .filter((info) => {
20
+ const url = new URL(info.url);
21
+ if (url.hostname !== 'news.futunn.com') {
22
+ // ignore videos.futunn.com
23
+ return false;
24
+ } else if (url.searchParams.get('src') !== '3') {
25
+ // ignore src=12 redirecting to mp.weixin.qq.com
26
+ return false;
27
+ }
28
+ return true;
29
+ })
30
+ .map((info) =>
31
+ ctx.cache.tryGet(info.url, async () => {
32
+ const response = await got({
33
+ url: info.url,
34
+ method: 'get',
35
+ headers: {
36
+ Referer: link,
37
+ },
38
+ });
39
+
40
+ const $ = cheerio.load(response.data);
41
+ const description = $('div.newsDetailBox div.main div.inner').html();
42
+ const date = $('div.timeBar').children().remove().end().text().trim();
43
+
44
+ info.link = info.url;
45
+ info.description = description;
46
+ info.pubDate = timezone(parseDate(date, 'YYYY/MM/DD HH:mm'), +8);
47
+
48
+ return info;
49
+ })
50
+ )
48
51
  );
49
- const outfilter = out.filter((t) => t.description !== '原文已被删除');
50
52
 
51
53
  ctx.state.data = {
52
54
  title: `富途牛牛要闻`,
53
55
  link,
54
- item: outfilter,
56
+ item: out,
55
57
  };
56
58
  };
@@ -66,7 +66,7 @@ module.exports = async (ctx) => {
66
66
  }
67
67
 
68
68
  return {
69
- title: '[' + tag + '] ' + aLabelNode.text(),
69
+ title: '[' + tag + ']' + aLabelNode.text(),
70
70
  link: aLabelNode.attr('href').replace('//', 'https://'),
71
71
  };
72
72
  })
@@ -1,44 +1,26 @@
1
1
  const got = require('@/utils/got');
2
2
 
3
3
  module.exports = async (ctx) => {
4
- const sort = ctx.params.sort || '';
5
4
  const response = await got({
6
- method: 'get',
7
- url: 'https://home.mi.com/lasagne/page/1605',
5
+ method: 'post',
6
+ url: 'https://m.xiaomiyoupin.com/homepage/main/v1005',
8
7
  });
9
8
 
10
- const data = response.data.floors.filter((floor) => floor.floor_id === (sort === '' ? 25912 : 25851));
11
-
12
- const item = data.reduce((acc, item) => {
13
- if (!item.data) {
14
- return acc;
15
- }
16
- let goodsList = [];
17
-
18
- if (item.data.result) {
19
- goodsList = item.data.result.list;
20
- } else {
21
- goodsList = item.data.tabs[sort].result.list;
22
- }
23
-
24
- goodsList.forEach((goods) => {
25
- const item = goods.value.goods;
26
- const img = item.pic_url;
27
- acc.push({
28
- title: item.name,
29
- description: `<img src="${img}"><br>${item.summary}<br>价格:${item.market_price / 100}元`,
30
- link: item.jump_url,
31
- pubDate: new Date(item.first_release_time * 1000).toUTCString(),
32
- });
9
+ const items = response.data.data.homepage.floors
10
+ .filter((floor) => floor.module_key === 'product_hot')[0]
11
+ .data.items.map((item) => {
12
+ const i = item.item;
13
+ return {
14
+ title: i.name,
15
+ description: `<img src="${i.pic_url}"><br>${i.summary}<br>价格:${i.market_price / 100}元`,
16
+ link: i.jump_url,
17
+ };
33
18
  });
34
19
 
35
- return acc;
36
- }, []);
37
-
38
20
  ctx.state.data = {
39
- title: `小米有品每日上新${sort === '' ? '' : ' - ' + data[0].data.items[sort].rule}`,
21
+ title: '小米有品每日上新',
40
22
  link: 'https://m.xiaomiyoupin.com/w/newproduct?pageid=1605',
41
23
  description: '小米有品每日上新',
42
- item,
24
+ item: items,
43
25
  };
44
26
  };
@@ -0,0 +1,80 @@
1
+ const got = require('@/utils/got');
2
+ const cheerio = require('cheerio');
3
+
4
+ module.exports = async (ctx) => {
5
+ const id = ctx.params.id;
6
+ let link;
7
+ let subDomain = 0;
8
+ if (id.endsWith('.eth') || id.length === 42 || id.length === 40) {
9
+ link = 'https://mirror.xyz/' + id;
10
+ } else {
11
+ link = 'https://' + id + '.mirror.xyz';
12
+ subDomain = 1;
13
+ }
14
+
15
+ const response = await got({
16
+ method: 'get',
17
+ url: link,
18
+ });
19
+
20
+ const data = response.body;
21
+ const $ = cheerio.load(data);
22
+
23
+ const author = $('div#__next > div.GlobalNavigation > div.GlobalNavigationContainer > div > div > div > div > div > a').text();
24
+
25
+ // 标题
26
+ const article = $('h1')
27
+ .map(function () {
28
+ return $(this).text();
29
+ })
30
+ .get();
31
+
32
+ // 地址
33
+ const addr = $('h1')
34
+ .parent()
35
+ .parent()
36
+ .parent()
37
+ .map(function () {
38
+ return $(this).attr('href');
39
+ })
40
+ .get();
41
+
42
+ // 发布日期
43
+ const date = $('div#__next > div > div > div > div > div > div > div > div > div')
44
+ .map(function () {
45
+ return $(this).text();
46
+ })
47
+ .get();
48
+
49
+ // 摘要
50
+ const des = $('h1')
51
+ .parent()
52
+ .parent()
53
+ .parent()
54
+ .parent()
55
+ .next()
56
+ .next()
57
+ .map(function () {
58
+ return $(this).text();
59
+ })
60
+ .get();
61
+
62
+ const items = [];
63
+ article.forEach((item, index) => {
64
+ items.push({
65
+ title: item,
66
+ author,
67
+ description: des[index],
68
+ pubDate: date[index],
69
+ link: subDomain ? link + addr[index] : 'https://mirror.xyz' + addr[index],
70
+ });
71
+ });
72
+
73
+ const title = author + ' - Mirror';
74
+ ctx.state.data = {
75
+ title,
76
+ link,
77
+ allowEmpty: true,
78
+ item: items,
79
+ };
80
+ };
@@ -1,102 +1,100 @@
1
1
  const got = require('@/utils/got');
2
2
  const cheerio = require('cheerio');
3
- const url = require('url');
4
- const iconv = require('iconv-lite');
3
+ const { parseDate } = require('@/utils/parse-date');
5
4
 
6
- const urlRoot = 'http://www.jwc.sjtu.edu.cn/web/sjtu/';
7
-
8
- const transcode = (buffer) => {
9
- const data = iconv.decode(buffer, 'gb2312');
10
- return cheerio.load(data);
11
- };
5
+ const urlRoot = 'https://jwc.sjtu.edu.cn/xwtg';
12
6
 
13
7
  async function getFullArticle(link) {
14
- try {
15
- const response = await got({
16
- method: 'get',
17
- url: link,
18
- responseType: 'buffer',
19
- });
20
- const fullArtData = transcode(response.data);
21
- const fullArt = fullArtData('.main_r_co_fo').html();
22
- return fullArt;
23
- } catch (error) {
24
- return '<h1> 这条消息被 -1s 了 </h1>';
8
+ const response = await got(link);
9
+ const $ = cheerio.load(response.body);
10
+ const content = $('.content-con');
11
+ if (content.length === 0) {
12
+ return null;
25
13
  }
14
+ // resolve links of <img> and <a>
15
+ content.find('img').each((_, e) => {
16
+ const relativeLink = $(e).attr('src');
17
+ const absLink = new URL(relativeLink, urlRoot).href;
18
+ $(e).attr('src', absLink);
19
+ });
20
+ content.find('a').each((_, e) => {
21
+ const relativeLink = $(e).attr('href');
22
+ const absLink = new URL(relativeLink, urlRoot).href;
23
+ $(e).attr('href', absLink);
24
+ });
25
+ return content.html();
26
26
  }
27
27
 
28
28
  module.exports = async (ctx) => {
29
- const type = ctx.params.type || 'students';
29
+ const type = ctx.params.type ?? 'all';
30
30
  const config = {
31
- students: {
32
- link: '198076.htm',
33
- section: '面向学生的通知',
31
+ all: {
32
+ section: '通知通告',
33
+ link: '/tztg.htm',
34
34
  },
35
35
  news: {
36
- link: '198005.htm',
36
+ link: '/xwzx.htm',
37
37
  section: '新闻中心',
38
38
  },
39
39
  notice: {
40
- link: '198392.htm',
40
+ link: '/tztg.htm',
41
41
  section: '通知通告',
42
42
  },
43
43
  operation: {
44
- link: '198042.htm',
44
+ link: '/jxyx.htm',
45
45
  section: '教学运行',
46
46
  },
47
47
  affairs: {
48
- link: '198043.htm',
48
+ link: '/zcxw.htm',
49
49
  section: '注册学务',
50
50
  },
51
51
  yjb: {
52
- link: '198044.htm',
52
+ link: '/yjb.htm',
53
53
  section: '研究办',
54
54
  },
55
55
  jgb: {
56
- link: '198046.htm',
56
+ link: '/jgb.htm',
57
57
  section: '教改办',
58
58
  },
59
59
  zhb: {
60
- link: '198047.htm',
60
+ link: '/zhb.htm',
61
61
  section: '综合办',
62
62
  },
63
+ language: {
64
+ link: '/yywz.htm',
65
+ section: '语言文字',
66
+ },
63
67
  party: {
64
- link: '198097.htm',
68
+ link: '/ghyzb.htm',
65
69
  section: '工会与支部',
66
70
  },
71
+ ge: {
72
+ link: '/tsjy.htm',
73
+ section: '通识教育',
74
+ },
67
75
  };
68
76
 
69
- const sectionLink = url.resolve(urlRoot, config[type].link);
77
+ const sectionLink = urlRoot + config[type].link;
70
78
 
71
79
  const response = await got({
72
80
  method: 'get',
73
81
  url: sectionLink,
74
- responseType: 'buffer',
75
82
  });
76
83
 
77
- const $ = transcode(response.data);
84
+ const $ = cheerio.load(response.body);
78
85
 
79
86
  const out = await Promise.all(
80
- $('.main_r_xuxian')
81
- .find('tr')
82
- .slice(0, 10)
87
+ $('body > div.list-box > div.container > div > div.ny_right > div > div.ny_right_con > div > ul')
88
+ .find('li')
83
89
  .map(async (i, e) => {
84
- const title = $(e)
85
- .find('a')
86
- .text()
87
- .replace(/[\r\n]/g, ' ');
88
- const relativeLink = $(e).find('a').attr('href');
89
- const link = url.resolve(sectionLink, relativeLink);
90
- const date = new Date(
91
- $(e)
92
- .children('td')
93
- .eq(-1)
94
- .text()
95
- .match(/\d{4}-\d{2}-\d{2}/)[0]
96
- );
97
- const timeZone = 8;
98
- const serverOffset = date.getTimezoneOffset() / 60;
99
- const pubDate = new Date(date.getTime() - 60 * 60 * 1000 * (timeZone + serverOffset)).toUTCString();
90
+ const info = $(e).find('.wz');
91
+ const relativeLink = info.find('a').attr('href');
92
+ const link = new URL(relativeLink, sectionLink).href;
93
+ const title = info.find('a > h2').text();
94
+ const timeElement = $(e).find('.sj');
95
+ const day = timeElement.find('h2').text();
96
+ const yearAndMonth = timeElement.find('p').text();
97
+ const pubDate = parseDate(`${yearAndMonth}.${day}`, 'YYYY.MM.DD');
100
98
  const description = await ctx.cache.tryGet(link, () => getFullArticle(link));
101
99
  const single = {
102
100
  title,
@@ -21,7 +21,7 @@ module.exports = async (ctx) => {
21
21
  title: item.title,
22
22
  description: item.content,
23
23
  pubDate: new Date(item.release_time * 1000).toUTCString(),
24
- link: `https://vgn.cn/detail/${item.id}`,
24
+ link: `https://vgn.cn/article/news/${item.id}`,
25
25
  })),
26
26
  };
27
27
  };
@@ -1,7 +1,7 @@
1
1
  const got = require('@/utils/got');
2
2
  const cheerio = require('cheerio');
3
3
  const url = require('url');
4
- const date = require('@/utils/date');
4
+ const { parseDate } = require('@/utils/parse-date');
5
5
 
6
6
  const host = 'https://www.who.int/';
7
7
 
@@ -20,7 +20,7 @@ module.exports = async (ctx) => {
20
20
  const $elem = $(elem);
21
21
  const title = $elem.find('p').text();
22
22
  const link = url.resolve(host, $elem.find('a').attr('href'));
23
- const pubDate = date($elem.find('.timestamp').text());
23
+ const pubDate = parseDate($elem.find('.timestamp').text(), 'YYYY年M月D日');
24
24
 
25
25
  const item = {
26
26
  title,
@@ -5,11 +5,11 @@ const cheerio = require('cheerio');
5
5
  const host = 'https://www.yxdzqb.com';
6
6
 
7
7
  const map = {
8
- new: 'index_r.html',
9
- hot: 'index1.html',
10
- hot_chinese: 'index_1c.html',
11
- low: 'index2.html',
12
- low_chinese: 'index_2c.html',
8
+ new: 'index_discount.html',
9
+ hot: 'index_popular.html',
10
+ hot_chinese: 'index_popular_cn.html',
11
+ low: 'index_low.html',
12
+ low_chinese: 'index_low_cn.html',
13
13
  };
14
14
 
15
15
  module.exports = async (ctx) => {
@@ -5,6 +5,7 @@ const { generateData } = require('./pin/utils');
5
5
 
6
6
  module.exports = async (ctx) => {
7
7
  const id = ctx.params.id;
8
+ const getAll = ctx.params.getAll;
8
9
 
9
10
  const response = await got({
10
11
  method: 'get',
@@ -17,6 +18,29 @@ module.exports = async (ctx) => {
17
18
 
18
19
  const list = response.data.data;
19
20
 
21
+ if (getAll) {
22
+ const totals = response.data.paging.totals;
23
+
24
+ const offsetList = [...new Array(Math.round(totals / 20)).keys()].map((item) => item * 20).slice(1);
25
+ const otherList = await Promise.all(
26
+ offsetList.map((offset) =>
27
+ ctx.cache.tryGet(`https://www.zhihu.com/api/v4/collections/${id}/items?offset=${offset}&limit=20`, async () => {
28
+ const response = await got({
29
+ method: 'get',
30
+ url: `https://www.zhihu.com/api/v4/collections/${id}/items?offset=${offset}&limit=20`,
31
+ headers: {
32
+ ...utils.header,
33
+ Referer: `https://www.zhihu.com/collection/${id}`,
34
+ },
35
+ });
36
+
37
+ return response.data.data;
38
+ })
39
+ )
40
+ ).then((item) => item.flat());
41
+ list.push(...otherList);
42
+ }
43
+
20
44
  const response2 = await got({
21
45
  method: 'get',
22
46
  url: `https://www.zhihu.com/collection/${id}`,
@@ -42,9 +66,9 @@ module.exports = async (ctx) => {
42
66
  item.content.type === 'pin'
43
67
  ? generateDataPin(item)
44
68
  : {
45
- title: item.content.type === 'article' ? item.content.title : item.content.question.title,
69
+ title: item.content.type === 'article' || item.content.type === 'zvideo' ? item.content.title : item.content.question.title,
46
70
  link: item.content.url,
47
- description: item.content.content,
71
+ description: item.content.type === 'zvideo' ? `<img src=${item.content.video.url}/>` : item.content.content,
48
72
  pubDate: new Date((item.content.type === 'article' ? item.content.updated : item.content.updated_time) * 1000).toUTCString(),
49
73
  }
50
74
  ),
@@ -17,13 +17,23 @@ module.exports = {
17
17
  break;
18
18
 
19
19
  case 'video':
20
- description += `<video
21
- controls="controls"
22
- width="${item.playlist.hd.width}"
23
- height="${item.playlist.hd.height}"
24
- poster="${item.cover_info.thumbnail}"
25
- src="${item.playlist.hd.play_url}"
26
- >`;
20
+ try {
21
+ description += `<video
22
+ controls="controls"
23
+ width="${item.playlist.hd.width}"
24
+ height="${item.playlist.hd.height}"
25
+ poster="${item.cover_info.thumbnail}"
26
+ src="${item.playlist.hd.play_url}"
27
+ >`;
28
+ } catch (e) {
29
+ description += `<video
30
+ controls="controls"
31
+ width="${item.playlist.pop().width}"
32
+ height="${item.playlist.pop().height}"
33
+ poster="${item.thumbnail}"
34
+ src="${item.playlist.pop().play_url}"
35
+ >`;
36
+ }
27
37
  break;
28
38
 
29
39
  case 'link':
@@ -1,6 +1,7 @@
1
1
  const got = require('@/utils/got');
2
2
  const utils = require('./utils');
3
3
  const cheerio = require('cheerio');
4
+ const { parseDate } = require('@/utils/parse-date');
4
5
 
5
6
  module.exports = async (ctx) => {
6
7
  const id = ctx.params.id;
@@ -38,7 +39,7 @@ module.exports = async (ctx) => {
38
39
  title: String(item.title),
39
40
  description: item.content,
40
41
  link: item.url,
41
- pubDate: new Date(item.updated).toUTCString(),
42
+ pubDate: parseDate(item.updated * 1000),
42
43
  })),
43
44
  };
44
45
  };