@ttkit/daily-hot-api 0.0.0-stage → 0.1.1

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 (450) hide show
  1. package/.env.example +77 -0
  2. package/LICENSE +21 -0
  3. package/README.md +317 -2
  4. package/bin/daily-hot-api.js +25 -0
  5. package/dist/app.controller.d.ts +41 -0
  6. package/dist/app.controller.js +91 -0
  7. package/dist/app.controller.js.map +1 -0
  8. package/dist/app.module.d.ts +4 -0
  9. package/dist/app.module.js +44 -0
  10. package/dist/app.module.js.map +1 -0
  11. package/dist/app.service.d.ts +19 -0
  12. package/dist/app.service.js +57 -0
  13. package/dist/app.service.js.map +1 -0
  14. package/dist/cache/cache.module.d.ts +2 -0
  15. package/dist/cache/cache.module.js +52 -0
  16. package/dist/cache/cache.module.js.map +1 -0
  17. package/dist/cache/cache.service.d.ts +26 -0
  18. package/dist/cache/cache.service.js +163 -0
  19. package/dist/cache/cache.service.js.map +1 -0
  20. package/dist/cli/args.d.ts +24 -0
  21. package/dist/cli/args.js +261 -0
  22. package/dist/cli/args.js.map +1 -0
  23. package/dist/cli/commands/logs.d.ts +3 -0
  24. package/dist/cli/commands/logs.js +55 -0
  25. package/dist/cli/commands/logs.js.map +1 -0
  26. package/dist/cli/commands/restart.d.ts +3 -0
  27. package/dist/cli/commands/restart.js +62 -0
  28. package/dist/cli/commands/restart.js.map +1 -0
  29. package/dist/cli/commands/start.d.ts +3 -0
  30. package/dist/cli/commands/start.js +280 -0
  31. package/dist/cli/commands/start.js.map +1 -0
  32. package/dist/cli/commands/status.d.ts +3 -0
  33. package/dist/cli/commands/status.js +78 -0
  34. package/dist/cli/commands/status.js.map +1 -0
  35. package/dist/cli/commands/stop.d.ts +12 -0
  36. package/dist/cli/commands/stop.js +135 -0
  37. package/dist/cli/commands/stop.js.map +1 -0
  38. package/dist/cli/context.d.ts +4 -0
  39. package/dist/cli/context.js +3 -0
  40. package/dist/cli/context.js.map +1 -0
  41. package/dist/cli/env.d.ts +2 -0
  42. package/dist/cli/env.js +80 -0
  43. package/dist/cli/env.js.map +1 -0
  44. package/dist/cli/errors.d.ts +14 -0
  45. package/dist/cli/errors.js +25 -0
  46. package/dist/cli/errors.js.map +1 -0
  47. package/dist/cli/health.d.ts +2 -0
  48. package/dist/cli/health.js +44 -0
  49. package/dist/cli/health.js.map +1 -0
  50. package/dist/cli/help.d.ts +3 -0
  51. package/dist/cli/help.js +158 -0
  52. package/dist/cli/help.js.map +1 -0
  53. package/dist/cli/index.d.ts +2 -0
  54. package/dist/cli/index.js +94 -0
  55. package/dist/cli/index.js.map +1 -0
  56. package/dist/cli/log-file.d.ts +8 -0
  57. package/dist/cli/log-file.js +58 -0
  58. package/dist/cli/log-file.js.map +1 -0
  59. package/dist/cli/output.d.ts +7 -0
  60. package/dist/cli/output.js +46 -0
  61. package/dist/cli/output.js.map +1 -0
  62. package/dist/cli/paths.d.ts +33 -0
  63. package/dist/cli/paths.js +76 -0
  64. package/dist/cli/paths.js.map +1 -0
  65. package/dist/cli/run-state.d.ts +25 -0
  66. package/dist/cli/run-state.js +159 -0
  67. package/dist/cli/run-state.js.map +1 -0
  68. package/dist/common/middlewares/logger.middleware.d.ts +7 -0
  69. package/dist/common/middlewares/logger.middleware.js +29 -0
  70. package/dist/common/middlewares/logger.middleware.js.map +1 -0
  71. package/dist/config/config.module.d.ts +2 -0
  72. package/dist/config/config.module.js +47 -0
  73. package/dist/config/config.module.js.map +1 -0
  74. package/dist/config/configuration.d.ts +3 -0
  75. package/dist/config/configuration.js +5 -0
  76. package/dist/config/configuration.js.map +1 -0
  77. package/dist/config/validation.schema.d.ts +114 -0
  78. package/dist/config/validation.schema.js +69 -0
  79. package/dist/config/validation.schema.js.map +1 -0
  80. package/dist/daily-brief/clients/ai-analysis.client.d.ts +20 -0
  81. package/dist/daily-brief/clients/ai-analysis.client.js +217 -0
  82. package/dist/daily-brief/clients/ai-analysis.client.js.map +1 -0
  83. package/dist/daily-brief/clients/brief-search.service.d.ts +11 -0
  84. package/dist/daily-brief/clients/brief-search.service.js +52 -0
  85. package/dist/daily-brief/clients/brief-search.service.js.map +1 -0
  86. package/dist/daily-brief/clients/deepseek-search.client.d.ts +11 -0
  87. package/dist/daily-brief/clients/deepseek-search.client.js +70 -0
  88. package/dist/daily-brief/clients/deepseek-search.client.js.map +1 -0
  89. package/dist/daily-brief/clients/tavily-search.client.d.ts +11 -0
  90. package/dist/daily-brief/clients/tavily-search.client.js +72 -0
  91. package/dist/daily-brief/clients/tavily-search.client.js.map +1 -0
  92. package/dist/daily-brief/daily-brief.config.d.ts +31 -0
  93. package/dist/daily-brief/daily-brief.config.js +108 -0
  94. package/dist/daily-brief/daily-brief.config.js.map +1 -0
  95. package/dist/daily-brief/daily-brief.controller.d.ts +72 -0
  96. package/dist/daily-brief/daily-brief.controller.js +169 -0
  97. package/dist/daily-brief/daily-brief.controller.js.map +1 -0
  98. package/dist/daily-brief/daily-brief.module.d.ts +2 -0
  99. package/dist/daily-brief/daily-brief.module.js +49 -0
  100. package/dist/daily-brief/daily-brief.module.js.map +1 -0
  101. package/dist/daily-brief/daily-brief.scheduler.d.ts +30 -0
  102. package/dist/daily-brief/daily-brief.scheduler.js +113 -0
  103. package/dist/daily-brief/daily-brief.scheduler.js.map +1 -0
  104. package/dist/daily-brief/daily-brief.service.d.ts +101 -0
  105. package/dist/daily-brief/daily-brief.service.js +412 -0
  106. package/dist/daily-brief/daily-brief.service.js.map +1 -0
  107. package/dist/daily-brief/dto/brief-date-param.dto.d.ts +3 -0
  108. package/dist/daily-brief/dto/brief-date-param.dto.js +23 -0
  109. package/dist/daily-brief/dto/brief-date-param.dto.js.map +1 -0
  110. package/dist/daily-brief/dto/generate-brief.dto.d.ts +6 -0
  111. package/dist/daily-brief/dto/generate-brief.dto.js +39 -0
  112. package/dist/daily-brief/dto/generate-brief.dto.js.map +1 -0
  113. package/dist/daily-brief/dto/list-briefs-query.dto.d.ts +6 -0
  114. package/dist/daily-brief/dto/list-briefs-query.dto.js +42 -0
  115. package/dist/daily-brief/dto/list-briefs-query.dto.js.map +1 -0
  116. package/dist/daily-brief/dto/stock-ranking-query.dto.d.ts +6 -0
  117. package/dist/daily-brief/dto/stock-ranking-query.dto.js +46 -0
  118. package/dist/daily-brief/dto/stock-ranking-query.dto.js.map +1 -0
  119. package/dist/daily-brief/interfaces/daily-brief.interface.d.ts +59 -0
  120. package/dist/daily-brief/interfaces/daily-brief.interface.js +3 -0
  121. package/dist/daily-brief/interfaces/daily-brief.interface.js.map +1 -0
  122. package/dist/daily-brief/interfaces/search-provider.interface.d.ts +11 -0
  123. package/dist/daily-brief/interfaces/search-provider.interface.js +3 -0
  124. package/dist/daily-brief/interfaces/search-provider.interface.js.map +1 -0
  125. package/dist/daily-brief/utils/brief-date.d.ts +2 -0
  126. package/dist/daily-brief/utils/brief-date.js +16 -0
  127. package/dist/daily-brief/utils/brief-date.js.map +1 -0
  128. package/dist/daily-brief/utils/concurrency.d.ts +1 -0
  129. package/dist/daily-brief/utils/concurrency.js +20 -0
  130. package/dist/daily-brief/utils/concurrency.js.map +1 -0
  131. package/dist/database/database.module.d.ts +2 -0
  132. package/dist/database/database.module.js +57 -0
  133. package/dist/database/database.module.js.map +1 -0
  134. package/dist/database/repositories/daily-brief.repository.d.ts +96 -0
  135. package/dist/database/repositories/daily-brief.repository.js +457 -0
  136. package/dist/database/repositories/daily-brief.repository.js.map +1 -0
  137. package/dist/database/repositories/hot-item.repository.d.ts +52 -0
  138. package/dist/database/repositories/hot-item.repository.js +255 -0
  139. package/dist/database/repositories/hot-item.repository.js.map +1 -0
  140. package/dist/database/repositories/source-config.repository.d.ts +15 -0
  141. package/dist/database/repositories/source-config.repository.js +77 -0
  142. package/dist/database/repositories/source-config.repository.js.map +1 -0
  143. package/dist/database/schemas/daily-brief.schema.d.ts +30 -0
  144. package/dist/database/schemas/daily-brief.schema.js +103 -0
  145. package/dist/database/schemas/daily-brief.schema.js.map +1 -0
  146. package/dist/database/schemas/hot-item.schema.d.ts +20 -0
  147. package/dist/database/schemas/hot-item.schema.js +72 -0
  148. package/dist/database/schemas/hot-item.schema.js.map +1 -0
  149. package/dist/database/schemas/source-config.schema.d.ts +15 -0
  150. package/dist/database/schemas/source-config.schema.js +47 -0
  151. package/dist/database/schemas/source-config.schema.js.map +1 -0
  152. package/dist/history/dto/history-response.dto.d.ts +17 -0
  153. package/dist/history/dto/history-response.dto.js +13 -0
  154. package/dist/history/dto/history-response.dto.js.map +1 -0
  155. package/dist/history/dto/search-history.dto.d.ts +10 -0
  156. package/dist/history/dto/search-history.dto.js +72 -0
  157. package/dist/history/dto/search-history.dto.js.map +1 -0
  158. package/dist/history/history.controller.d.ts +13 -0
  159. package/dist/history/history.controller.js +92 -0
  160. package/dist/history/history.controller.js.map +1 -0
  161. package/dist/history/history.module.d.ts +2 -0
  162. package/dist/history/history.module.js +25 -0
  163. package/dist/history/history.module.js.map +1 -0
  164. package/dist/history/history.service.d.ts +15 -0
  165. package/dist/history/history.service.js +68 -0
  166. package/dist/history/history.service.js.map +1 -0
  167. package/dist/host-lists/decorators/hot-source.decorator.d.ts +9 -0
  168. package/dist/host-lists/decorators/hot-source.decorator.js +11 -0
  169. package/dist/host-lists/decorators/hot-source.decorator.js.map +1 -0
  170. package/dist/host-lists/dto/hot-list.dto.d.ts +14 -0
  171. package/dist/host-lists/dto/hot-list.dto.js +94 -0
  172. package/dist/host-lists/dto/hot-list.dto.js.map +1 -0
  173. package/dist/host-lists/hot-lists.controller.d.ts +39 -0
  174. package/dist/host-lists/hot-lists.controller.js +87 -0
  175. package/dist/host-lists/hot-lists.controller.js.map +1 -0
  176. package/dist/host-lists/hot-lists.module.d.ts +2 -0
  177. package/dist/host-lists/hot-lists.module.js +36 -0
  178. package/dist/host-lists/hot-lists.module.js.map +1 -0
  179. package/dist/host-lists/hot-lists.service.d.ts +21 -0
  180. package/dist/host-lists/hot-lists.service.js +115 -0
  181. package/dist/host-lists/hot-lists.service.js.map +1 -0
  182. package/dist/host-lists/interfaces/hot-list-source.interface.d.ts +5 -0
  183. package/dist/host-lists/interfaces/hot-list-source.interface.js +3 -0
  184. package/dist/host-lists/interfaces/hot-list-source.interface.js.map +1 -0
  185. package/dist/host-lists/interfaces/hot-list.interface.d.ts +31 -0
  186. package/dist/host-lists/interfaces/hot-list.interface.js +3 -0
  187. package/dist/host-lists/interfaces/hot-list.interface.js.map +1 -0
  188. package/dist/host-lists/interfaces/router-data.interface.d.ts +19 -0
  189. package/dist/host-lists/interfaces/router-data.interface.js +3 -0
  190. package/dist/host-lists/interfaces/router-data.interface.js.map +1 -0
  191. package/dist/host-lists/sources/36kr.source.d.ts +9 -0
  192. package/dist/host-lists/sources/36kr.source.js +89 -0
  193. package/dist/host-lists/sources/36kr.source.js.map +1 -0
  194. package/dist/host-lists/sources/51cto.source.d.ts +11 -0
  195. package/dist/host-lists/sources/51cto.source.js +71 -0
  196. package/dist/host-lists/sources/51cto.source.js.map +1 -0
  197. package/dist/host-lists/sources/52pojie.source.d.ts +9 -0
  198. package/dist/host-lists/sources/52pojie.source.js +109 -0
  199. package/dist/host-lists/sources/52pojie.source.js.map +1 -0
  200. package/dist/host-lists/sources/acfun.source.d.ts +9 -0
  201. package/dist/host-lists/sources/acfun.source.js +90 -0
  202. package/dist/host-lists/sources/acfun.source.js.map +1 -0
  203. package/dist/host-lists/sources/baidu.source.d.ts +9 -0
  204. package/dist/host-lists/sources/baidu.source.js +85 -0
  205. package/dist/host-lists/sources/baidu.source.js.map +1 -0
  206. package/dist/host-lists/sources/bilibili.source.d.ts +14 -0
  207. package/dist/host-lists/sources/bilibili.source.js +188 -0
  208. package/dist/host-lists/sources/bilibili.source.js.map +1 -0
  209. package/dist/host-lists/sources/caixin.source.d.ts +9 -0
  210. package/dist/host-lists/sources/caixin.source.js +102 -0
  211. package/dist/host-lists/sources/caixin.source.js.map +1 -0
  212. package/dist/host-lists/sources/cls.source.d.ts +9 -0
  213. package/dist/host-lists/sources/cls.source.js +62 -0
  214. package/dist/host-lists/sources/cls.source.js.map +1 -0
  215. package/dist/host-lists/sources/coolapk.source.d.ts +9 -0
  216. package/dist/host-lists/sources/coolapk.source.js +57 -0
  217. package/dist/host-lists/sources/coolapk.source.js.map +1 -0
  218. package/dist/host-lists/sources/csdn.source.d.ts +9 -0
  219. package/dist/host-lists/sources/csdn.source.js +59 -0
  220. package/dist/host-lists/sources/csdn.source.js.map +1 -0
  221. package/dist/host-lists/sources/dgtle.source.d.ts +9 -0
  222. package/dist/host-lists/sources/dgtle.source.js +57 -0
  223. package/dist/host-lists/sources/dgtle.source.js.map +1 -0
  224. package/dist/host-lists/sources/douban-group.source.d.ts +11 -0
  225. package/dist/host-lists/sources/douban-group.source.js +100 -0
  226. package/dist/host-lists/sources/douban-group.source.js.map +1 -0
  227. package/dist/host-lists/sources/douban-movie.source.d.ts +10 -0
  228. package/dist/host-lists/sources/douban-movie.source.js +103 -0
  229. package/dist/host-lists/sources/douban-movie.source.js.map +1 -0
  230. package/dist/host-lists/sources/douyin.d.ts +16 -0
  231. package/dist/host-lists/sources/douyin.js +215 -0
  232. package/dist/host-lists/sources/douyin.js.map +1 -0
  233. package/dist/host-lists/sources/eastmoney-stock.source.d.ts +11 -0
  234. package/dist/host-lists/sources/eastmoney-stock.source.js +151 -0
  235. package/dist/host-lists/sources/eastmoney-stock.source.js.map +1 -0
  236. package/dist/host-lists/sources/eastmoney.source.d.ts +9 -0
  237. package/dist/host-lists/sources/eastmoney.source.js +86 -0
  238. package/dist/host-lists/sources/eastmoney.source.js.map +1 -0
  239. package/dist/host-lists/sources/geekpark.source.d.ts +9 -0
  240. package/dist/host-lists/sources/geekpark.source.js +60 -0
  241. package/dist/host-lists/sources/geekpark.source.js.map +1 -0
  242. package/dist/host-lists/sources/gelonghui.source.d.ts +9 -0
  243. package/dist/host-lists/sources/gelonghui.source.js +139 -0
  244. package/dist/host-lists/sources/gelonghui.source.js.map +1 -0
  245. package/dist/host-lists/sources/github.source.d.ts +12 -0
  246. package/dist/host-lists/sources/github.source.js +171 -0
  247. package/dist/host-lists/sources/github.source.js.map +1 -0
  248. package/dist/host-lists/sources/guokr.source.d.ts +11 -0
  249. package/dist/host-lists/sources/guokr.source.js +98 -0
  250. package/dist/host-lists/sources/guokr.source.js.map +1 -0
  251. package/dist/host-lists/sources/hackernews.source.d.ts +11 -0
  252. package/dist/host-lists/sources/hackernews.source.js +121 -0
  253. package/dist/host-lists/sources/hackernews.source.js.map +1 -0
  254. package/dist/host-lists/sources/hellogithub.source.d.ts +11 -0
  255. package/dist/host-lists/sources/hellogithub.source.js +98 -0
  256. package/dist/host-lists/sources/hellogithub.source.js.map +1 -0
  257. package/dist/host-lists/sources/history.source.d.ts +11 -0
  258. package/dist/host-lists/sources/history.source.js +92 -0
  259. package/dist/host-lists/sources/history.source.js.map +1 -0
  260. package/dist/host-lists/sources/honkai.source.d.ts +9 -0
  261. package/dist/host-lists/sources/honkai.source.js +72 -0
  262. package/dist/host-lists/sources/honkai.source.js.map +1 -0
  263. package/dist/host-lists/sources/hostloc.source.d.ts +9 -0
  264. package/dist/host-lists/sources/hostloc.source.js +75 -0
  265. package/dist/host-lists/sources/hostloc.source.js.map +1 -0
  266. package/dist/host-lists/sources/hupu.source.d.ts +9 -0
  267. package/dist/host-lists/sources/hupu.source.js +73 -0
  268. package/dist/host-lists/sources/hupu.source.js.map +1 -0
  269. package/dist/host-lists/sources/huxiu.source.d.ts +9 -0
  270. package/dist/host-lists/sources/huxiu.source.js +153 -0
  271. package/dist/host-lists/sources/huxiu.source.js.map +1 -0
  272. package/dist/host-lists/sources/ifanr.source.d.ts +9 -0
  273. package/dist/host-lists/sources/ifanr.source.js +57 -0
  274. package/dist/host-lists/sources/ifanr.source.js.map +1 -0
  275. package/dist/host-lists/sources/index.d.ts +2 -0
  276. package/dist/host-lists/sources/index.js +134 -0
  277. package/dist/host-lists/sources/index.js.map +1 -0
  278. package/dist/host-lists/sources/ithome-xijiayi.source.d.ts +9 -0
  279. package/dist/host-lists/sources/ithome-xijiayi.source.js +75 -0
  280. package/dist/host-lists/sources/ithome-xijiayi.source.js.map +1 -0
  281. package/dist/host-lists/sources/ithome.source.d.ts +9 -0
  282. package/dist/host-lists/sources/ithome.source.js +71 -0
  283. package/dist/host-lists/sources/ithome.source.js.map +1 -0
  284. package/dist/host-lists/sources/jd.source.d.ts +9 -0
  285. package/dist/host-lists/sources/jd.source.js +82 -0
  286. package/dist/host-lists/sources/jd.source.js.map +1 -0
  287. package/dist/host-lists/sources/jianshu.source.d.ts +9 -0
  288. package/dist/host-lists/sources/jianshu.source.js +72 -0
  289. package/dist/host-lists/sources/jianshu.source.js.map +1 -0
  290. package/dist/host-lists/sources/jin10.source.d.ts +9 -0
  291. package/dist/host-lists/sources/jin10.source.js +63 -0
  292. package/dist/host-lists/sources/jin10.source.js.map +1 -0
  293. package/dist/host-lists/sources/juejin.source.d.ts +10 -0
  294. package/dist/host-lists/sources/juejin.source.js +81 -0
  295. package/dist/host-lists/sources/juejin.source.js.map +1 -0
  296. package/dist/host-lists/sources/kuaishou.source.d.ts +13 -0
  297. package/dist/host-lists/sources/kuaishou.source.js +179 -0
  298. package/dist/host-lists/sources/kuaishou.source.js.map +1 -0
  299. package/dist/host-lists/sources/linuxdo.source.d.ts +9 -0
  300. package/dist/host-lists/sources/linuxdo.source.js +62 -0
  301. package/dist/host-lists/sources/linuxdo.source.js.map +1 -0
  302. package/dist/host-lists/sources/lol.source.d.ts +9 -0
  303. package/dist/host-lists/sources/lol.source.js +58 -0
  304. package/dist/host-lists/sources/lol.source.js.map +1 -0
  305. package/dist/host-lists/sources/miyoushe.source.d.ts +9 -0
  306. package/dist/host-lists/sources/miyoushe.source.js +88 -0
  307. package/dist/host-lists/sources/miyoushe.source.js.map +1 -0
  308. package/dist/host-lists/sources/netease-news.source.d.ts +9 -0
  309. package/dist/host-lists/sources/netease-news.source.js +56 -0
  310. package/dist/host-lists/sources/netease-news.source.js.map +1 -0
  311. package/dist/host-lists/sources/ngabbs.source.d.ts +9 -0
  312. package/dist/host-lists/sources/ngabbs.source.js +70 -0
  313. package/dist/host-lists/sources/ngabbs.source.js.map +1 -0
  314. package/dist/host-lists/sources/nodeseek.source.d.ts +9 -0
  315. package/dist/host-lists/sources/nodeseek.source.js +62 -0
  316. package/dist/host-lists/sources/nodeseek.source.js.map +1 -0
  317. package/dist/host-lists/sources/nytimes.source.d.ts +9 -0
  318. package/dist/host-lists/sources/nytimes.source.js +77 -0
  319. package/dist/host-lists/sources/nytimes.source.js.map +1 -0
  320. package/dist/host-lists/sources/producthunt.source.d.ts +9 -0
  321. package/dist/host-lists/sources/producthunt.source.js +75 -0
  322. package/dist/host-lists/sources/producthunt.source.js.map +1 -0
  323. package/dist/host-lists/sources/qq-news.source.d.ts +9 -0
  324. package/dist/host-lists/sources/qq-news.source.js +53 -0
  325. package/dist/host-lists/sources/qq-news.source.js.map +1 -0
  326. package/dist/host-lists/sources/sina-news.source.d.ts +9 -0
  327. package/dist/host-lists/sources/sina-news.source.js +98 -0
  328. package/dist/host-lists/sources/sina-news.source.js.map +1 -0
  329. package/dist/host-lists/sources/sina.source.d.ts +9 -0
  330. package/dist/host-lists/sources/sina.source.js +78 -0
  331. package/dist/host-lists/sources/sina.source.js.map +1 -0
  332. package/dist/host-lists/sources/smzdm.source.d.ts +9 -0
  333. package/dist/host-lists/sources/smzdm.source.js +71 -0
  334. package/dist/host-lists/sources/smzdm.source.js.map +1 -0
  335. package/dist/host-lists/sources/sspai.source.d.ts +9 -0
  336. package/dist/host-lists/sources/sspai.source.js +69 -0
  337. package/dist/host-lists/sources/sspai.source.js.map +1 -0
  338. package/dist/host-lists/sources/starrail.source.d.ts +9 -0
  339. package/dist/host-lists/sources/starrail.source.js +72 -0
  340. package/dist/host-lists/sources/starrail.source.js.map +1 -0
  341. package/dist/host-lists/sources/taobao.source.d.ts +10 -0
  342. package/dist/host-lists/sources/taobao.source.js +169 -0
  343. package/dist/host-lists/sources/taobao.source.js.map +1 -0
  344. package/dist/host-lists/sources/thepaper.source.d.ts +9 -0
  345. package/dist/host-lists/sources/thepaper.source.js +56 -0
  346. package/dist/host-lists/sources/thepaper.source.js.map +1 -0
  347. package/dist/host-lists/sources/tieba.source.d.ts +9 -0
  348. package/dist/host-lists/sources/tieba.source.js +58 -0
  349. package/dist/host-lists/sources/tieba.source.js.map +1 -0
  350. package/dist/host-lists/sources/tonghuashun.source.d.ts +9 -0
  351. package/dist/host-lists/sources/tonghuashun.source.js +112 -0
  352. package/dist/host-lists/sources/tonghuashun.source.js.map +1 -0
  353. package/dist/host-lists/sources/toutiao.source.d.ts +9 -0
  354. package/dist/host-lists/sources/toutiao.source.js +56 -0
  355. package/dist/host-lists/sources/toutiao.source.js.map +1 -0
  356. package/dist/host-lists/sources/v2ex.source.d.ts +9 -0
  357. package/dist/host-lists/sources/v2ex.source.js +67 -0
  358. package/dist/host-lists/sources/v2ex.source.js.map +1 -0
  359. package/dist/host-lists/sources/wallstreet.source.d.ts +9 -0
  360. package/dist/host-lists/sources/wallstreet.source.js +59 -0
  361. package/dist/host-lists/sources/wallstreet.source.js.map +1 -0
  362. package/dist/host-lists/sources/weatheralarm.source.d.ts +9 -0
  363. package/dist/host-lists/sources/weatheralarm.source.js +68 -0
  364. package/dist/host-lists/sources/weatheralarm.source.js.map +1 -0
  365. package/dist/host-lists/sources/weibo.source.d.ts +15 -0
  366. package/dist/host-lists/sources/weibo.source.js +180 -0
  367. package/dist/host-lists/sources/weibo.source.js.map +1 -0
  368. package/dist/host-lists/sources/weread.source.d.ts +9 -0
  369. package/dist/host-lists/sources/weread.source.js +82 -0
  370. package/dist/host-lists/sources/weread.source.js.map +1 -0
  371. package/dist/host-lists/sources/xinyu.source.d.ts +9 -0
  372. package/dist/host-lists/sources/xinyu.source.js +151 -0
  373. package/dist/host-lists/sources/xinyu.source.js.map +1 -0
  374. package/dist/host-lists/sources/yicai.source.d.ts +9 -0
  375. package/dist/host-lists/sources/yicai.source.js +113 -0
  376. package/dist/host-lists/sources/yicai.source.js.map +1 -0
  377. package/dist/host-lists/sources/yystv.source.d.ts +9 -0
  378. package/dist/host-lists/sources/yystv.source.js +57 -0
  379. package/dist/host-lists/sources/yystv.source.js.map +1 -0
  380. package/dist/host-lists/sources/zhihu-daily.source.d.ts +9 -0
  381. package/dist/host-lists/sources/zhihu-daily.source.js +60 -0
  382. package/dist/host-lists/sources/zhihu-daily.source.js.map +1 -0
  383. package/dist/host-lists/sources/zhihu.source.d.ts +12 -0
  384. package/dist/host-lists/sources/zhihu.source.js +195 -0
  385. package/dist/host-lists/sources/zhihu.source.js.map +1 -0
  386. package/dist/http/http.module.d.ts +2 -0
  387. package/dist/http/http.module.js +30 -0
  388. package/dist/http/http.module.js.map +1 -0
  389. package/dist/http/http.service.d.ts +53 -0
  390. package/dist/http/http.service.js +277 -0
  391. package/dist/http/http.service.js.map +1 -0
  392. package/dist/main.d.ts +3 -0
  393. package/dist/main.js +70 -0
  394. package/dist/main.js.map +1 -0
  395. package/dist/rss/rss.module.d.ts +2 -0
  396. package/dist/rss/rss.module.js +21 -0
  397. package/dist/rss/rss.module.js.map +1 -0
  398. package/dist/rss/rss.service.d.ts +5 -0
  399. package/dist/rss/rss.service.js +55 -0
  400. package/dist/rss/rss.service.js.map +1 -0
  401. package/dist/scheduler/dto/trigger-fetch.dto.d.ts +3 -0
  402. package/dist/scheduler/dto/trigger-fetch.dto.js +22 -0
  403. package/dist/scheduler/dto/trigger-fetch.dto.js.map +1 -0
  404. package/dist/scheduler/dto/update-source-config.dto.d.ts +4 -0
  405. package/dist/scheduler/dto/update-source-config.dto.js +29 -0
  406. package/dist/scheduler/dto/update-source-config.dto.js.map +1 -0
  407. package/dist/scheduler/scheduler.controller.d.ts +52 -0
  408. package/dist/scheduler/scheduler.controller.js +132 -0
  409. package/dist/scheduler/scheduler.controller.js.map +1 -0
  410. package/dist/scheduler/scheduler.module.d.ts +2 -0
  411. package/dist/scheduler/scheduler.module.js +34 -0
  412. package/dist/scheduler/scheduler.module.js.map +1 -0
  413. package/dist/scheduler/scheduler.service.d.ts +54 -0
  414. package/dist/scheduler/scheduler.service.js +238 -0
  415. package/dist/scheduler/scheduler.service.js.map +1 -0
  416. package/dist/scheduler/tasks/fetch-hot-data.task.d.ts +34 -0
  417. package/dist/scheduler/tasks/fetch-hot-data.task.js +175 -0
  418. package/dist/scheduler/tasks/fetch-hot-data.task.js.map +1 -0
  419. package/dist/token/coolapk.d.ts +11 -0
  420. package/dist/token/coolapk.js +40 -0
  421. package/dist/token/coolapk.js.map +1 -0
  422. package/dist/token/token.module.d.ts +2 -0
  423. package/dist/token/token.module.js +23 -0
  424. package/dist/token/token.module.js.map +1 -0
  425. package/dist/token/token.service.d.ts +19 -0
  426. package/dist/token/token.service.js +115 -0
  427. package/dist/token/token.service.js.map +1 -0
  428. package/dist/token/tools.d.ts +1 -0
  429. package/dist/token/tools.js +15 -0
  430. package/dist/token/tools.js.map +1 -0
  431. package/dist/token/weread.d.ts +2 -0
  432. package/dist/token/weread.js +55 -0
  433. package/dist/token/weread.js.map +1 -0
  434. package/dist/utils/getNum.d.ts +1 -0
  435. package/dist/utils/getNum.js +20 -0
  436. package/dist/utils/getNum.js.map +1 -0
  437. package/dist/utils/getTime.d.ts +11 -0
  438. package/dist/utils/getTime.js +134 -0
  439. package/dist/utils/getTime.js.map +1 -0
  440. package/dist/utils/headers.d.ts +16 -0
  441. package/dist/utils/headers.js +20 -0
  442. package/dist/utils/headers.js.map +1 -0
  443. package/dist/utils/index.d.ts +1 -0
  444. package/dist/utils/index.js +12 -0
  445. package/dist/utils/index.js.map +1 -0
  446. package/dist/utils/parseRSS.d.ts +11 -0
  447. package/dist/utils/parseRSS.js +47 -0
  448. package/dist/utils/parseRSS.js.map +1 -0
  449. package/package.json +148 -4
  450. package/views/home.hbs +65 -0
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var HelloGitHubSource_1;
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.HelloGitHubSource = void 0;
14
+ const common_1 = require("@nestjs/common");
15
+ const hot_source_decorator_1 = require("../decorators/hot-source.decorator");
16
+ const http_service_1 = require("../../http/http.service");
17
+ const getTime_1 = require("../../utils/getTime");
18
+ const typeMap = {
19
+ featured: '精选',
20
+ all: '全部',
21
+ };
22
+ let HelloGitHubSource = HelloGitHubSource_1 = class HelloGitHubSource {
23
+ constructor(httpService) {
24
+ this.httpService = httpService;
25
+ this.logger = new common_1.Logger(HelloGitHubSource_1.name);
26
+ }
27
+ async getList(options, noCache) {
28
+ const sort = options?.type || 'featured';
29
+ try {
30
+ const data = await this.fetchFromAPI(sort, noCache);
31
+ return {
32
+ data: data.data,
33
+ params: {
34
+ type: {
35
+ name: '排行榜分区',
36
+ type: typeMap,
37
+ },
38
+ },
39
+ type: typeMap[sort],
40
+ fromCache: data.fromCache,
41
+ updateTime: data.updateTime,
42
+ };
43
+ }
44
+ catch (error) {
45
+ this.logger.error(`Failed to fetch HelloGitHub hot list: ${error.message}`);
46
+ return {
47
+ data: [],
48
+ fromCache: false,
49
+ updateTime: new Date(),
50
+ };
51
+ throw error;
52
+ }
53
+ }
54
+ async fetchFromAPI(sort, noCache) {
55
+ const url = `https://abroad.hellogithub.com/v1/?sort_by=${sort}&tid=&page=1`;
56
+ try {
57
+ const response = await this.httpService.get({
58
+ url,
59
+ headers: {
60
+ 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36',
61
+ },
62
+ noCache,
63
+ });
64
+ const list = response.data.data;
65
+ return {
66
+ data: list.map((item) => ({
67
+ id: item.item_id,
68
+ title: item.title,
69
+ desc: item.summary,
70
+ author: item.author,
71
+ timestamp: (0, getTime_1.getTime)(item.updated_at),
72
+ hot: item.clicks_total,
73
+ url: `https://hellogithub.com/repository/${item.item_id}`,
74
+ mobileUrl: `https://hellogithub.com/repository/${item.item_id}`,
75
+ })),
76
+ fromCache: response.fromCache,
77
+ updateTime: response.updateTime,
78
+ };
79
+ }
80
+ catch (error) {
81
+ this.logger.error(`Failed to fetch data from HelloGitHub API: ${error.message}`);
82
+ throw error;
83
+ }
84
+ }
85
+ };
86
+ exports.HelloGitHubSource = HelloGitHubSource;
87
+ exports.HelloGitHubSource = HelloGitHubSource = HelloGitHubSource_1 = __decorate([
88
+ (0, common_1.Injectable)(),
89
+ (0, hot_source_decorator_1.HotSource)({
90
+ name: 'hellogithub',
91
+ title: 'HelloGitHub',
92
+ type: '热门仓库',
93
+ description: '分享 GitHub 上有趣、入门级的开源项目',
94
+ link: 'https://hellogithub.com/',
95
+ }),
96
+ __metadata("design:paramtypes", [http_service_1.HttpClientService])
97
+ ], HelloGitHubSource);
98
+ //# sourceMappingURL=hellogithub.source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hellogithub.source.js","sourceRoot":"","sources":["../../../src/host-lists/sources/hellogithub.source.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAoD;AACpD,6EAA+D;AAG/D,0DAA4D;AAE5D,iDAA8C;AAE9C,MAAM,OAAO,GAA2B;IACtC,QAAQ,EAAE,IAAI;IACd,GAAG,EAAE,IAAI;CACV,CAAC;AAwBK,IAAM,iBAAiB,yBAAvB,MAAM,iBAAiB;IAG5B,YAA6B,WAA8B;QAA9B,gBAAW,GAAX,WAAW,CAAmB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CAAC,GAAG,CAAC,CAAC,IAAwB,EAAE,EAAE,CAAC,CAAC;oBAC5C,EAAE,EAAE,IAAI,CAAC,OAAO;oBAChB,KAAK,EAAE,IAAI,CAAC,KAAK;oBACjB,IAAI,EAAE,IAAI,CAAC,OAAO;oBAClB,MAAM,EAAE,IAAI,CAAC,MAAM;oBACnB,SAAS,EAAE,IAAA,iBAAO,EAAC,IAAI,CAAC,UAAU,CAAC;oBACnC,GAAG,EAAE,IAAI,CAAC,YAAY;oBACtB,GAAG,EAAE,sCAAsC,IAAI,CAAC,OAAO,EAAE;oBACzD,SAAS,EAAE,sCAAsC,IAAI,CAAC,OAAO,EAAE;iBAChE,CAAC,CAAC;gBACH,SAAS,EAAE,QAAQ,CAAC,SAAS;gBAC7B,UAAU,EAAE,QAAQ,CAAC,UAAU;aAChC,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,MAAM,CAAC,KAAK,CACf,8CAA8C,KAAK,CAAC,OAAO,EAAE,CAC9D,CAAC;YACF,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CACF,CAAA;AA9EY,8CAAiB;4BAAjB,iBAAiB;IAR7B,IAAA,mBAAU,GAAE;IACZ,IAAA,gCAAS,EAAC;QACT,IAAI,EAAE,aAAa;QACnB,KAAK,EAAE,aAAa;QACpB,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,wBAAwB;QACrC,IAAI,EAAE,0BAA0B;KACjC,CAAC;qCAI0C,gCAAiB;GAHhD,iBAAiB,CA8E7B"}
@@ -0,0 +1,11 @@
1
+ import { HotListSource } from '../interfaces/hot-list-source.interface';
2
+ import { HotListGetListResponse } from '../interfaces/hot-list.interface';
3
+ import { HttpClientService } from '../../http/http.service';
4
+ import { GetListOptions } from './source.types';
5
+ export declare class HistorySource implements HotListSource {
6
+ private readonly httpService;
7
+ private readonly logger;
8
+ constructor(httpService: HttpClientService);
9
+ getList(options: GetListOptions, noCache?: boolean): Promise<HotListGetListResponse>;
10
+ private fetchHistoryData;
11
+ }
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var HistorySource_1;
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.HistorySource = void 0;
14
+ const common_1 = require("@nestjs/common");
15
+ const hot_source_decorator_1 = require("../decorators/hot-source.decorator");
16
+ const http_service_1 = require("../../http/http.service");
17
+ const getTime_1 = require("../../utils/getTime");
18
+ const cheerio_1 = require("cheerio");
19
+ let HistorySource = HistorySource_1 = class HistorySource {
20
+ constructor(httpService) {
21
+ this.httpService = httpService;
22
+ this.logger = new common_1.Logger(HistorySource_1.name);
23
+ }
24
+ async getList(options, noCache) {
25
+ const currentDate = (0, getTime_1.getCurrentDateTime)(true);
26
+ let month = options?.month || currentDate.month;
27
+ let day = options?.day || currentDate.day;
28
+ if (!options?.month && !options?.day && options?.type) {
29
+ const dateParts = options.type.split('-');
30
+ if (dateParts.length === 2) {
31
+ month = dateParts[0];
32
+ day = dateParts[1];
33
+ }
34
+ }
35
+ try {
36
+ const listData = await this.fetchHistoryData(month, day, noCache);
37
+ return {
38
+ data: listData.map((item, index) => ({
39
+ id: index,
40
+ title: (0, cheerio_1.load)(item.title).text().trim(),
41
+ desc: (0, cheerio_1.load)(item.desc).text().trim(),
42
+ cover: item.cover ? item.pic_share : undefined,
43
+ author: item.year,
44
+ timestamp: undefined,
45
+ hot: undefined,
46
+ url: item.link,
47
+ mobileUrl: item.link,
48
+ })),
49
+ type: `${month}-${day}`,
50
+ };
51
+ }
52
+ catch (error) {
53
+ this.logger.error(`❌ Failed to fetch history data for ${month}-${day}`, error);
54
+ throw new Error(`Failed to fetch history data: ${error.message}`);
55
+ }
56
+ }
57
+ async fetchHistoryData(month, day, noCache) {
58
+ const monthStr = month.toString().padStart(2, '0');
59
+ const dayStr = day.toString().padStart(2, '0');
60
+ const url = `https://baike.baidu.com/cms/home/eventsOnHistory/${monthStr}.json`;
61
+ try {
62
+ const result = await this.httpService.get({
63
+ url,
64
+ noCache,
65
+ params: {
66
+ _: new Date().getTime(),
67
+ },
68
+ ttl: 60 * 60 * 12,
69
+ timeout: 10000,
70
+ });
71
+ const list = result.data?.[monthStr]?.[monthStr + dayStr] || [];
72
+ this.logger.log(`✅ Successfully fetched ${list.length} history events for ${month}-${day}`);
73
+ return list;
74
+ }
75
+ catch (error) {
76
+ this.logger.error(`❌ Failed to fetch history data from API`, error);
77
+ throw error;
78
+ }
79
+ }
80
+ };
81
+ exports.HistorySource = HistorySource;
82
+ exports.HistorySource = HistorySource = HistorySource_1 = __decorate([
83
+ (0, common_1.Injectable)(),
84
+ (0, hot_source_decorator_1.HotSource)({
85
+ name: 'history',
86
+ title: '历史上的今天',
87
+ type: '历史',
88
+ link: 'https://baike.baidu.com/calendar',
89
+ }),
90
+ __metadata("design:paramtypes", [http_service_1.HttpClientService])
91
+ ], HistorySource);
92
+ //# sourceMappingURL=history.source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"history.source.js","sourceRoot":"","sources":["../../../src/host-lists/sources/history.source.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAoD;AACpD,6EAA+D;AAG/D,0DAA4D;AAE5D,iDAAyD;AAEzD,qCAA+B;AAsBxB,IAAM,aAAa,qBAAnB,MAAM,aAAa;IAGxB,YAA6B,WA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YAChE,IAAI,CAAC,MAAM,CAAC,GAAG,CACb,0BAA0B,IAAI,CAAC,MAAM,uBAAuB,KAAK,IAAI,GAAG,EAAE,CAC3E,CAAC;YAEF,OAAO,IAA+B,CAAC;QACzC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,yCAAyC,EAAE,KAAK,CAAC,CAAC;YACpE,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CACF,CAAA;AArFY,sCAAa;wBAAb,aAAa;IAPzB,IAAA,mBAAU,GAAE;IACZ,IAAA,gCAAS,EAAC;QACT,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,QAAQ;QACf,IAAI,EAAE,IAAI;QACV,IAAI,EAAE,kCAAkC;KACzC,CAAC;qCAI0C,gCAAiB;GAHhD,aAAa,CAqFzB"}
@@ -0,0 +1,9 @@
1
+ import { HotListSource } from '../interfaces/hot-list-source.interface';
2
+ import { HotListGetListResponse } from '../interfaces/hot-list.interface';
3
+ import { HttpClientService } from '../../http/http.service';
4
+ import { GetListOptions } from './source.types';
5
+ export declare class HonkaiSource implements HotListSource {
6
+ private readonly httpService;
7
+ constructor(httpService: HttpClientService);
8
+ getList(options: GetListOptions, noCache?: boolean): Promise<HotListGetListResponse>;
9
+ }
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.HonkaiSource = void 0;
13
+ const common_1 = require("@nestjs/common");
14
+ const hot_source_decorator_1 = require("../decorators/hot-source.decorator");
15
+ const http_service_1 = require("../../http/http.service");
16
+ const getTime_1 = require("../../utils/getTime");
17
+ const typeMap = {
18
+ 1: '公告',
19
+ 2: '活动',
20
+ 3: '资讯',
21
+ };
22
+ let HonkaiSource = class HonkaiSource {
23
+ constructor(httpService) {
24
+ this.httpService = httpService;
25
+ }
26
+ async getList(options, noCache) {
27
+ const type = options?.type ?? 1;
28
+ const url = `https://bbs-api-static.miyoushe.com/painter/wapi/getNewsList?client_type=4&gids=1&last_id=&page_size=20&type=${type}`;
29
+ const result = await this.httpService.get({
30
+ url,
31
+ noCache,
32
+ });
33
+ const list = result.data.data.list || [];
34
+ return {
35
+ data: list.map((v) => {
36
+ const data = v.post;
37
+ return {
38
+ id: data.post_id,
39
+ title: data.subject,
40
+ desc: data.content,
41
+ cover: data.cover || data?.images?.[0],
42
+ author: v.user?.nickname || undefined,
43
+ timestamp: (0, getTime_1.getTime)(data.created_at),
44
+ hot: data.view_status,
45
+ url: `https://www.miyoushe.com/bh3/article/${data.post_id}`,
46
+ mobileUrl: `https://m.miyoushe.com/bh3/#/article/${data.post_id}`,
47
+ };
48
+ }),
49
+ type: typeMap[type] || '热搜',
50
+ params: {
51
+ type: {
52
+ name: '榜单分类',
53
+ type: typeMap,
54
+ },
55
+ },
56
+ fromCache: result.fromCache,
57
+ updateTime: result.updateTime,
58
+ };
59
+ }
60
+ };
61
+ exports.HonkaiSource = HonkaiSource;
62
+ exports.HonkaiSource = HonkaiSource = __decorate([
63
+ (0, common_1.Injectable)(),
64
+ (0, hot_source_decorator_1.HotSource)({
65
+ name: 'honkai',
66
+ title: '崩坏3',
67
+ type: '最新动态',
68
+ link: 'https://www.miyoushe.com/bh3/home/6',
69
+ }),
70
+ __metadata("design:paramtypes", [http_service_1.HttpClientService])
71
+ ], HonkaiSource);
72
+ //# sourceMappingURL=honkai.source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"honkai.source.js","sourceRoot":"","sources":["../../../src/host-lists/sources/honkai.source.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6EAA+D;AAG/D,0DAA4D;AAE5D,iDAA4C;AAQ5C,MAAM,OAAO,GAA2B;IACtC,CAAC,EAAE,IAAI;IACP,CAAC,EAAE,IAAI;IACP,CAAC,EAAE,IAAI;CACR,CAAC;AASK,IAAM,YAAY,GAAlB,MAAM,YAAY;IACvB,YAA6B,WAA8B;QAA9B,gBAAW,GAAX,WAAW,CAAmB;IAAG,CAAC;IAE/D,KAAK,CAAC,OAAO,CACX,OAAuB,EACvB,OAAiB;QAEjB,MAAM,IAAI,GAAG,OAAO,EAAE,IAAI,IAAI,CAAC,CAAC;QAEhC,MAAM,GAAG,GAAG,gHAAgH,IAAI,EAAE,CAAC;QACnI,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,GAAG,CAAoB;YAC3D,GAAG;YACH,OAAO;SACR,CAAC,CAAC;QAEH,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC;QAEzC,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;gBACnB,MAAM,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC;gBACpB,OAAO;oBACL,EAAE,EAAE,IAAI,CAAC,OAAO;oBAChB,KAAK,EAAE,IAAI,CAAC,OAAO;oBACnB,IAAI,EAAE,IAAI,CAAC,OAAO;oBAClB,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;oBACtC,MAAM,EAAE,CAAC,CAAC,IAAI,EAAE,QAAQ,IAAI,SAAS;oBACrC,SAAS,EAAE,IAAA,iBAAO,EAAC,IAAI,CAAC,UAAU,CAAC;oBACnC,GAAG,EAAE,IAAI,CAAC,WAAW;oBACrB,GAAG,EAAE,wCAAwC,IAAI,CAAC,OAAO,EAAE;oBAC3D,SAAS,EAAE,wCAAwC,IAAI,CAAC,OAAO,EAAE;iBAClE,CAAC;YACJ,CAAC,CAAC;YACF,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI;YAC3B,MAAM,EAAE;gBACN,IAAI,EAAE;oBACJ,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,OAAO;iBACd;aACF;YACD,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,UAAU,EAAE,MAAM,CAAC,UAAU;SAC9B,CAAC;IACJ,CAAC;CACF,CAAA;AA3CY,oCAAY;uBAAZ,YAAY;IAPxB,IAAA,mBAAU,GAAE;IACZ,IAAA,gCAAS,EAAC;QACT,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,KAAK;QACZ,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,qCAAqC;KAC5C,CAAC;qCAE0C,gCAAiB;GADhD,YAAY,CA2CxB"}
@@ -0,0 +1,9 @@
1
+ import { HotListSource } from '../interfaces/hot-list-source.interface';
2
+ import { HotListGetListResponse } from '../interfaces/hot-list.interface';
3
+ import { HttpClientService } from '../../http/http.service';
4
+ import { GetListOptions } from './source.types';
5
+ export declare class HostlocSource implements HotListSource {
6
+ private readonly httpService;
7
+ constructor(httpService: HttpClientService);
8
+ getList(options: GetListOptions, noCache?: boolean): Promise<HotListGetListResponse>;
9
+ }
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.HostlocSource = void 0;
13
+ const common_1 = require("@nestjs/common");
14
+ const hot_source_decorator_1 = require("../decorators/hot-source.decorator");
15
+ const http_service_1 = require("../../http/http.service");
16
+ const getTime_1 = require("../../utils/getTime");
17
+ const parseRSS_1 = require("../../utils/parseRSS");
18
+ const typeMap = {
19
+ hot: '最新热门',
20
+ digest: '最新精华',
21
+ new: '最新回复',
22
+ newthread: '最新发表',
23
+ };
24
+ let HostlocSource = class HostlocSource {
25
+ constructor(httpService) {
26
+ this.httpService = httpService;
27
+ }
28
+ async getList(options, noCache) {
29
+ const type = options?.type ?? 'hot';
30
+ const url = `https://hostloc.com/forum.php?mod=guide&view=${type}&rss=1`;
31
+ const result = await this.httpService.get({
32
+ url,
33
+ noCache,
34
+ headers: {
35
+ userAgent: 'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36',
36
+ },
37
+ });
38
+ const list = await (0, parseRSS_1.parseRSS)(result.data);
39
+ return {
40
+ data: list.map((v, i) => {
41
+ return {
42
+ id: v.guid || i.toString(),
43
+ title: v.title || '',
44
+ desc: v.content || '',
45
+ author: v.author || '',
46
+ timestamp: (0, getTime_1.getTime)(v.pubDate || 0),
47
+ hot: undefined,
48
+ url: v.link || '',
49
+ mobileUrl: v.link || '',
50
+ };
51
+ }),
52
+ type: typeMap[type] || '热搜',
53
+ params: {
54
+ type: {
55
+ name: '榜单分类',
56
+ type: typeMap,
57
+ },
58
+ },
59
+ fromCache: result.fromCache,
60
+ updateTime: result.updateTime,
61
+ };
62
+ }
63
+ };
64
+ exports.HostlocSource = HostlocSource;
65
+ exports.HostlocSource = HostlocSource = __decorate([
66
+ (0, common_1.Injectable)(),
67
+ (0, hot_source_decorator_1.HotSource)({
68
+ name: 'hostloc',
69
+ title: '全球主机交流论坛',
70
+ type: '最新动态',
71
+ link: 'https://www.hostloc.com/forum.php',
72
+ }),
73
+ __metadata("design:paramtypes", [http_service_1.HttpClientService])
74
+ ], HostlocSource);
75
+ //# sourceMappingURL=hostloc.source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hostloc.source.js","sourceRoot":"","sources":["../../../src/host-lists/sources/hostloc.source.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6EAA+D;AAG/D,0DAA4D;AAE5D,iDAA4C;AAC5C,mDAA8C;AAE9C,MAAM,OAAO,GAA2B;IACtC,GAAG,EAAE,MAAM;IACX,MAAM,EAAE,MAAM;IACd,GAAG,EAAE,MAAM;IACX,SAAS,EAAE,MAAM;CAClB,CAAC;AASK,IAAM,aAAa,GAAnB,MAAM,aAAa;IACxB,YAA6B,WAA8B;QAA9B,gBAAW,GAAX,WAAW,CAAmB;IAAG,CAAC;IAE/D,KAAK,CAAC,OAAO,CACX,OAAuB,EACvB,OAAiB;QAEjB,MAAM,IAAI,GAAG,OAAO,EAAE,IAAI,IAAI,KAAK,CAAC;QAEpC,MAAM,GAAG,GAAG,gDAAgD,IAAI,QAAQ,CAAC;QACzE,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,GAAG,CAAS;YAChD,GAAG;YACH,OAAO;YACP,OAAO,EAAE;gBACP,SAAS,EACP,qIAAqI;aACxI;SACF,CAAC,CAAC;QAEH,MAAM,IAAI,GAAG,MAAM,IAAA,mBAAQ,EAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAEzC,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;gBACtB,OAAO;oBACL,EAAE,EAAE,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,QAAQ,EAAE;oBAC1B,KAAK,EAAE,CAAC,CAAC,KAAK,IAAI,EAAE;oBACpB,IAAI,EAAE,CAAC,CAAC,OAAO,IAAI,EAAE;oBACrB,MAAM,EAAE,CAAC,CAAC,MAAM,IAAI,EAAE;oBACtB,SAAS,EAAE,IAAA,iBAAO,EAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC;oBAClC,GAAG,EAAE,SAAS;oBACd,GAAG,EAAE,CAAC,CAAC,IAAI,IAAI,EAAE;oBACjB,SAAS,EAAE,CAAC,CAAC,IAAI,IAAI,EAAE;iBACxB,CAAC;YACJ,CAAC,CAAC;YACF,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI;YAC3B,MAAM,EAAE;gBACN,IAAI,EAAE;oBACJ,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,OAAO;iBACd;aACF;YACD,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,UAAU,EAAE,MAAM,CAAC,UAAU;SAC9B,CAAC;IACJ,CAAC;CACF,CAAA;AA7CY,sCAAa;wBAAb,aAAa;IAPzB,IAAA,mBAAU,GAAE;IACZ,IAAA,gCAAS,EAAC;QACT,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,UAAU;QACjB,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,mCAAmC;KAC1C,CAAC;qCAE0C,gCAAiB;GADhD,aAAa,CA6CzB"}
@@ -0,0 +1,9 @@
1
+ import { HotListSource } from '../interfaces/hot-list-source.interface';
2
+ import { HotListGetListResponse } from '../interfaces/hot-list.interface';
3
+ import { HttpClientService } from '../../http/http.service';
4
+ import { GetListOptions } from './source.types';
5
+ export declare class HupuSource implements HotListSource {
6
+ private readonly httpService;
7
+ constructor(httpService: HttpClientService);
8
+ getList(options?: GetListOptions, noCache?: boolean): Promise<HotListGetListResponse>;
9
+ }
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.HupuSource = void 0;
13
+ const common_1 = require("@nestjs/common");
14
+ const hot_source_decorator_1 = require("../decorators/hot-source.decorator");
15
+ const http_service_1 = require("../../http/http.service");
16
+ const typeMap = {
17
+ 1: '主干道',
18
+ 6: '恋爱区',
19
+ 11: '校园区',
20
+ 12: '历史区',
21
+ 612: '摄影区',
22
+ 21: '股票区',
23
+ 10: '职场区',
24
+ };
25
+ let HupuSource = class HupuSource {
26
+ constructor(httpService) {
27
+ this.httpService = httpService;
28
+ }
29
+ async getList(options = {}, noCache) {
30
+ const type = options.type || '1';
31
+ const page = options.page || 1;
32
+ const pageSize = options.pageSize || 20;
33
+ const cursor = options.cursor || undefined;
34
+ const url = `https://m.hupu.com/api/v2/bbs/topicThreads?topicId=${type}&page=${page}&pageSize=${pageSize}${cursor ? `&cursor=${cursor}` : ''}`;
35
+ const result = await this.httpService.get({
36
+ url,
37
+ noCache: noCache ?? options.noCache,
38
+ });
39
+ const list = result?.data?.data?.topicThreads || [];
40
+ const data = list.map((v) => ({
41
+ id: v.tid,
42
+ title: v.title,
43
+ author: v.username,
44
+ hot: v.replies,
45
+ timestamp: undefined,
46
+ url: `https://bbs.hupu.com/${v.tid}.html`,
47
+ mobileUrl: v.url,
48
+ }));
49
+ return {
50
+ data,
51
+ type: '步行街热帖',
52
+ params: {
53
+ type: {
54
+ name: '榜单分类',
55
+ type: typeMap,
56
+ },
57
+ },
58
+ nextCursor: result?.data?.data?.nextCursor,
59
+ };
60
+ }
61
+ };
62
+ exports.HupuSource = HupuSource;
63
+ exports.HupuSource = HupuSource = __decorate([
64
+ (0, common_1.Injectable)(),
65
+ (0, hot_source_decorator_1.HotSource)({
66
+ name: 'hupu',
67
+ title: '虎扑',
68
+ type: '步行街热帖',
69
+ link: 'https://bbs.hupu.com/all-gambia',
70
+ }),
71
+ __metadata("design:paramtypes", [http_service_1.HttpClientService])
72
+ ], HupuSource);
73
+ //# sourceMappingURL=hupu.source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hupu.source.js","sourceRoot":"","sources":["../../../src/host-lists/sources/hupu.source.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6EAA+D;AAM/D,0DAA4D;AAG5D,MAAM,OAAO,GAA2B;IACtC,CAAC,EAAE,KAAK;IACR,CAAC,EAAE,KAAK;IACR,EAAE,EAAE,KAAK;IACT,EAAE,EAAE,KAAK;IACT,GAAG,EAAE,KAAK;IACV,EAAE,EAAE,KAAK;IACT,EAAE,EAAE,KAAK;CACV,CAAC;AASK,IAAM,UAAU,GAAhB,MAAM,UAAU;IACrB,YAA6B,WAA8B;QAA9B,gBAAW,GAAX,WAAW,CAAmB;IAAG,CAAC;IAE/D,KAAK,CAAC,OAAO,CACX,UAA0B,EAAE,EAC5B,OAAiB;QAEjB,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,GAAG,CAAC;QACjC,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,CAAC,CAAC;QAC/B,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,EAAE,CAAC;QACxC,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,SAAS,CAAC;QAC3C,MAAM,GAAG,GAAG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interface';
2
+ import { HotListGetListResponse } from '../interfaces/hot-list.interface';
3
+ import { HttpClientService } from '../../http/http.service';
4
+ import { GetListOptions } from './source.types';
5
+ export declare class HuxiuSource implements HotListSource {
6
+ private readonly httpService;
7
+ constructor(httpService: HttpClientService);
8
+ getList(options: GetListOptions, noCache?: boolean): Promise<HotListGetListResponse>;
9
+ }
@@ -0,0 +1,153 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
19
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
20
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
21
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
22
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
23
+ };
24
+ var __importStar = (this && this.__importStar) || (function () {
25
+ var ownKeys = function(o) {
26
+ ownKeys = Object.getOwnPropertyNames || function (o) {
27
+ var ar = [];
28
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
29
+ return ar;
30
+ };
31
+ return ownKeys(o);
32
+ };
33
+ return function (mod) {
34
+ if (mod && mod.__esModule) return mod;
35
+ var result = {};
36
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
37
+ __setModuleDefault(result, mod);
38
+ return result;
39
+ };
40
+ })();
41
+ var __metadata = (this && this.__metadata) || function (k, v) {
42
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
43
+ };
44
+ Object.defineProperty(exports, "__esModule", { value: true });
45
+ exports.HuxiuSource = void 0;
46
+ const common_1 = require("@nestjs/common");
47
+ const hot_source_decorator_1 = require("../decorators/hot-source.decorator");
48
+ const http_service_1 = require("../../http/http.service");
49
+ const getTime_1 = require("../../utils/getTime");
50
+ const cheerio = __importStar(require("cheerio"));
51
+ const typeMap = {
52
+ '0': '最新',
53
+ '1': '看世界',
54
+ '2': '看重点',
55
+ '3': '大公司',
56
+ '4': '财经动态',
57
+ };
58
+ const urlMap = {
59
+ '0': '',
60
+ '1': 'recommended_feed.html',
61
+ '2': 'category_feed/2.html',
62
+ '3': 'category_feed/3.html',
63
+ '4': 'category_feed/1.html',
64
+ };
65
+ let HuxiuSource = class HuxiuSource {
66
+ constructor(httpService) {
67
+ this.httpService = httpService;
68
+ }
69
+ async getList(options, noCache) {
70
+ const type = options.type || '0';
71
+ const url = `https://www.huxiu.com/moment/${urlMap[type]}`;
72
+ console.log('url', url);
73
+ const result = await this.httpService.get({
74
+ url,
75
+ noCache,
76
+ });
77
+ const $ = cheerio.load(result.data);
78
+ const list = $('.moment-items-wrap .moment-item-wrap')
79
+ .map((i, el) => {
80
+ const $el = $(el);
81
+ const $momentItem = $el.find('.moment-item');
82
+ const author = $momentItem.find('.user-info .username i').text().trim();
83
+ const contentHtml = $momentItem.find('.plain-text').html() || '';
84
+ const contentText = $momentItem.find('.plain-text').text().trim();
85
+ let title = '';
86
+ let desc = '';
87
+ if (contentHtml) {
88
+ const parts = contentHtml.split(/<br\s*\/?>/i);
89
+ title = parts[0] ? parts[0].trim().replace(/<[^>]*>/g, '') : '';
90
+ desc = parts
91
+ .slice(1)
92
+ .join('')
93
+ .trim()
94
+ .replace(/<[^>]*>/g, '');
95
+ }
96
+ else if (contentText) {
97
+ const lines = contentText
98
+ .split('\n')
99
+ .map((line) => line.trim())
100
+ .filter((line) => line);
101
+ title = lines[0] || '';
102
+ desc = lines.slice(1).join(' ');
103
+ }
104
+ const timeText = $momentItem.find('.moment-time').text().trim();
105
+ const id = `huxiu_${i}_${Date.now()}`;
106
+ return {
107
+ id,
108
+ title,
109
+ desc,
110
+ author,
111
+ timeText,
112
+ originalContent: contentText,
113
+ };
114
+ })
115
+ .get()
116
+ .filter((item) => item.title || item.originalContent);
117
+ return {
118
+ data: list.map((v, index) => {
119
+ return {
120
+ id: v.id,
121
+ title: v.title || v.originalContent,
122
+ desc: v.desc || '',
123
+ author: v.author || '虎嗅用户',
124
+ timestamp: (0, getTime_1.getTime)(v.timeText),
125
+ hot: index + 1,
126
+ url: `https://www.huxiu.com/moment/`,
127
+ mobileUrl: `https://m.huxiu.com/moment/`,
128
+ };
129
+ }),
130
+ type: typeMap[type],
131
+ params: {
132
+ type: {
133
+ name: '排行榜分区',
134
+ type: typeMap,
135
+ },
136
+ },
137
+ fromCache: result.fromCache,
138
+ updateTime: result.updateTime,
139
+ };
140
+ }
141
+ };
142
+ exports.HuxiuSource = HuxiuSource;
143
+ exports.HuxiuSource = HuxiuSource = __decorate([
144
+ (0, common_1.Injectable)(),
145
+ (0, hot_source_decorator_1.HotSource)({
146
+ name: 'huxiu',
147
+ title: '虎嗅',
148
+ type: '24小时',
149
+ link: 'https://www.huxiu.com/moment/',
150
+ }),
151
+ __metadata("design:paramtypes", [http_service_1.HttpClientService])
152
+ ], HuxiuSource);
153
+ //# sourceMappingURL=huxiu.source.js.map