@ttkit/daily-hot-api 0.0.0-stage → 0.1.0
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 +315 -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,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 ClsSource implements HotListSource {
|
|
6
|
+
private readonly httpService;
|
|
7
|
+
constructor(httpService: HttpClientService);
|
|
8
|
+
getList(options: GetListOptions, noCache?: boolean): Promise<HotListGetListResponse>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
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.ClsSource = 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 headers_1 = require("../../utils/headers");
|
|
18
|
+
let ClsSource = class ClsSource {
|
|
19
|
+
constructor(httpService) {
|
|
20
|
+
this.httpService = httpService;
|
|
21
|
+
}
|
|
22
|
+
async getList(options, noCache) {
|
|
23
|
+
const url = 'https://www.cls.cn/v3/depth/list/1000?app=CailianpressWeb&id=1000&last_time=&os=web&rn=20&sv=8.4.6&sign=a7aebfb9c660af8779033e0aa8f03a58';
|
|
24
|
+
const result = await this.httpService.get({
|
|
25
|
+
url,
|
|
26
|
+
noCache,
|
|
27
|
+
headers: {
|
|
28
|
+
...headers_1.headers,
|
|
29
|
+
Referer: 'https://www.cls.cn/depth?id=1000',
|
|
30
|
+
Host: 'www.cls.cn',
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
const list = result.data?.data || [];
|
|
34
|
+
return {
|
|
35
|
+
data: list.map((v) => ({
|
|
36
|
+
id: v.id,
|
|
37
|
+
title: v.title,
|
|
38
|
+
cover: v.image || undefined,
|
|
39
|
+
desc: v.brief,
|
|
40
|
+
author: v.source,
|
|
41
|
+
timestamp: (0, getTime_1.getTime)(v.ctime),
|
|
42
|
+
hot: Number(v.reading_num),
|
|
43
|
+
url: `https://www.cls.cn/detail/${v.id}`,
|
|
44
|
+
mobileUrl: `https://www.cls.cn/detail/${v.id}`,
|
|
45
|
+
})),
|
|
46
|
+
fromCache: result.fromCache,
|
|
47
|
+
updateTime: result.updateTime,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
exports.ClsSource = ClsSource;
|
|
52
|
+
exports.ClsSource = ClsSource = __decorate([
|
|
53
|
+
(0, common_1.Injectable)(),
|
|
54
|
+
(0, hot_source_decorator_1.HotSource)({
|
|
55
|
+
name: 'cls',
|
|
56
|
+
title: '财联社',
|
|
57
|
+
type: '头条',
|
|
58
|
+
link: 'https://www.cls.cn/',
|
|
59
|
+
}),
|
|
60
|
+
__metadata("design:paramtypes", [http_service_1.HttpClientService])
|
|
61
|
+
], ClsSource);
|
|
62
|
+
//# sourceMappingURL=cls.source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cls.source.js","sourceRoot":"","sources":["../../../src/host-lists/sources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oBAAT,SAAS;IAPrB,IAAA,mBAAU,GAAE;IACZ,IAAA,gCAAS,EAAC;QACT,IAAI,EAAE,KAAK;QACX,KAAK,EAAE,KAAK;QACZ,IAAI,EAAE,IAAI;QACV,IAAI,EAAE,qBAAqB;KAC5B,CAAC;qCAE0C,gCAAiB;GADhD,SAAS,CAoCrB"}
|
|
@@ -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 CoolapkSource implements HotListSource {
|
|
6
|
+
private readonly httpService;
|
|
7
|
+
constructor(httpService: HttpClientService);
|
|
8
|
+
getList(options: GetListOptions, noCache?: boolean): Promise<HotListGetListResponse>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
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.CoolapkSource = 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 coolapk_1 = require("../../token/coolapk");
|
|
17
|
+
let CoolapkSource = class CoolapkSource {
|
|
18
|
+
constructor(httpService) {
|
|
19
|
+
this.httpService = httpService;
|
|
20
|
+
}
|
|
21
|
+
async getList(options, noCache) {
|
|
22
|
+
const url = `https://api.coolapk.com/v6/page/dataList?url=/feed/statList?cacheExpires=300&statType=day&sortField=detailnum&title=今日热门&title=今日热门&subTitle=&page=1`;
|
|
23
|
+
const result = await this.httpService.get({
|
|
24
|
+
url,
|
|
25
|
+
noCache,
|
|
26
|
+
headers: (0, coolapk_1.genCoolapkHeaders)(),
|
|
27
|
+
});
|
|
28
|
+
const list = result.data?.data || [];
|
|
29
|
+
return {
|
|
30
|
+
data: list.map((v) => ({
|
|
31
|
+
id: v.id,
|
|
32
|
+
title: v.message,
|
|
33
|
+
cover: v.tpic,
|
|
34
|
+
author: v.username,
|
|
35
|
+
desc: v.ttitle,
|
|
36
|
+
timestamp: undefined,
|
|
37
|
+
hot: undefined,
|
|
38
|
+
url: v.shareUrl,
|
|
39
|
+
mobileUrl: v.shareUrl,
|
|
40
|
+
})),
|
|
41
|
+
fromCache: result.fromCache,
|
|
42
|
+
updateTime: result.updateTime,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
exports.CoolapkSource = CoolapkSource;
|
|
47
|
+
exports.CoolapkSource = CoolapkSource = __decorate([
|
|
48
|
+
(0, common_1.Injectable)(),
|
|
49
|
+
(0, hot_source_decorator_1.HotSource)({
|
|
50
|
+
name: 'coolapk',
|
|
51
|
+
title: '酷安',
|
|
52
|
+
type: '热榜',
|
|
53
|
+
link: 'https://www.coolapk.com/',
|
|
54
|
+
}),
|
|
55
|
+
__metadata("design:paramtypes", [http_service_1.HttpClientService])
|
|
56
|
+
], CoolapkSource);
|
|
57
|
+
//# sourceMappingURL=coolapk.source.js.map
|
|
@@ -0,0 +1 @@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IAAI;QACX,IAAI,EAAE,IAAI;QACV,IAAI,EAAE,0BAA0B;KACjC,CAAC;qCAE0C,gCAAiB;GADhD,aAAa,CAgCzB"}
|
|
@@ -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 CsdnSource 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.CsdnSource = 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 coolapk_1 = require("../../token/coolapk");
|
|
17
|
+
const getTime_1 = require("../../utils/getTime");
|
|
18
|
+
let CsdnSource = class CsdnSource {
|
|
19
|
+
constructor(httpService) {
|
|
20
|
+
this.httpService = httpService;
|
|
21
|
+
}
|
|
22
|
+
async getList(options, noCache) {
|
|
23
|
+
const url = 'https://blog.csdn.net/phoenix/web/blog/hot-rank?page=0&pageSize=30';
|
|
24
|
+
const result = await this.httpService.get({
|
|
25
|
+
url,
|
|
26
|
+
noCache,
|
|
27
|
+
headers: (0, coolapk_1.genCoolapkHeaders)(),
|
|
28
|
+
});
|
|
29
|
+
const list = result.data?.data || [];
|
|
30
|
+
return {
|
|
31
|
+
data: list.map((v) => ({
|
|
32
|
+
id: v.productId,
|
|
33
|
+
title: v.articleTitle,
|
|
34
|
+
cover: v.picList?.[0] || undefined,
|
|
35
|
+
desc: undefined,
|
|
36
|
+
author: v.nickName,
|
|
37
|
+
timestamp: (0, getTime_1.getTime)(v.period),
|
|
38
|
+
hot: Number(v.hotRankScore),
|
|
39
|
+
url: v.articleDetailUrl,
|
|
40
|
+
mobileUrl: v.articleDetailUrl,
|
|
41
|
+
})),
|
|
42
|
+
fromCache: result.fromCache,
|
|
43
|
+
updateTime: result.updateTime,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
exports.CsdnSource = CsdnSource;
|
|
48
|
+
exports.CsdnSource = CsdnSource = __decorate([
|
|
49
|
+
(0, common_1.Injectable)(),
|
|
50
|
+
(0, hot_source_decorator_1.HotSource)({
|
|
51
|
+
name: 'csdn',
|
|
52
|
+
title: 'CSDN',
|
|
53
|
+
type: '排行榜',
|
|
54
|
+
description: '专业开发者社区',
|
|
55
|
+
link: 'https://www.csdn.net/',
|
|
56
|
+
}),
|
|
57
|
+
__metadata("design:paramtypes", [http_service_1.HttpClientService])
|
|
58
|
+
], CsdnSource);
|
|
59
|
+
//# sourceMappingURL=csdn.source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"csdn.source.js","sourceRoot":"","sources":["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A,gCAAS,EAAC;QACT,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,KAAK;QACX,WAAW,EAAE,SAAS;QACtB,IAAI,EAAE,uBAAuB;KAC9B,CAAC;qCAE0C,gCAAiB;GADhD,UAAU,CAiCtB"}
|
|
@@ -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 DgtleSource implements HotListSource {
|
|
6
|
+
private readonly httpService;
|
|
7
|
+
constructor(httpService: HttpClientService);
|
|
8
|
+
getList(options: GetListOptions, noCache?: boolean): Promise<HotListGetListResponse>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
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.DgtleSource = 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 DgtleSource = class DgtleSource {
|
|
18
|
+
constructor(httpService) {
|
|
19
|
+
this.httpService = httpService;
|
|
20
|
+
}
|
|
21
|
+
async getList(options, noCache) {
|
|
22
|
+
const url = 'https://opser.api.dgtle.com/v2/news/index';
|
|
23
|
+
const result = await this.httpService.get({
|
|
24
|
+
url,
|
|
25
|
+
noCache,
|
|
26
|
+
});
|
|
27
|
+
const list = result.data?.items || [];
|
|
28
|
+
return {
|
|
29
|
+
data: list.map((v) => ({
|
|
30
|
+
id: v.id,
|
|
31
|
+
title: v.title || v.content,
|
|
32
|
+
desc: v.content,
|
|
33
|
+
cover: v.cover,
|
|
34
|
+
author: v.from,
|
|
35
|
+
hot: v.membernum,
|
|
36
|
+
timestamp: (0, getTime_1.getTime)(v.created_at),
|
|
37
|
+
url: `https://www.dgtle.com/news-${v.id}-${v.type}.html`,
|
|
38
|
+
mobileUrl: `https://m.dgtle.com/news-details/${v.id}`,
|
|
39
|
+
})),
|
|
40
|
+
fromCache: result.fromCache,
|
|
41
|
+
updateTime: result.updateTime,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
exports.DgtleSource = DgtleSource;
|
|
46
|
+
exports.DgtleSource = DgtleSource = __decorate([
|
|
47
|
+
(0, common_1.Injectable)(),
|
|
48
|
+
(0, hot_source_decorator_1.HotSource)({
|
|
49
|
+
name: 'dgtle',
|
|
50
|
+
title: '数字尾巴',
|
|
51
|
+
type: '热门文章',
|
|
52
|
+
description: '致力于分享美好数字生活体验,囊括你闻所未闻的最丰富数码资讯,触所未触最抢鲜产品评测,随时随地感受尾巴们各式数字生活精彩图文、摄影感悟、旅行游记、爱物分享。',
|
|
53
|
+
link: 'https://www.dgtle.com/',
|
|
54
|
+
}),
|
|
55
|
+
__metadata("design:paramtypes", [http_service_1.HttpClientService])
|
|
56
|
+
], DgtleSource);
|
|
57
|
+
//# sourceMappingURL=dgtle.source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dgtle.source.js","sourceRoot":"","sources":["../../../src/host-lists/sources/dgtle.source.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6EAA+D;AAG/D,0DAA4D;AAE5D,iDAA4C;AAerC,IAAM,WAAW,GAAjB,MAAM,WAAW;IACtB,YAA6B,WAA8B;QAA9B,gBAAW,GAAX,WAAW,CAAmB;IAAG,CAAC;IAE/D,KAAK,CAAC,OAAO,CACX,OAAuB,EACvB,OAAiB;QAEjB,MAAM,GAAG,GAAG,2CAA2C,CAAC;QAExD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,GAAG,CAAmB;YAC1D,GAAG;YACH,OAAO;SACR,CAAC,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC;QACtC,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;gBACrB,EAAE,EAAE,CAAC,CAAC,EAAE;gBACR,KAAK,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,OAAO;gBAC3B,IAAI,EAAE,CAAC,CAAC,OAAO;gBACf,KAAK,EAAE,CAAC,CAAC,KAAK;gBACd,MAAM,EAAE,CAAC,CAAC,IAAI;gBACd,GAAG,EAAE,CAAC,CAAC,SAAS;gBAChB,SAAS,EAAE,IAAA,iBAAO,EAAC,CAAC,CAAC,UAAU,CAAC;gBAChC,GAAG,EAAE,8BAA8B,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,IAAI,OAAO;gBACxD,SAAS,EAAE,oCAAoC,CAAC,CAAC,EAAE,EAAE;aACtD,CAAC,CAAC;YACH,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,UAAU,EAAE,MAAM,CAAC,UAAU;SAC9B,CAAC;IACJ,CAAC;CACF,CAAA;AA9BY,kCAAW;sBAAX,WAAW;IATvB,IAAA,mBAAU,GAAE;IACZ,IAAA,gCAAS,EAAC;QACT,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,MAAM;QACZ,WAAW,EACT,+EAA+E;QACjF,IAAI,EAAE,wBAAwB;KAC/B,CAAC;qCAE0C,gCAAiB;GADhD,WAAW,CA8BvB"}
|
|
@@ -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 DoubanGroupSource implements HotListSource {
|
|
6
|
+
private readonly httpService;
|
|
7
|
+
private readonly logger;
|
|
8
|
+
constructor(httpService: HttpClientService);
|
|
9
|
+
getList(options: GetListOptions, noCache?: boolean): Promise<HotListGetListResponse>;
|
|
10
|
+
private getNumbers;
|
|
11
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
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 DoubanGroupSource_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.DoubanGroupSource = void 0;
|
|
14
|
+
const common_1 = require("@nestjs/common");
|
|
15
|
+
const cheerio_1 = require("cheerio");
|
|
16
|
+
const hot_source_decorator_1 = require("../decorators/hot-source.decorator");
|
|
17
|
+
const http_service_1 = require("../../http/http.service");
|
|
18
|
+
const getTime_1 = require("../../utils/getTime");
|
|
19
|
+
let DoubanGroupSource = DoubanGroupSource_1 = class DoubanGroupSource {
|
|
20
|
+
constructor(httpService) {
|
|
21
|
+
this.httpService = httpService;
|
|
22
|
+
this.logger = new common_1.Logger(DoubanGroupSource_1.name);
|
|
23
|
+
}
|
|
24
|
+
async getList(options, noCache) {
|
|
25
|
+
try {
|
|
26
|
+
const url = 'https://www.douban.com/group/explore';
|
|
27
|
+
const result = await this.httpService.get({
|
|
28
|
+
url,
|
|
29
|
+
noCache,
|
|
30
|
+
});
|
|
31
|
+
const $ = (0, cheerio_1.load)(result.data);
|
|
32
|
+
const listDom = $('.article .channel-item');
|
|
33
|
+
const listData = listDom.toArray().map((item) => {
|
|
34
|
+
const dom = $(item);
|
|
35
|
+
const urlAttr = dom.find('h3 a').attr('href') || '';
|
|
36
|
+
const id = this.getNumbers(urlAttr);
|
|
37
|
+
return {
|
|
38
|
+
id,
|
|
39
|
+
title: dom.find('h3 a').text().trim(),
|
|
40
|
+
cover: dom.find('.pic-wrap img').attr('src') || '',
|
|
41
|
+
desc: dom.find('.block p').text().trim(),
|
|
42
|
+
timestamp: (0, getTime_1.getTime)(dom.find('span.pubtime').text().trim()) || 0,
|
|
43
|
+
hot: 0,
|
|
44
|
+
url: urlAttr || `https://www.douban.com/group/topic/${id}`,
|
|
45
|
+
mobileUrl: `https://m.douban.com/group/topic/${id}/`,
|
|
46
|
+
};
|
|
47
|
+
});
|
|
48
|
+
return {
|
|
49
|
+
data: listData,
|
|
50
|
+
params: {
|
|
51
|
+
type: {
|
|
52
|
+
name: '讨论类别',
|
|
53
|
+
type: {},
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
fromCache: result.fromCache,
|
|
57
|
+
updateTime: result.updateTime,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
62
|
+
this.logger.error(`Failed to get douban group list: ${errorMessage}`);
|
|
63
|
+
return {
|
|
64
|
+
data: [],
|
|
65
|
+
params: {
|
|
66
|
+
type: {
|
|
67
|
+
name: '讨论类别',
|
|
68
|
+
type: {},
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
fromCache: false,
|
|
72
|
+
updateTime: 0,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
getNumbers(text) {
|
|
77
|
+
if (!text)
|
|
78
|
+
return '100000000';
|
|
79
|
+
const regex = /\d+/;
|
|
80
|
+
const match = text.match(regex);
|
|
81
|
+
if (match) {
|
|
82
|
+
return match[0];
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
return '100000000';
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
exports.DoubanGroupSource = DoubanGroupSource;
|
|
90
|
+
exports.DoubanGroupSource = DoubanGroupSource = DoubanGroupSource_1 = __decorate([
|
|
91
|
+
(0, common_1.Injectable)(),
|
|
92
|
+
(0, hot_source_decorator_1.HotSource)({
|
|
93
|
+
name: 'douban-group',
|
|
94
|
+
title: '豆瓣讨论',
|
|
95
|
+
type: '讨论精选',
|
|
96
|
+
link: 'https://www.douban.com/group/explore',
|
|
97
|
+
}),
|
|
98
|
+
__metadata("design:paramtypes", [http_service_1.HttpClientService])
|
|
99
|
+
], DoubanGroupSource);
|
|
100
|
+
//# sourceMappingURL=douban-group.source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"douban-group.source.js","sourceRoot":"","sources":["../../../src/host-lists/sources/douban-group.source.ts"],"names":[],"mappings":";;;;;;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AC;YACN,OAAO,WAAW,CAAC;QACrB,CAAC;IACH,CAAC;CACF,CAAA;AAlFY,8CAAiB;4BAAjB,iBAAiB;IAP7B,IAAA,mBAAU,GAAE;IACZ,IAAA,gCAAS,EAAC;QACT,IAAI,EAAE,cAAc;QACpB,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,sCAAsC;KAC7C,CAAC;qCAI0C,gCAAiB;GAHhD,iBAAiB,CAkF7B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
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 DoubanMovieSource implements HotListSource {
|
|
6
|
+
private readonly httpService;
|
|
7
|
+
private readonly logger;
|
|
8
|
+
constructor(httpService: HttpClientService);
|
|
9
|
+
getList(options: GetListOptions, noCache?: boolean): Promise<HotListGetListResponse>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
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 DoubanMovieSource_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.DoubanMovieSource = void 0;
|
|
14
|
+
const common_1 = require("@nestjs/common");
|
|
15
|
+
const cheerio_1 = require("cheerio");
|
|
16
|
+
const hot_source_decorator_1 = require("../decorators/hot-source.decorator");
|
|
17
|
+
const http_service_1 = require("../../http/http.service");
|
|
18
|
+
const getNumbers = (text) => {
|
|
19
|
+
if (!text)
|
|
20
|
+
return 0;
|
|
21
|
+
const regex = /\d+/;
|
|
22
|
+
const match = text.match(regex);
|
|
23
|
+
if (match) {
|
|
24
|
+
return Number(match[0]);
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
return 0;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
let DoubanMovieSource = DoubanMovieSource_1 = class DoubanMovieSource {
|
|
31
|
+
constructor(httpService) {
|
|
32
|
+
this.httpService = httpService;
|
|
33
|
+
this.logger = new common_1.Logger(DoubanMovieSource_1.name);
|
|
34
|
+
}
|
|
35
|
+
async getList(options, noCache) {
|
|
36
|
+
try {
|
|
37
|
+
const url = `https://movie.douban.com/chart/`;
|
|
38
|
+
const result = await this.httpService.get({
|
|
39
|
+
url,
|
|
40
|
+
noCache,
|
|
41
|
+
headers: {
|
|
42
|
+
'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.0 Mobile/15E148 Safari/604.1',
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
const $ = (0, cheerio_1.load)(result.data);
|
|
46
|
+
const listDom = $('.article tr.item');
|
|
47
|
+
const listData = listDom.toArray().map((item) => {
|
|
48
|
+
const dom = $(item);
|
|
49
|
+
const url = dom.find('a').attr('href') || undefined;
|
|
50
|
+
const scoreDom = dom.find('.rating_nums');
|
|
51
|
+
const score = scoreDom.length > 0 ? scoreDom.text() : '0.0';
|
|
52
|
+
return {
|
|
53
|
+
id: getNumbers(url),
|
|
54
|
+
title: `【${score}】${dom.find('a').attr('title')}`,
|
|
55
|
+
cover: dom.find('img').attr('src'),
|
|
56
|
+
desc: dom.find('p.pl').text(),
|
|
57
|
+
timestamp: undefined,
|
|
58
|
+
hot: getNumbers(dom.find('span.pl').text()),
|
|
59
|
+
url: url || `https://movie.douban.com/subject/${getNumbers(url)}/`,
|
|
60
|
+
mobileUrl: `https://m.douban.com/movie/subject/${getNumbers(url)}/`,
|
|
61
|
+
};
|
|
62
|
+
});
|
|
63
|
+
return {
|
|
64
|
+
data: listData,
|
|
65
|
+
params: {
|
|
66
|
+
type: {
|
|
67
|
+
name: '讨论类别',
|
|
68
|
+
type: {},
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
fromCache: result.fromCache,
|
|
72
|
+
updateTime: result.updateTime,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
77
|
+
this.logger.error(`Failed to get douban group list: ${errorMessage}`);
|
|
78
|
+
return {
|
|
79
|
+
data: [],
|
|
80
|
+
params: {
|
|
81
|
+
type: {
|
|
82
|
+
name: '讨论类别',
|
|
83
|
+
type: {},
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
fromCache: false,
|
|
87
|
+
updateTime: 0,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
exports.DoubanMovieSource = DoubanMovieSource;
|
|
93
|
+
exports.DoubanMovieSource = DoubanMovieSource = DoubanMovieSource_1 = __decorate([
|
|
94
|
+
(0, common_1.Injectable)(),
|
|
95
|
+
(0, hot_source_decorator_1.HotSource)({
|
|
96
|
+
name: 'douban-movie',
|
|
97
|
+
title: '豆瓣电影',
|
|
98
|
+
type: '新片榜',
|
|
99
|
+
link: 'https://movie.douban.com/chart',
|
|
100
|
+
}),
|
|
101
|
+
__metadata("design:paramtypes", [http_service_1.HttpClientService])
|
|
102
|
+
], DoubanMovieSource);
|
|
103
|
+
//# sourceMappingURL=douban-movie.source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"douban-movie.source.js","sourceRoot":"","sources":["../../../src/host-lists/sources/douban-movie.source.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAoD;AACpD,qCAA+B;AAC/B,6EAA+D;AAM/D,0DAA4D;AAG5D,MAAM,UAAU,GAAG,CAAC,IAAwB,EAAU,EAAE;IACtD,IAAI,CAAC,IAAI;QAAE,OAAO,CAAC,CAAC;IACpB,MAAM,KAAK,GAAG,KAAK,CAAC;IACpB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAChC,IAAI,KAAK,EAAE,CAAC;QACV,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1B,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,CAAC;IACX,CAAC;AACH,CAAC,CAAC;AASK,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,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,iCAAiC,CAAC;YAE9C,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,GAAG,CAAS;gBAChD,GAAG;gBACH,OAAO;gBACP,OAAO,EAAE;oBACP,YAAY,EACV,yIAAyI;iBAC5I;aACF,CAAC,CAAC;YAEH,MAAM,CAAC,GAAG,IAAA,cAAI,EAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YAC5B,MAAM,OAAO,GAAG,CAAC,CAAC,kBAAkB,CAAC,CAAC;YAEtC,MAAM,QAAQ,GAAkB,OAAO,C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CAAC,UAAU;aAC9B,CAAC;QACJ,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACxB,MAAM,YAAY,GAChB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;YAE3D,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,oCAAoC,YAAY,EAAE,CAAC,CAAC;YAEtE,OAAO;gBACL,IAAI,EAAE,EAAE;gBACR,MAAM,EAAE;oBACN,IAAI,EAAE;wBACJ,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,EAAE;qBACT;iBACF;gBACD,SAAS,EAAE,KAAK;gBAChB,UAAU,EAAE,CAAC;aACd,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAA;AAvEY,8CAAiB;4BAAjB,iBAAiB;IAP7B,IAAA,mBAAU,GAAE;IACZ,IAAA,gCAAS,EAAC;QACT,IAAI,EAAE,cAAc;QACpB,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,KAAK;QACX,IAAI,EAAE,gCAAgC;KACvC,CAAC;qCAI0C,gCAAiB;GAHhD,iBAAiB,CAuE7B"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { HttpService } from '@nestjs/axios';
|
|
2
|
+
import { HotListSource } from '../interfaces/hot-list-source.interface';
|
|
3
|
+
import { HotListGetListResponse } from '../interfaces/hot-list.interface';
|
|
4
|
+
import { HttpClientService } from '../../http/http.service';
|
|
5
|
+
import { GetListOptions } from './source.types';
|
|
6
|
+
export declare class DouyinSource implements HotListSource {
|
|
7
|
+
private readonly httpService;
|
|
8
|
+
private readonly axios;
|
|
9
|
+
private readonly logger;
|
|
10
|
+
constructor(httpService: HttpClientService, axios: HttpService);
|
|
11
|
+
getList(options: GetListOptions, noCache?: boolean): Promise<HotListGetListResponse>;
|
|
12
|
+
private genMsToken;
|
|
13
|
+
private getDyCookies;
|
|
14
|
+
private fetchFromAPI;
|
|
15
|
+
private fetchFromFallback;
|
|
16
|
+
}
|