@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,58 @@
|
|
|
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.TiebaSource = 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
|
+
let TiebaSource = class TiebaSource {
|
|
18
|
+
constructor(httpService) {
|
|
19
|
+
this.httpService = httpService;
|
|
20
|
+
}
|
|
21
|
+
async getList(options = {}, noCache) {
|
|
22
|
+
const url = 'https://tieba.baidu.com/hottopic/browse/topicList';
|
|
23
|
+
const result = await this.httpService.get({
|
|
24
|
+
url,
|
|
25
|
+
noCache: noCache ?? options.noCache,
|
|
26
|
+
});
|
|
27
|
+
const list = result?.data?.data?.bang_topic?.topic_list || [];
|
|
28
|
+
const data = list.map((v) => ({
|
|
29
|
+
id: v.topic_id,
|
|
30
|
+
title: v.topic_name,
|
|
31
|
+
desc: v.topic_desc,
|
|
32
|
+
cover: v.topic_pic,
|
|
33
|
+
hot: v.discuss_num,
|
|
34
|
+
timestamp: (0, getTime_1.getTime)(v.create_time),
|
|
35
|
+
url: v.topic_url,
|
|
36
|
+
mobileUrl: v.topic_url,
|
|
37
|
+
}));
|
|
38
|
+
return {
|
|
39
|
+
data,
|
|
40
|
+
type: '热议榜',
|
|
41
|
+
fromCache: result.fromCache,
|
|
42
|
+
updateTime: result.updateTime,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
exports.TiebaSource = TiebaSource;
|
|
47
|
+
exports.TiebaSource = TiebaSource = __decorate([
|
|
48
|
+
(0, common_1.Injectable)(),
|
|
49
|
+
(0, hot_source_decorator_1.HotSource)({
|
|
50
|
+
name: 'tieba',
|
|
51
|
+
title: '百度贴吧',
|
|
52
|
+
type: '热议榜',
|
|
53
|
+
link: 'https://tieba.baidu.com/hottopic/browse/topicList',
|
|
54
|
+
description: '全球领先的中文社区',
|
|
55
|
+
}),
|
|
56
|
+
__metadata("design:paramtypes", [http_service_1.HttpClientService])
|
|
57
|
+
], TiebaSource);
|
|
58
|
+
//# sourceMappingURL=tieba.source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tieba.source.js","sourceRoot":"","sources":["../../../src/host-lists/sources/tieba.source.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6EAA+D;AAM/D,0DAA4D;AAE5D,iDAA8C;AAkBvC,IAAM,WAAW,GAAjB,MAAM,WAAW;IACtB,YAA6B,WAA8B;QAA9B,gBAAW,GAAX,WAAW,CAAmB;IAAG,CAAC;IAE/D,KAAK,CAAC,OAAO,CACX,UAA0B,EAAE,EAC5B,OAAiB;QAEjB,MAAM,GAAG,GAAG,mDAAmD,CAAC;QAChE,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,GAAG,CAAmB;YAC1D,GAAG;YACH,OAAO,EAAE,OAAO,IAAI,OAAO,CAAC,OAAO;SACpC,CAAC,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,IAAI,EAAE,CAAC;QAC9D,MAAM,IAAI,GAAkB,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAC3C,EAAE,EAAE,CAAC,CAAC,QAAQ;YACd,KAAK,EAAE,CAAC,CAAC,UAAU;YACnB,IAAI,EAAE,CAAC,CAAC,UAAU;YAClB,KAAK,EAAE,CAAC,CAAC,SAAS;YAClB,GAAG,EAAE,CAAC,CAAC,WAAW;YAClB,SAAS,EAAE,IAAA,iBAAO,EAAC,CAAC,CAAC,WAAW,CAAC;YACjC,GAAG,EAAE,CAAC,CAAC,SAAS;YAChB,SAAS,EAAE,CAAC,CAAC,SAAS;SACvB,CAAC,CAAC,CAAC;QACJ,OAAO;YACL,IAAI;YACJ,IAAI,EAAE,KAAK;YACX,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,UAAU,EAAE,MAAM,CAAC,UAAU;SAC9B,CAAC;IACJ,CAAC;CACF,CAAA;AA9BY,kCAAW;sBAAX,WAAW;IARvB,IAAA,mBAAU,GAAE;IACZ,IAAA,gCAAS,EAAC;QACT,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,KAAK;QACX,IAAI,EAAE,mDAAmD;QACzD,WAAW,EAAE,WAAW;KACzB,CAAC;qCAE0C,gCAAiB;GADhD,WAAW,CA8BvB"}
|
|
@@ -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 TonghuashunSource implements HotListSource {
|
|
6
|
+
private readonly httpService;
|
|
7
|
+
constructor(httpService: HttpClientService);
|
|
8
|
+
getList(options: GetListOptions, noCache?: boolean): Promise<HotListGetListResponse>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
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.TonghuashunSource = 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 cheerio = __importStar(require("cheerio"));
|
|
50
|
+
let TonghuashunSource = class TonghuashunSource {
|
|
51
|
+
constructor(httpService) {
|
|
52
|
+
this.httpService = httpService;
|
|
53
|
+
}
|
|
54
|
+
async getList(options, noCache) {
|
|
55
|
+
const url = 'https://www.10jqka.com.cn/';
|
|
56
|
+
const result = await this.httpService.get({
|
|
57
|
+
url,
|
|
58
|
+
noCache,
|
|
59
|
+
headers: {
|
|
60
|
+
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36',
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
const $ = cheerio.load(result.data);
|
|
64
|
+
const $containers = $('[class*="@container"]');
|
|
65
|
+
const list = $containers
|
|
66
|
+
.toArray()
|
|
67
|
+
.flatMap((container) => {
|
|
68
|
+
const $c = $(container);
|
|
69
|
+
const $links = $c.find('> a').add($c.find('.grid > a'));
|
|
70
|
+
return $links.toArray();
|
|
71
|
+
})
|
|
72
|
+
.map((el) => {
|
|
73
|
+
const $el = $(el);
|
|
74
|
+
const rawUrl = $el.attr('href') || '';
|
|
75
|
+
const fullUrl = rawUrl.startsWith('//') ? `https:${rawUrl}` : rawUrl;
|
|
76
|
+
const id = fullUrl.match(/\/([^/]+)\.shtml$/)?.[1] || fullUrl;
|
|
77
|
+
const title = $el.find('h3, h4').first().text().trim();
|
|
78
|
+
const desc = $el.find('p').first().text().replace(/\s+/g, ' ').trim();
|
|
79
|
+
const $img = $el.find('img[src*="thsi.cn"]').not('[src*="hot-news"]');
|
|
80
|
+
const cover = $img.length ? $img.attr('src') : undefined;
|
|
81
|
+
return {
|
|
82
|
+
id,
|
|
83
|
+
title,
|
|
84
|
+
desc: desc || undefined,
|
|
85
|
+
cover: cover
|
|
86
|
+
? cover.startsWith('//')
|
|
87
|
+
? `https:${cover}`
|
|
88
|
+
: cover
|
|
89
|
+
: undefined,
|
|
90
|
+
url: fullUrl,
|
|
91
|
+
mobileUrl: fullUrl,
|
|
92
|
+
};
|
|
93
|
+
});
|
|
94
|
+
return {
|
|
95
|
+
data: list,
|
|
96
|
+
fromCache: result.fromCache,
|
|
97
|
+
updateTime: result.updateTime,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
exports.TonghuashunSource = TonghuashunSource;
|
|
102
|
+
exports.TonghuashunSource = TonghuashunSource = __decorate([
|
|
103
|
+
(0, common_1.Injectable)(),
|
|
104
|
+
(0, hot_source_decorator_1.HotSource)({
|
|
105
|
+
name: 'tonghuashun',
|
|
106
|
+
title: '同花顺财经',
|
|
107
|
+
type: '财经',
|
|
108
|
+
link: 'https://www.10jqka.com.cn/',
|
|
109
|
+
}),
|
|
110
|
+
__metadata("design:paramtypes", [http_service_1.HttpClientService])
|
|
111
|
+
], TonghuashunSource);
|
|
112
|
+
//# sourceMappingURL=tonghuashun.source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tonghuashun.source.js","sourceRoot":"","sources":["../../../src/host-lists/sources/tonghuashun.source.ts"],"names":[],"mappings":";;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IAAI;QACV,IAAI,EAAE,4BAA4B;KACnC,CAAC;qCAE0C,gCAAiB;GADhD,iBAAiB,CAsD7B"}
|
|
@@ -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 ToutiaoSource implements HotListSource {
|
|
6
|
+
private readonly httpService;
|
|
7
|
+
constructor(httpService: HttpClientService);
|
|
8
|
+
getList(options?: GetListOptions, noCache?: boolean): Promise<HotListGetListResponse>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
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.ToutiaoSource = 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
|
+
let ToutiaoSource = class ToutiaoSource {
|
|
18
|
+
constructor(httpService) {
|
|
19
|
+
this.httpService = httpService;
|
|
20
|
+
}
|
|
21
|
+
async getList(options = {}, noCache) {
|
|
22
|
+
const url = 'https://www.toutiao.com/hot-event/hot-board/?origin=toutiao_pc';
|
|
23
|
+
const result = await this.httpService.get({
|
|
24
|
+
url,
|
|
25
|
+
noCache: noCache ?? options.noCache,
|
|
26
|
+
});
|
|
27
|
+
const list = result?.data?.data || [];
|
|
28
|
+
const data = list.map((v) => ({
|
|
29
|
+
id: v.ClusterIdStr,
|
|
30
|
+
title: v.Title,
|
|
31
|
+
cover: v.Image?.url,
|
|
32
|
+
timestamp: (0, getTime_1.getTime)(Date.now()),
|
|
33
|
+
hot: Number(v.HotValue),
|
|
34
|
+
url: `https://www.toutiao.com/trending/${v.ClusterIdStr}/`,
|
|
35
|
+
mobileUrl: `https://api.toutiaoapi.com/feoffline/amos_land/new/html/main/index.html?topic_id=${v.ClusterIdStr}`,
|
|
36
|
+
}));
|
|
37
|
+
return {
|
|
38
|
+
data,
|
|
39
|
+
type: '热榜',
|
|
40
|
+
fromCache: result.fromCache,
|
|
41
|
+
updateTime: result.updateTime,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
exports.ToutiaoSource = ToutiaoSource;
|
|
46
|
+
exports.ToutiaoSource = ToutiaoSource = __decorate([
|
|
47
|
+
(0, common_1.Injectable)(),
|
|
48
|
+
(0, hot_source_decorator_1.HotSource)({
|
|
49
|
+
name: 'toutiao',
|
|
50
|
+
title: '今日头条',
|
|
51
|
+
type: '热榜',
|
|
52
|
+
link: 'https://www.toutiao.com/',
|
|
53
|
+
}),
|
|
54
|
+
__metadata("design:paramtypes", [http_service_1.HttpClientService])
|
|
55
|
+
], ToutiaoSource);
|
|
56
|
+
//# sourceMappingURL=toutiao.source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toutiao.source.js","sourceRoot":"","sources":["../../../src/host-lists/sources/toutiao.source.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EAAE,MAAM;QACb,IAAI,EAAE,IAAI;QACV,IAAI,EAAE,0BAA0B;KACjC,CAAC;qCAE0C,gCAAiB;GADhD,aAAa,CA8BzB"}
|
|
@@ -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 V2exSource implements HotListSource {
|
|
6
|
+
private readonly httpService;
|
|
7
|
+
constructor(httpService: HttpClientService);
|
|
8
|
+
getList(options?: GetListOptions, noCache?: boolean): Promise<HotListGetListResponse>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
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.V2exSource = 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
|
+
hot: '最热主题',
|
|
18
|
+
latest: '最新主题',
|
|
19
|
+
};
|
|
20
|
+
let V2exSource = class V2exSource {
|
|
21
|
+
constructor(httpService) {
|
|
22
|
+
this.httpService = httpService;
|
|
23
|
+
}
|
|
24
|
+
async getList(options = {}, noCache) {
|
|
25
|
+
const type = options.type || 'hot';
|
|
26
|
+
const url = `https://www.v2ex.com/api/topics/${type}.json`;
|
|
27
|
+
const result = await this.httpService.get({
|
|
28
|
+
url,
|
|
29
|
+
noCache: noCache ?? options.noCache,
|
|
30
|
+
});
|
|
31
|
+
const list = result?.data || [];
|
|
32
|
+
const data = list.map((v) => ({
|
|
33
|
+
id: v.id,
|
|
34
|
+
title: v.title,
|
|
35
|
+
desc: v.content,
|
|
36
|
+
author: v.member?.username,
|
|
37
|
+
timestamp: undefined,
|
|
38
|
+
hot: v.replies,
|
|
39
|
+
url: v.url,
|
|
40
|
+
mobileUrl: v.url,
|
|
41
|
+
}));
|
|
42
|
+
return {
|
|
43
|
+
data,
|
|
44
|
+
type: '主题榜',
|
|
45
|
+
params: {
|
|
46
|
+
type: {
|
|
47
|
+
name: '榜单分类',
|
|
48
|
+
type: typeMap,
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
fromCache: result.fromCache,
|
|
52
|
+
updateTime: result.updateTime,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
exports.V2exSource = V2exSource;
|
|
57
|
+
exports.V2exSource = V2exSource = __decorate([
|
|
58
|
+
(0, common_1.Injectable)(),
|
|
59
|
+
(0, hot_source_decorator_1.HotSource)({
|
|
60
|
+
name: 'v2ex',
|
|
61
|
+
title: 'V2EX',
|
|
62
|
+
type: '主题榜',
|
|
63
|
+
link: 'https://www.v2ex.com/',
|
|
64
|
+
}),
|
|
65
|
+
__metadata("design:paramtypes", [http_service_1.HttpClientService])
|
|
66
|
+
], V2exSource);
|
|
67
|
+
//# sourceMappingURL=v2ex.source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3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YACD,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,UAAU,EAAE,MAAM,CAAC,UAAU;SAC9B,CAAC;IACJ,CAAC;CACF,CAAA;AArCY,gCAAU;qBAAV,UAAU;IAPtB,IAAA,mBAAU,GAAE;IACZ,IAAA,gCAAS,EAAC;QACT,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,KAAK;QACX,IAAI,EAAE,uBAAuB;KAC9B,CAAC;qCAE0C,gCAAiB;GADhD,UAAU,CAqCtB"}
|
|
@@ -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 WallstreetSource implements HotListSource {
|
|
6
|
+
private readonly httpService;
|
|
7
|
+
constructor(httpService: HttpClientService);
|
|
8
|
+
getList(options?: GetListOptions, noCache?: boolean): Promise<HotListGetListResponse>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
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.WallstreetSource = 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
|
+
let WallstreetSource = class WallstreetSource {
|
|
18
|
+
constructor(httpService) {
|
|
19
|
+
this.httpService = httpService;
|
|
20
|
+
}
|
|
21
|
+
async getList(options = {}, noCache) {
|
|
22
|
+
const url = 'https://api-one-wscn.awtmt.com/apiv1/content/articles/hot?period=all';
|
|
23
|
+
const result = await this.httpService.get({
|
|
24
|
+
url,
|
|
25
|
+
noCache: noCache ?? options.noCache,
|
|
26
|
+
headers: {
|
|
27
|
+
Referer: 'https://wallstreetcn.com/',
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
const list = result?.data?.data?.day_items || [];
|
|
31
|
+
const data = list.map((v) => ({
|
|
32
|
+
id: v.id,
|
|
33
|
+
title: v.title,
|
|
34
|
+
timestamp: (0, getTime_1.getTime)(v?.display_time),
|
|
35
|
+
hot: v?.pageviews,
|
|
36
|
+
url: v?.uri,
|
|
37
|
+
mobileUrl: v?.uri,
|
|
38
|
+
}));
|
|
39
|
+
return {
|
|
40
|
+
data,
|
|
41
|
+
type: '热门文章',
|
|
42
|
+
fromCache: result.fromCache,
|
|
43
|
+
updateTime: result.updateTime,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
exports.WallstreetSource = WallstreetSource;
|
|
48
|
+
exports.WallstreetSource = WallstreetSource = __decorate([
|
|
49
|
+
(0, common_1.Injectable)(),
|
|
50
|
+
(0, hot_source_decorator_1.HotSource)({
|
|
51
|
+
name: 'wallstreet',
|
|
52
|
+
title: '华尔街见闻',
|
|
53
|
+
type: '热门文章',
|
|
54
|
+
link: 'https://wallstreetcn.com/',
|
|
55
|
+
description: '热门文章',
|
|
56
|
+
}),
|
|
57
|
+
__metadata("design:paramtypes", [http_service_1.HttpClientService])
|
|
58
|
+
], WallstreetSource);
|
|
59
|
+
//# sourceMappingURL=wallstreet.source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wallstreet.source.js","sourceRoot":"","sources":["../../../src/host-lists/sources/wallstreet.source.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6EAA+D;AAM/D,0DAA4D;AAE5D,iDAA8C;AAcvC,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAC3B,YAA6B,WAA8B;QAA9B,gBAAW,GAAX,WAAW,CAAmB;IAAG,CAAC;IAE/D,KAAK,CAAC,OAAO,CACX,UAA0B,EAAE,EAC5B,OAAiB;QAEjB,MAAM,GAAG,GACP,sEAAsE,CAAC;QACzE,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,GAAG,CAAwB;YAC/D,GAAG;YACH,OAAO,EAAE,OAAO,IAAI,OAAO,CAAC,OAAO;YACnC,OAAO,EAAE;gBACP,OAAO,EAAE,2BAA2B;aACrC;SACF,CAAC,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,IAAI,EAAE,CAAC;QACjD,MAAM,IAAI,GAAkB,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAC3C,EAAE,EAAE,CAAC,CAAC,EAAE;YACR,KAAK,EAAE,CAAC,CAAC,KAAK;YACd,SAAS,EAAE,IAAA,iBAAO,EAAC,CAAC,EAAE,YAAY,CAAC;YACnC,GAAG,EAAE,CAAC,EAAE,SAAS;YACjB,GAAG,EAAE,CAAC,EAAE,GAAG;YACX,SAAS,EAAE,CAAC,EAAE,GAAG;SAClB,CAAC,CAAC,CAAC;QACJ,OAAO;YACL,IAAI;YACJ,IAAI,EAAE,MAAM;YACZ,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,UAAU,EAAE,MAAM,CAAC,UAAU;SAC9B,CAAC;IACJ,CAAC;CACF,CAAA;AAhCY,4CAAgB;2BAAhB,gBAAgB;IAR5B,IAAA,mBAAU,GAAE;IACZ,IAAA,gCAAS,EAAC;QACT,IAAI,EAAE,YAAY;QAClB,KAAK,EAAE,OAAO;QACd,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,2BAA2B;QACjC,WAAW,EAAE,MAAM;KACpB,CAAC;qCAE0C,gCAAiB;GADhD,gBAAgB,CAgC5B"}
|
|
@@ -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 WeatheralarmSource implements HotListSource {
|
|
6
|
+
private readonly httpService;
|
|
7
|
+
constructor(httpService: HttpClientService);
|
|
8
|
+
getList(options?: GetListOptions, noCache?: boolean): Promise<HotListGetListResponse>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
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.WeatheralarmSource = 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
|
+
let WeatheralarmSource = class WeatheralarmSource {
|
|
18
|
+
constructor(httpService) {
|
|
19
|
+
this.httpService = httpService;
|
|
20
|
+
}
|
|
21
|
+
async getList(options = {}, noCache) {
|
|
22
|
+
const province = options.province || '';
|
|
23
|
+
const url = `http://www.nmc.cn/rest/findAlarm?pageNo=1&pageSize=20&signaltype=&signallevel=&province=${encodeURIComponent(province)}`;
|
|
24
|
+
const result = await this.httpService.get({
|
|
25
|
+
url,
|
|
26
|
+
noCache: noCache ?? options.noCache,
|
|
27
|
+
});
|
|
28
|
+
const list = result?.data?.data?.page?.list || [];
|
|
29
|
+
const data = list.map((v) => ({
|
|
30
|
+
id: v.alertid,
|
|
31
|
+
title: v.title,
|
|
32
|
+
desc: v.issuetime + ' ' + v.title,
|
|
33
|
+
cover: v.pic,
|
|
34
|
+
timestamp: (0, getTime_1.getTime)(v.issuetime),
|
|
35
|
+
hot: undefined,
|
|
36
|
+
url: `http://nmc.cn${v.url}`,
|
|
37
|
+
mobileUrl: `http://nmc.cn${v.url}`,
|
|
38
|
+
}));
|
|
39
|
+
return {
|
|
40
|
+
data,
|
|
41
|
+
type: `${province || '全国'}气象预警`,
|
|
42
|
+
params: {
|
|
43
|
+
type: {
|
|
44
|
+
name: '',
|
|
45
|
+
type: {},
|
|
46
|
+
},
|
|
47
|
+
province: {
|
|
48
|
+
name: '预警区域',
|
|
49
|
+
type: {},
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
fromCache: result.fromCache,
|
|
53
|
+
updateTime: result.updateTime,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
exports.WeatheralarmSource = WeatheralarmSource;
|
|
58
|
+
exports.WeatheralarmSource = WeatheralarmSource = __decorate([
|
|
59
|
+
(0, common_1.Injectable)(),
|
|
60
|
+
(0, hot_source_decorator_1.HotSource)({
|
|
61
|
+
name: 'weatheralarm',
|
|
62
|
+
title: '中央气象台',
|
|
63
|
+
type: '气象预警',
|
|
64
|
+
link: 'http://nmc.cn/publish/alarm.html',
|
|
65
|
+
}),
|
|
66
|
+
__metadata("design:paramtypes", [http_service_1.HttpClientService])
|
|
67
|
+
], WeatheralarmSource);
|
|
68
|
+
//# sourceMappingURL=weatheralarm.source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"weatheralarm.source.js","sourceRoot":"","sources":["../../../src/host-lists/sources/weatheralarm.source.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6EAA+D;AAM/D,0DAA4D;AAE5D,iDAA8C;AAavC,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAC7B,YAA6B,WAA8B;QAA9B,gBAAW,GAAX,WAAW,CAAmB;IAAG,CAAC;IAE/D,KAAK,CAAC,OAAO,CACX,UAA0B,EAAE,EAC5B,OAAiB;QAEjB,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,EAAE,CAAC;QACxC,MAAM,GAAG,GAAG,2FAA2F,kBAAkB,CAAC,QAAQ,CAAC,EAAE,CAAC;QACtI,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,GAAG,CAA0B;YACjE,GAAG;YACH,OAAO,EAAE,OAAO,IAAI,OAAO,CAAC,OAAO;SACpC,CAAC,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC;QAClD,MAAM,IAAI,GAAkB,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAC3C,EAAE,EAAE,CAAC,CAAC,OAAO;YACb,KAAK,EAAE,CAAC,CAAC,KAAK;YACd,IAAI,EAAE,CAAC,CAAC,SAAS,GAAG,GAAG,GAAG,CAAC,CAAC,KAAK;YACjC,KAAK,EAAE,CAAC,CAAC,GAAG;YACZ,SAAS,EAAE,IAAA,iBAAO,EAAC,CAAC,CAAC,SAAS,CAAC;YAC/B,GAAG,EAAE,SAAS;YACd,GAAG,EAAE,gBAAgB,CAAC,CAAC,GAAG,EAAE;YAC5B,SAAS,EAAE,gBAAgB,CAAC,CAAC,GAAG,EAAE;SACnC,CAAC,CAAC,CAAC;QACJ,OAAO;YACL,IAAI;YACJ,IAAI,EAAE,GAAG,QAAQ,IAAI,IAAI,MAAM;YAC/B,MAAM,EAAE;gBACN,IAAI,EAAE;oBACJ,IAAI,EAAE,EAAE;oBACR,IAAI,EAAE,EAAE;iBACT;gBACD,QAAQ,EAAE;oBACR,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,EAAE;iBACT;aACF;YACD,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,UAAU,EAAE,MAAM,CAAC,UAAU;SAC9B,CAAC;IACJ,CAAC;CACF,CAAA;AAzCY,gDAAkB;6BAAlB,kBAAkB;IAP9B,IAAA,mBAAU,GAAE;IACZ,IAAA,gCAAS,EAAC;QACT,IAAI,EAAE,cAAc;QACpB,KAAK,EAAE,OAAO;QACd,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,kCAAkC;KACzC,CAAC;qCAE0C,gCAAiB;GADhD,kBAAkB,CAyC9B"}
|
|
@@ -0,0 +1,15 @@
|
|
|
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 WeiboSource implements HotListSource {
|
|
6
|
+
private readonly httpService;
|
|
7
|
+
private readonly logger;
|
|
8
|
+
constructor(httpService: HttpClientService);
|
|
9
|
+
private generateWeiboCookies;
|
|
10
|
+
private generateSUB;
|
|
11
|
+
private generateSUBP;
|
|
12
|
+
private generateSRF;
|
|
13
|
+
private getWeiboCookies;
|
|
14
|
+
getList(options?: GetListOptions, noCache?: boolean): Promise<HotListGetListResponse>;
|
|
15
|
+
}
|