@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.
- package/.env.example +77 -0
- package/LICENSE +21 -0
- package/README.md +317 -2
- package/bin/daily-hot-api.js +25 -0
- package/dist/app.controller.d.ts +41 -0
- package/dist/app.controller.js +91 -0
- package/dist/app.controller.js.map +1 -0
- package/dist/app.module.d.ts +4 -0
- package/dist/app.module.js +44 -0
- package/dist/app.module.js.map +1 -0
- package/dist/app.service.d.ts +19 -0
- package/dist/app.service.js +57 -0
- package/dist/app.service.js.map +1 -0
- package/dist/cache/cache.module.d.ts +2 -0
- package/dist/cache/cache.module.js +52 -0
- package/dist/cache/cache.module.js.map +1 -0
- package/dist/cache/cache.service.d.ts +26 -0
- package/dist/cache/cache.service.js +163 -0
- package/dist/cache/cache.service.js.map +1 -0
- package/dist/cli/args.d.ts +24 -0
- package/dist/cli/args.js +261 -0
- package/dist/cli/args.js.map +1 -0
- package/dist/cli/commands/logs.d.ts +3 -0
- package/dist/cli/commands/logs.js +55 -0
- package/dist/cli/commands/logs.js.map +1 -0
- package/dist/cli/commands/restart.d.ts +3 -0
- package/dist/cli/commands/restart.js +62 -0
- package/dist/cli/commands/restart.js.map +1 -0
- package/dist/cli/commands/start.d.ts +3 -0
- package/dist/cli/commands/start.js +280 -0
- package/dist/cli/commands/start.js.map +1 -0
- package/dist/cli/commands/status.d.ts +3 -0
- package/dist/cli/commands/status.js +78 -0
- package/dist/cli/commands/status.js.map +1 -0
- package/dist/cli/commands/stop.d.ts +12 -0
- package/dist/cli/commands/stop.js +135 -0
- package/dist/cli/commands/stop.js.map +1 -0
- package/dist/cli/context.d.ts +4 -0
- package/dist/cli/context.js +3 -0
- package/dist/cli/context.js.map +1 -0
- package/dist/cli/env.d.ts +2 -0
- package/dist/cli/env.js +80 -0
- package/dist/cli/env.js.map +1 -0
- package/dist/cli/errors.d.ts +14 -0
- package/dist/cli/errors.js +25 -0
- package/dist/cli/errors.js.map +1 -0
- package/dist/cli/health.d.ts +2 -0
- package/dist/cli/health.js +44 -0
- package/dist/cli/health.js.map +1 -0
- package/dist/cli/help.d.ts +3 -0
- package/dist/cli/help.js +158 -0
- package/dist/cli/help.js.map +1 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +94 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/log-file.d.ts +8 -0
- package/dist/cli/log-file.js +58 -0
- package/dist/cli/log-file.js.map +1 -0
- package/dist/cli/output.d.ts +7 -0
- package/dist/cli/output.js +46 -0
- package/dist/cli/output.js.map +1 -0
- package/dist/cli/paths.d.ts +33 -0
- package/dist/cli/paths.js +76 -0
- package/dist/cli/paths.js.map +1 -0
- package/dist/cli/run-state.d.ts +25 -0
- package/dist/cli/run-state.js +159 -0
- package/dist/cli/run-state.js.map +1 -0
- package/dist/common/middlewares/logger.middleware.d.ts +7 -0
- package/dist/common/middlewares/logger.middleware.js +29 -0
- package/dist/common/middlewares/logger.middleware.js.map +1 -0
- package/dist/config/config.module.d.ts +2 -0
- package/dist/config/config.module.js +47 -0
- package/dist/config/config.module.js.map +1 -0
- package/dist/config/configuration.d.ts +3 -0
- package/dist/config/configuration.js +5 -0
- package/dist/config/configuration.js.map +1 -0
- package/dist/config/validation.schema.d.ts +114 -0
- package/dist/config/validation.schema.js +69 -0
- package/dist/config/validation.schema.js.map +1 -0
- package/dist/daily-brief/clients/ai-analysis.client.d.ts +20 -0
- package/dist/daily-brief/clients/ai-analysis.client.js +217 -0
- package/dist/daily-brief/clients/ai-analysis.client.js.map +1 -0
- package/dist/daily-brief/clients/brief-search.service.d.ts +11 -0
- package/dist/daily-brief/clients/brief-search.service.js +52 -0
- package/dist/daily-brief/clients/brief-search.service.js.map +1 -0
- package/dist/daily-brief/clients/deepseek-search.client.d.ts +11 -0
- package/dist/daily-brief/clients/deepseek-search.client.js +70 -0
- package/dist/daily-brief/clients/deepseek-search.client.js.map +1 -0
- package/dist/daily-brief/clients/tavily-search.client.d.ts +11 -0
- package/dist/daily-brief/clients/tavily-search.client.js +72 -0
- package/dist/daily-brief/clients/tavily-search.client.js.map +1 -0
- package/dist/daily-brief/daily-brief.config.d.ts +31 -0
- package/dist/daily-brief/daily-brief.config.js +108 -0
- package/dist/daily-brief/daily-brief.config.js.map +1 -0
- package/dist/daily-brief/daily-brief.controller.d.ts +72 -0
- package/dist/daily-brief/daily-brief.controller.js +169 -0
- package/dist/daily-brief/daily-brief.controller.js.map +1 -0
- package/dist/daily-brief/daily-brief.module.d.ts +2 -0
- package/dist/daily-brief/daily-brief.module.js +49 -0
- package/dist/daily-brief/daily-brief.module.js.map +1 -0
- package/dist/daily-brief/daily-brief.scheduler.d.ts +30 -0
- package/dist/daily-brief/daily-brief.scheduler.js +113 -0
- package/dist/daily-brief/daily-brief.scheduler.js.map +1 -0
- package/dist/daily-brief/daily-brief.service.d.ts +101 -0
- package/dist/daily-brief/daily-brief.service.js +412 -0
- package/dist/daily-brief/daily-brief.service.js.map +1 -0
- package/dist/daily-brief/dto/brief-date-param.dto.d.ts +3 -0
- package/dist/daily-brief/dto/brief-date-param.dto.js +23 -0
- package/dist/daily-brief/dto/brief-date-param.dto.js.map +1 -0
- package/dist/daily-brief/dto/generate-brief.dto.d.ts +6 -0
- package/dist/daily-brief/dto/generate-brief.dto.js +39 -0
- package/dist/daily-brief/dto/generate-brief.dto.js.map +1 -0
- package/dist/daily-brief/dto/list-briefs-query.dto.d.ts +6 -0
- package/dist/daily-brief/dto/list-briefs-query.dto.js +42 -0
- package/dist/daily-brief/dto/list-briefs-query.dto.js.map +1 -0
- package/dist/daily-brief/dto/stock-ranking-query.dto.d.ts +6 -0
- package/dist/daily-brief/dto/stock-ranking-query.dto.js +46 -0
- package/dist/daily-brief/dto/stock-ranking-query.dto.js.map +1 -0
- package/dist/daily-brief/interfaces/daily-brief.interface.d.ts +59 -0
- package/dist/daily-brief/interfaces/daily-brief.interface.js +3 -0
- package/dist/daily-brief/interfaces/daily-brief.interface.js.map +1 -0
- package/dist/daily-brief/interfaces/search-provider.interface.d.ts +11 -0
- package/dist/daily-brief/interfaces/search-provider.interface.js +3 -0
- package/dist/daily-brief/interfaces/search-provider.interface.js.map +1 -0
- package/dist/daily-brief/utils/brief-date.d.ts +2 -0
- package/dist/daily-brief/utils/brief-date.js +16 -0
- package/dist/daily-brief/utils/brief-date.js.map +1 -0
- package/dist/daily-brief/utils/concurrency.d.ts +1 -0
- package/dist/daily-brief/utils/concurrency.js +20 -0
- package/dist/daily-brief/utils/concurrency.js.map +1 -0
- package/dist/database/database.module.d.ts +2 -0
- package/dist/database/database.module.js +57 -0
- package/dist/database/database.module.js.map +1 -0
- package/dist/database/repositories/daily-brief.repository.d.ts +96 -0
- package/dist/database/repositories/daily-brief.repository.js +457 -0
- package/dist/database/repositories/daily-brief.repository.js.map +1 -0
- package/dist/database/repositories/hot-item.repository.d.ts +52 -0
- package/dist/database/repositories/hot-item.repository.js +255 -0
- package/dist/database/repositories/hot-item.repository.js.map +1 -0
- package/dist/database/repositories/source-config.repository.d.ts +15 -0
- package/dist/database/repositories/source-config.repository.js +77 -0
- package/dist/database/repositories/source-config.repository.js.map +1 -0
- package/dist/database/schemas/daily-brief.schema.d.ts +30 -0
- package/dist/database/schemas/daily-brief.schema.js +103 -0
- package/dist/database/schemas/daily-brief.schema.js.map +1 -0
- package/dist/database/schemas/hot-item.schema.d.ts +20 -0
- package/dist/database/schemas/hot-item.schema.js +72 -0
- package/dist/database/schemas/hot-item.schema.js.map +1 -0
- package/dist/database/schemas/source-config.schema.d.ts +15 -0
- package/dist/database/schemas/source-config.schema.js +47 -0
- package/dist/database/schemas/source-config.schema.js.map +1 -0
- package/dist/history/dto/history-response.dto.d.ts +17 -0
- package/dist/history/dto/history-response.dto.js +13 -0
- package/dist/history/dto/history-response.dto.js.map +1 -0
- package/dist/history/dto/search-history.dto.d.ts +10 -0
- package/dist/history/dto/search-history.dto.js +72 -0
- package/dist/history/dto/search-history.dto.js.map +1 -0
- package/dist/history/history.controller.d.ts +13 -0
- package/dist/history/history.controller.js +92 -0
- package/dist/history/history.controller.js.map +1 -0
- package/dist/history/history.module.d.ts +2 -0
- package/dist/history/history.module.js +25 -0
- package/dist/history/history.module.js.map +1 -0
- package/dist/history/history.service.d.ts +15 -0
- package/dist/history/history.service.js +68 -0
- package/dist/history/history.service.js.map +1 -0
- package/dist/host-lists/decorators/hot-source.decorator.d.ts +9 -0
- package/dist/host-lists/decorators/hot-source.decorator.js +11 -0
- package/dist/host-lists/decorators/hot-source.decorator.js.map +1 -0
- package/dist/host-lists/dto/hot-list.dto.d.ts +14 -0
- package/dist/host-lists/dto/hot-list.dto.js +94 -0
- package/dist/host-lists/dto/hot-list.dto.js.map +1 -0
- package/dist/host-lists/hot-lists.controller.d.ts +39 -0
- package/dist/host-lists/hot-lists.controller.js +87 -0
- package/dist/host-lists/hot-lists.controller.js.map +1 -0
- package/dist/host-lists/hot-lists.module.d.ts +2 -0
- package/dist/host-lists/hot-lists.module.js +36 -0
- package/dist/host-lists/hot-lists.module.js.map +1 -0
- package/dist/host-lists/hot-lists.service.d.ts +21 -0
- package/dist/host-lists/hot-lists.service.js +115 -0
- package/dist/host-lists/hot-lists.service.js.map +1 -0
- package/dist/host-lists/interfaces/hot-list-source.interface.d.ts +5 -0
- package/dist/host-lists/interfaces/hot-list-source.interface.js +3 -0
- package/dist/host-lists/interfaces/hot-list-source.interface.js.map +1 -0
- package/dist/host-lists/interfaces/hot-list.interface.d.ts +31 -0
- package/dist/host-lists/interfaces/hot-list.interface.js +3 -0
- package/dist/host-lists/interfaces/hot-list.interface.js.map +1 -0
- package/dist/host-lists/interfaces/router-data.interface.d.ts +19 -0
- package/dist/host-lists/interfaces/router-data.interface.js +3 -0
- package/dist/host-lists/interfaces/router-data.interface.js.map +1 -0
- package/dist/host-lists/sources/36kr.source.d.ts +9 -0
- package/dist/host-lists/sources/36kr.source.js +89 -0
- package/dist/host-lists/sources/36kr.source.js.map +1 -0
- package/dist/host-lists/sources/51cto.source.d.ts +11 -0
- package/dist/host-lists/sources/51cto.source.js +71 -0
- package/dist/host-lists/sources/51cto.source.js.map +1 -0
- package/dist/host-lists/sources/52pojie.source.d.ts +9 -0
- package/dist/host-lists/sources/52pojie.source.js +109 -0
- package/dist/host-lists/sources/52pojie.source.js.map +1 -0
- package/dist/host-lists/sources/acfun.source.d.ts +9 -0
- package/dist/host-lists/sources/acfun.source.js +90 -0
- package/dist/host-lists/sources/acfun.source.js.map +1 -0
- package/dist/host-lists/sources/baidu.source.d.ts +9 -0
- package/dist/host-lists/sources/baidu.source.js +85 -0
- package/dist/host-lists/sources/baidu.source.js.map +1 -0
- package/dist/host-lists/sources/bilibili.source.d.ts +14 -0
- package/dist/host-lists/sources/bilibili.source.js +188 -0
- package/dist/host-lists/sources/bilibili.source.js.map +1 -0
- package/dist/host-lists/sources/caixin.source.d.ts +9 -0
- package/dist/host-lists/sources/caixin.source.js +102 -0
- package/dist/host-lists/sources/caixin.source.js.map +1 -0
- package/dist/host-lists/sources/cls.source.d.ts +9 -0
- package/dist/host-lists/sources/cls.source.js +62 -0
- package/dist/host-lists/sources/cls.source.js.map +1 -0
- package/dist/host-lists/sources/coolapk.source.d.ts +9 -0
- package/dist/host-lists/sources/coolapk.source.js +57 -0
- package/dist/host-lists/sources/coolapk.source.js.map +1 -0
- package/dist/host-lists/sources/csdn.source.d.ts +9 -0
- package/dist/host-lists/sources/csdn.source.js +59 -0
- package/dist/host-lists/sources/csdn.source.js.map +1 -0
- package/dist/host-lists/sources/dgtle.source.d.ts +9 -0
- package/dist/host-lists/sources/dgtle.source.js +57 -0
- package/dist/host-lists/sources/dgtle.source.js.map +1 -0
- package/dist/host-lists/sources/douban-group.source.d.ts +11 -0
- package/dist/host-lists/sources/douban-group.source.js +100 -0
- package/dist/host-lists/sources/douban-group.source.js.map +1 -0
- package/dist/host-lists/sources/douban-movie.source.d.ts +10 -0
- package/dist/host-lists/sources/douban-movie.source.js +103 -0
- package/dist/host-lists/sources/douban-movie.source.js.map +1 -0
- package/dist/host-lists/sources/douyin.d.ts +16 -0
- package/dist/host-lists/sources/douyin.js +215 -0
- package/dist/host-lists/sources/douyin.js.map +1 -0
- package/dist/host-lists/sources/eastmoney-stock.source.d.ts +11 -0
- package/dist/host-lists/sources/eastmoney-stock.source.js +151 -0
- package/dist/host-lists/sources/eastmoney-stock.source.js.map +1 -0
- package/dist/host-lists/sources/eastmoney.source.d.ts +9 -0
- package/dist/host-lists/sources/eastmoney.source.js +86 -0
- package/dist/host-lists/sources/eastmoney.source.js.map +1 -0
- package/dist/host-lists/sources/geekpark.source.d.ts +9 -0
- package/dist/host-lists/sources/geekpark.source.js +60 -0
- package/dist/host-lists/sources/geekpark.source.js.map +1 -0
- package/dist/host-lists/sources/gelonghui.source.d.ts +9 -0
- package/dist/host-lists/sources/gelonghui.source.js +139 -0
- package/dist/host-lists/sources/gelonghui.source.js.map +1 -0
- package/dist/host-lists/sources/github.source.d.ts +12 -0
- package/dist/host-lists/sources/github.source.js +171 -0
- package/dist/host-lists/sources/github.source.js.map +1 -0
- package/dist/host-lists/sources/guokr.source.d.ts +11 -0
- package/dist/host-lists/sources/guokr.source.js +98 -0
- package/dist/host-lists/sources/guokr.source.js.map +1 -0
- package/dist/host-lists/sources/hackernews.source.d.ts +11 -0
- package/dist/host-lists/sources/hackernews.source.js +121 -0
- package/dist/host-lists/sources/hackernews.source.js.map +1 -0
- package/dist/host-lists/sources/hellogithub.source.d.ts +11 -0
- package/dist/host-lists/sources/hellogithub.source.js +98 -0
- package/dist/host-lists/sources/hellogithub.source.js.map +1 -0
- package/dist/host-lists/sources/history.source.d.ts +11 -0
- package/dist/host-lists/sources/history.source.js +92 -0
- package/dist/host-lists/sources/history.source.js.map +1 -0
- package/dist/host-lists/sources/honkai.source.d.ts +9 -0
- package/dist/host-lists/sources/honkai.source.js +72 -0
- package/dist/host-lists/sources/honkai.source.js.map +1 -0
- package/dist/host-lists/sources/hostloc.source.d.ts +9 -0
- package/dist/host-lists/sources/hostloc.source.js +75 -0
- package/dist/host-lists/sources/hostloc.source.js.map +1 -0
- package/dist/host-lists/sources/hupu.source.d.ts +9 -0
- package/dist/host-lists/sources/hupu.source.js +73 -0
- package/dist/host-lists/sources/hupu.source.js.map +1 -0
- package/dist/host-lists/sources/huxiu.source.d.ts +9 -0
- package/dist/host-lists/sources/huxiu.source.js +153 -0
- package/dist/host-lists/sources/huxiu.source.js.map +1 -0
- package/dist/host-lists/sources/ifanr.source.d.ts +9 -0
- package/dist/host-lists/sources/ifanr.source.js +57 -0
- package/dist/host-lists/sources/ifanr.source.js.map +1 -0
- package/dist/host-lists/sources/index.d.ts +2 -0
- package/dist/host-lists/sources/index.js +134 -0
- package/dist/host-lists/sources/index.js.map +1 -0
- package/dist/host-lists/sources/ithome-xijiayi.source.d.ts +9 -0
- package/dist/host-lists/sources/ithome-xijiayi.source.js +75 -0
- package/dist/host-lists/sources/ithome-xijiayi.source.js.map +1 -0
- package/dist/host-lists/sources/ithome.source.d.ts +9 -0
- package/dist/host-lists/sources/ithome.source.js +71 -0
- package/dist/host-lists/sources/ithome.source.js.map +1 -0
- package/dist/host-lists/sources/jd.source.d.ts +9 -0
- package/dist/host-lists/sources/jd.source.js +82 -0
- package/dist/host-lists/sources/jd.source.js.map +1 -0
- package/dist/host-lists/sources/jianshu.source.d.ts +9 -0
- package/dist/host-lists/sources/jianshu.source.js +72 -0
- package/dist/host-lists/sources/jianshu.source.js.map +1 -0
- package/dist/host-lists/sources/jin10.source.d.ts +9 -0
- package/dist/host-lists/sources/jin10.source.js +63 -0
- package/dist/host-lists/sources/jin10.source.js.map +1 -0
- package/dist/host-lists/sources/juejin.source.d.ts +10 -0
- package/dist/host-lists/sources/juejin.source.js +81 -0
- package/dist/host-lists/sources/juejin.source.js.map +1 -0
- package/dist/host-lists/sources/kuaishou.source.d.ts +13 -0
- package/dist/host-lists/sources/kuaishou.source.js +179 -0
- package/dist/host-lists/sources/kuaishou.source.js.map +1 -0
- package/dist/host-lists/sources/linuxdo.source.d.ts +9 -0
- package/dist/host-lists/sources/linuxdo.source.js +62 -0
- package/dist/host-lists/sources/linuxdo.source.js.map +1 -0
- package/dist/host-lists/sources/lol.source.d.ts +9 -0
- package/dist/host-lists/sources/lol.source.js +58 -0
- package/dist/host-lists/sources/lol.source.js.map +1 -0
- package/dist/host-lists/sources/miyoushe.source.d.ts +9 -0
- package/dist/host-lists/sources/miyoushe.source.js +88 -0
- package/dist/host-lists/sources/miyoushe.source.js.map +1 -0
- package/dist/host-lists/sources/netease-news.source.d.ts +9 -0
- package/dist/host-lists/sources/netease-news.source.js +56 -0
- package/dist/host-lists/sources/netease-news.source.js.map +1 -0
- package/dist/host-lists/sources/ngabbs.source.d.ts +9 -0
- package/dist/host-lists/sources/ngabbs.source.js +70 -0
- package/dist/host-lists/sources/ngabbs.source.js.map +1 -0
- package/dist/host-lists/sources/nodeseek.source.d.ts +9 -0
- package/dist/host-lists/sources/nodeseek.source.js +62 -0
- package/dist/host-lists/sources/nodeseek.source.js.map +1 -0
- package/dist/host-lists/sources/nytimes.source.d.ts +9 -0
- package/dist/host-lists/sources/nytimes.source.js +77 -0
- package/dist/host-lists/sources/nytimes.source.js.map +1 -0
- package/dist/host-lists/sources/producthunt.source.d.ts +9 -0
- package/dist/host-lists/sources/producthunt.source.js +75 -0
- package/dist/host-lists/sources/producthunt.source.js.map +1 -0
- package/dist/host-lists/sources/qq-news.source.d.ts +9 -0
- package/dist/host-lists/sources/qq-news.source.js +53 -0
- package/dist/host-lists/sources/qq-news.source.js.map +1 -0
- package/dist/host-lists/sources/sina-news.source.d.ts +9 -0
- package/dist/host-lists/sources/sina-news.source.js +98 -0
- package/dist/host-lists/sources/sina-news.source.js.map +1 -0
- package/dist/host-lists/sources/sina.source.d.ts +9 -0
- package/dist/host-lists/sources/sina.source.js +78 -0
- package/dist/host-lists/sources/sina.source.js.map +1 -0
- package/dist/host-lists/sources/smzdm.source.d.ts +9 -0
- package/dist/host-lists/sources/smzdm.source.js +71 -0
- package/dist/host-lists/sources/smzdm.source.js.map +1 -0
- package/dist/host-lists/sources/sspai.source.d.ts +9 -0
- package/dist/host-lists/sources/sspai.source.js +69 -0
- package/dist/host-lists/sources/sspai.source.js.map +1 -0
- package/dist/host-lists/sources/starrail.source.d.ts +9 -0
- package/dist/host-lists/sources/starrail.source.js +72 -0
- package/dist/host-lists/sources/starrail.source.js.map +1 -0
- package/dist/host-lists/sources/taobao.source.d.ts +10 -0
- package/dist/host-lists/sources/taobao.source.js +169 -0
- package/dist/host-lists/sources/taobao.source.js.map +1 -0
- package/dist/host-lists/sources/thepaper.source.d.ts +9 -0
- package/dist/host-lists/sources/thepaper.source.js +56 -0
- package/dist/host-lists/sources/thepaper.source.js.map +1 -0
- package/dist/host-lists/sources/tieba.source.d.ts +9 -0
- package/dist/host-lists/sources/tieba.source.js +58 -0
- package/dist/host-lists/sources/tieba.source.js.map +1 -0
- package/dist/host-lists/sources/tonghuashun.source.d.ts +9 -0
- package/dist/host-lists/sources/tonghuashun.source.js +112 -0
- package/dist/host-lists/sources/tonghuashun.source.js.map +1 -0
- package/dist/host-lists/sources/toutiao.source.d.ts +9 -0
- package/dist/host-lists/sources/toutiao.source.js +56 -0
- package/dist/host-lists/sources/toutiao.source.js.map +1 -0
- package/dist/host-lists/sources/v2ex.source.d.ts +9 -0
- package/dist/host-lists/sources/v2ex.source.js +67 -0
- package/dist/host-lists/sources/v2ex.source.js.map +1 -0
- package/dist/host-lists/sources/wallstreet.source.d.ts +9 -0
- package/dist/host-lists/sources/wallstreet.source.js +59 -0
- package/dist/host-lists/sources/wallstreet.source.js.map +1 -0
- package/dist/host-lists/sources/weatheralarm.source.d.ts +9 -0
- package/dist/host-lists/sources/weatheralarm.source.js +68 -0
- package/dist/host-lists/sources/weatheralarm.source.js.map +1 -0
- package/dist/host-lists/sources/weibo.source.d.ts +15 -0
- package/dist/host-lists/sources/weibo.source.js +180 -0
- package/dist/host-lists/sources/weibo.source.js.map +1 -0
- package/dist/host-lists/sources/weread.source.d.ts +9 -0
- package/dist/host-lists/sources/weread.source.js +82 -0
- package/dist/host-lists/sources/weread.source.js.map +1 -0
- package/dist/host-lists/sources/xinyu.source.d.ts +9 -0
- package/dist/host-lists/sources/xinyu.source.js +151 -0
- package/dist/host-lists/sources/xinyu.source.js.map +1 -0
- package/dist/host-lists/sources/yicai.source.d.ts +9 -0
- package/dist/host-lists/sources/yicai.source.js +113 -0
- package/dist/host-lists/sources/yicai.source.js.map +1 -0
- package/dist/host-lists/sources/yystv.source.d.ts +9 -0
- package/dist/host-lists/sources/yystv.source.js +57 -0
- package/dist/host-lists/sources/yystv.source.js.map +1 -0
- package/dist/host-lists/sources/zhihu-daily.source.d.ts +9 -0
- package/dist/host-lists/sources/zhihu-daily.source.js +60 -0
- package/dist/host-lists/sources/zhihu-daily.source.js.map +1 -0
- package/dist/host-lists/sources/zhihu.source.d.ts +12 -0
- package/dist/host-lists/sources/zhihu.source.js +195 -0
- package/dist/host-lists/sources/zhihu.source.js.map +1 -0
- package/dist/http/http.module.d.ts +2 -0
- package/dist/http/http.module.js +30 -0
- package/dist/http/http.module.js.map +1 -0
- package/dist/http/http.service.d.ts +53 -0
- package/dist/http/http.service.js +277 -0
- package/dist/http/http.service.js.map +1 -0
- package/dist/main.d.ts +3 -0
- package/dist/main.js +70 -0
- package/dist/main.js.map +1 -0
- package/dist/rss/rss.module.d.ts +2 -0
- package/dist/rss/rss.module.js +21 -0
- package/dist/rss/rss.module.js.map +1 -0
- package/dist/rss/rss.service.d.ts +5 -0
- package/dist/rss/rss.service.js +55 -0
- package/dist/rss/rss.service.js.map +1 -0
- package/dist/scheduler/dto/trigger-fetch.dto.d.ts +3 -0
- package/dist/scheduler/dto/trigger-fetch.dto.js +22 -0
- package/dist/scheduler/dto/trigger-fetch.dto.js.map +1 -0
- package/dist/scheduler/dto/update-source-config.dto.d.ts +4 -0
- package/dist/scheduler/dto/update-source-config.dto.js +29 -0
- package/dist/scheduler/dto/update-source-config.dto.js.map +1 -0
- package/dist/scheduler/scheduler.controller.d.ts +52 -0
- package/dist/scheduler/scheduler.controller.js +132 -0
- package/dist/scheduler/scheduler.controller.js.map +1 -0
- package/dist/scheduler/scheduler.module.d.ts +2 -0
- package/dist/scheduler/scheduler.module.js +34 -0
- package/dist/scheduler/scheduler.module.js.map +1 -0
- package/dist/scheduler/scheduler.service.d.ts +54 -0
- package/dist/scheduler/scheduler.service.js +238 -0
- package/dist/scheduler/scheduler.service.js.map +1 -0
- package/dist/scheduler/tasks/fetch-hot-data.task.d.ts +34 -0
- package/dist/scheduler/tasks/fetch-hot-data.task.js +175 -0
- package/dist/scheduler/tasks/fetch-hot-data.task.js.map +1 -0
- package/dist/token/coolapk.d.ts +11 -0
- package/dist/token/coolapk.js +40 -0
- package/dist/token/coolapk.js.map +1 -0
- package/dist/token/token.module.d.ts +2 -0
- package/dist/token/token.module.js +23 -0
- package/dist/token/token.module.js.map +1 -0
- package/dist/token/token.service.d.ts +19 -0
- package/dist/token/token.service.js +115 -0
- package/dist/token/token.service.js.map +1 -0
- package/dist/token/tools.d.ts +1 -0
- package/dist/token/tools.js +15 -0
- package/dist/token/tools.js.map +1 -0
- package/dist/token/weread.d.ts +2 -0
- package/dist/token/weread.js +55 -0
- package/dist/token/weread.js.map +1 -0
- package/dist/utils/getNum.d.ts +1 -0
- package/dist/utils/getNum.js +20 -0
- package/dist/utils/getNum.js.map +1 -0
- package/dist/utils/getTime.d.ts +11 -0
- package/dist/utils/getTime.js +134 -0
- package/dist/utils/getTime.js.map +1 -0
- package/dist/utils/headers.d.ts +16 -0
- package/dist/utils/headers.js +20 -0
- package/dist/utils/headers.js.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +12 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/parseRSS.d.ts +11 -0
- package/dist/utils/parseRSS.js +47 -0
- package/dist/utils/parseRSS.js.map +1 -0
- package/package.json +148 -4
- 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;QAF1C,WAAM,GAAG,IAAI,eAAM,CAAC,mBAAiB,CAAC,IAAI,CAAC,CAAC;IAEC,CAAC;IAE/D,KAAK,CAAC,OAAO,CACX,OAAuB,EACvB,OAAiB;QAEjB,MAAM,IAAI,GAAG,OAAO,EAAE,IAAI,IAAI,UAAU,CAAC;QAEzC,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YAEpD,OAAO;gBACL,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,MAAM,EAAE;oBACN,I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AAE,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,WAA8B;QAA9B,gBAAW,GAAX,WAAW,CAAmB;QAF1C,WAAM,GAAG,IAAI,eAAM,CAAC,eAAa,CAAC,IAAI,CAAC,CAAC;IAEK,CAAC;IAE/D,KAAK,CAAC,OAAO,CACX,OAAuB,EACvB,OAAiB;QAMjB,MAAM,WAAW,GAAG,IAAA,4BAAkB,EAAC,IAAI,CAAC,CAAC;QAC7C,IAAI,KAAK,GAAI,OAAe,EAAE,KAAK,IAAI,WAAW,CAAC,KAAK,CAAC;QACzD,IAAI,GAAG,GAAI,OAAe,EAAE,GAAG,IAAI,WAAW,CAAC,GAAG,CAAC;QAGnD,IAAI,CAAE,OAAe,EAAE,KAAK,IAAI,CAAE,OAAe,EAAE,GAAG,IAAI,OAAO,EAAE,IAAI,EAAE,CAAC;YACxE,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC1C,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC3B,KAAK,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;gBACrB,GAAG,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;YACrB,CAAC;QACH,CAAC;QAED,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,GAAG,EAA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EhF,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,GAAG,CAEtC;gBACD,GAAG;gBACH,OAAO;gBACP,MAAM,EAAE;oBACN,CAAC,EAAE,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE;iBACxB;gBACD,GAAG,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE;gBACjB,OAAO,EAAE,KAAK;aACf,CAAC,CAAC;YAEH,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC;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;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E,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,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,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,sDAAsD,IAAI,SAAS,IAAI,aAAa,QAAQ,GAAG,MAAM,CAAC,CAAC,CAAC,WAAW,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;QAC/I,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,GAAG,CAEtC;YACD,GAAG;YACH,OAAO,EAAE,OAAO,IAAI,OAAO,CAAC,OAAO;SACpC,CAAC,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,IAAI,EAAE,CAAC;QACpD,MAAM,IAAI,GAAkB,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAC3C,EAAE,EAAE,CAAC,CAAC,GAAG;YACT,KAAK,EAAE,CAAC,CAAC,KAAK;YACd,MAAM,EAAE,CAAC,CAAC,QAAQ;YAClB,GAAG,EAAE,CAAC,CAAC,OAAO;YACd,SAAS,EAAE,SAAS;YACpB,GAAG,EAAE,wBAAwB,CAAC,CAAC,GAAG,OAAO;YACzC,SAAS,EAAE,CAAC,CAAC,GAAG;SACjB,CAAC,CAAC,CAAC;QACJ,OAAO;YACL,IAAI;YACJ,IAAI,EAAE,OAAO;YACb,MAAM,EAAE;gBACN,IAAI,EAAE;oBACJ,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,OAAO;iBACd;aACF;YACD,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU;SAC3C,CAAC;IACJ,CAAC;CACF,CAAA;AAxCY,gCAAU;qBAAV,UAAU;IAPtB,IAAA,mBAAU,GAAE;IACZ,IAAA,gCAAS,EAAC;QACT,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,IAAI;QACX,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,iCAAiC;KACxC,CAAC;qCAE0C,gCAAiB;GADhD,UAAU,CAwCtB"}
|
|
@@ -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 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
|