@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,109 @@
|
|
|
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.PojieSource = void 0;
|
|
46
|
+
const common_1 = require("@nestjs/common");
|
|
47
|
+
const hot_source_decorator_1 = require("../decorators/hot-source.decorator");
|
|
48
|
+
const http_service_1 = require("../../http/http.service");
|
|
49
|
+
const getTime_1 = require("../../utils/getTime");
|
|
50
|
+
const parseRSS_1 = require("../../utils/parseRSS");
|
|
51
|
+
const iconv = __importStar(require("iconv-lite"));
|
|
52
|
+
const typeMap = {
|
|
53
|
+
digest: '最新精华',
|
|
54
|
+
hot: '最新热门',
|
|
55
|
+
new: '最新回复',
|
|
56
|
+
newthread: '最新发表',
|
|
57
|
+
};
|
|
58
|
+
let PojieSource = class PojieSource {
|
|
59
|
+
constructor(httpService) {
|
|
60
|
+
this.httpService = httpService;
|
|
61
|
+
}
|
|
62
|
+
async getList(options, noCache) {
|
|
63
|
+
const type = options?.type ?? 'digest';
|
|
64
|
+
const url = `https://www.52pojie.cn/forum.php?mod=guide&view=${type}&rss=1`;
|
|
65
|
+
const result = await this.httpService.get({
|
|
66
|
+
url,
|
|
67
|
+
noCache,
|
|
68
|
+
responseType: 'arraybuffer',
|
|
69
|
+
headers: {
|
|
70
|
+
'User-Agent': 'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36',
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
const utf8Data = iconv.decode(Buffer.from(result.data), 'gbk');
|
|
74
|
+
const list = await (0, parseRSS_1.parseRSS)(utf8Data);
|
|
75
|
+
return {
|
|
76
|
+
data: list.map((v, i) => ({
|
|
77
|
+
id: v.guid || i.toString(),
|
|
78
|
+
title: v.title || '',
|
|
79
|
+
desc: v.content?.trim() || '',
|
|
80
|
+
author: v.author || '',
|
|
81
|
+
timestamp: (0, getTime_1.getTime)(v.pubDate || 0),
|
|
82
|
+
hot: undefined,
|
|
83
|
+
url: v.link || '',
|
|
84
|
+
mobileUrl: v.link || '',
|
|
85
|
+
})),
|
|
86
|
+
type: typeMap[type] || '热榜',
|
|
87
|
+
params: {
|
|
88
|
+
type: {
|
|
89
|
+
name: '榜单分类',
|
|
90
|
+
type: typeMap,
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
fromCache: result.fromCache,
|
|
94
|
+
updateTime: result.updateTime,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
exports.PojieSource = PojieSource;
|
|
99
|
+
exports.PojieSource = PojieSource = __decorate([
|
|
100
|
+
(0, common_1.Injectable)(),
|
|
101
|
+
(0, hot_source_decorator_1.HotSource)({
|
|
102
|
+
name: '52pojie',
|
|
103
|
+
title: '吾爱破解',
|
|
104
|
+
type: '热榜',
|
|
105
|
+
link: 'https://www.52pojie.cn/',
|
|
106
|
+
}),
|
|
107
|
+
__metadata("design:paramtypes", [http_service_1.HttpClientService])
|
|
108
|
+
], PojieSource);
|
|
109
|
+
//# sourceMappingURL=52pojie.source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"52pojie.source.js","sourceRoot":"","sources":["../../../src/host-lists/sources/52pojie.source.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6EAA+D;AAG/D,0DAA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AAC;gBAClC,GAAG,EAAE,SAAS;gBACd,GAAG,EAAE,CAAC,CAAC,IAAI,IAAI,EAAE;gBACjB,SAAS,EAAE,CAAC,CAAC,IAAI,IAAI,EAAE;aACxB,CAAC,CAAC;YACH,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI;YAC3B,MAAM,EAAE;gBACN,IAAI,EAAE;oBACJ,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,OAAO;iBACd;aACF;YACD,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,UAAU,EAAE,MAAM,CAAC,UAAU;SAC9B,CAAC;IACJ,CAAC;CACF,CAAA;AA9CY,kCAAW;sBAAX,WAAW;IAPvB,IAAA,mBAAU,GAAE;IACZ,IAAA,gCAAS,EAAC;QACT,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,IAAI;QACV,IAAI,EAAE,yBAAyB;KAChC,CAAC;qCAE0C,gCAAiB;GADhD,WAAW,CA8CvB"}
|
|
@@ -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 AcFunSource implements HotListSource {
|
|
6
|
+
private readonly httpService;
|
|
7
|
+
constructor(httpService: HttpClientService);
|
|
8
|
+
getList(options: GetListOptions, noCache?: boolean): Promise<HotListGetListResponse>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
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.AcFunSource = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const hot_source_decorator_1 = require("../decorators/hot-source.decorator");
|
|
15
|
+
const http_service_1 = require("../../http/http.service");
|
|
16
|
+
const typeMap = {
|
|
17
|
+
'-1': '综合',
|
|
18
|
+
'155': '番剧',
|
|
19
|
+
'1': '动画',
|
|
20
|
+
'60': '娱乐',
|
|
21
|
+
'201': '生活',
|
|
22
|
+
'58': '音乐',
|
|
23
|
+
'123': '舞蹈·偶像',
|
|
24
|
+
'59': '游戏',
|
|
25
|
+
'70': '科技',
|
|
26
|
+
'68': '影视',
|
|
27
|
+
'69': '体育',
|
|
28
|
+
'125': '鱼塘',
|
|
29
|
+
};
|
|
30
|
+
const rangeMap = {
|
|
31
|
+
DAY: '今日',
|
|
32
|
+
THREE_DAYS: '三日',
|
|
33
|
+
WEEK: '本周',
|
|
34
|
+
};
|
|
35
|
+
let AcFunSource = class AcFunSource {
|
|
36
|
+
constructor(httpService) {
|
|
37
|
+
this.httpService = httpService;
|
|
38
|
+
}
|
|
39
|
+
async getList(options, noCache) {
|
|
40
|
+
const type = options?.type ?? '-1';
|
|
41
|
+
const range = 'DAY';
|
|
42
|
+
const url = `https://www.acfun.cn/rest/pc-direct/rank/channel?channelId=${type === '-1' ? '' : type}&rankLimit=30&rankPeriod=${range}`;
|
|
43
|
+
const result = await this.httpService.get({
|
|
44
|
+
url,
|
|
45
|
+
noCache,
|
|
46
|
+
headers: {
|
|
47
|
+
Referer: `https://www.acfun.cn/rank/list/?cid=-1&pcid=${type}&range=${range}`,
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
const list = result?.data?.rankList || [];
|
|
51
|
+
return {
|
|
52
|
+
data: list.map((v) => ({
|
|
53
|
+
id: v.dougaId,
|
|
54
|
+
title: v.contentTitle,
|
|
55
|
+
desc: v.contentDesc,
|
|
56
|
+
cover: v.coverUrl,
|
|
57
|
+
author: v.userName,
|
|
58
|
+
timestamp: v.contributeTime ? new Date(v.contributeTime).getTime() : 0,
|
|
59
|
+
hot: v.likeCount,
|
|
60
|
+
url: `https://www.acfun.cn/v/ac${v.dougaId}`,
|
|
61
|
+
mobileUrl: `https://m.acfun.cn/v/?ac=${v.dougaId}`,
|
|
62
|
+
})),
|
|
63
|
+
type: `排行榜 · ${typeMap[type]}`,
|
|
64
|
+
params: {
|
|
65
|
+
type: {
|
|
66
|
+
name: '频道',
|
|
67
|
+
type: typeMap,
|
|
68
|
+
},
|
|
69
|
+
range: {
|
|
70
|
+
name: '时间',
|
|
71
|
+
type: rangeMap,
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
fromCache: result.fromCache,
|
|
75
|
+
updateTime: result.updateTime,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
exports.AcFunSource = AcFunSource;
|
|
80
|
+
exports.AcFunSource = AcFunSource = __decorate([
|
|
81
|
+
(0, common_1.Injectable)(),
|
|
82
|
+
(0, hot_source_decorator_1.HotSource)({
|
|
83
|
+
name: 'acfun',
|
|
84
|
+
title: 'AcFun',
|
|
85
|
+
type: '排行榜',
|
|
86
|
+
link: 'https://www.acfun.cn/rank/list/',
|
|
87
|
+
}),
|
|
88
|
+
__metadata("design:paramtypes", [http_service_1.HttpClientService])
|
|
89
|
+
], AcFunSource);
|
|
90
|
+
//# sourceMappingURL=acfun.source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":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G,CAAC,CAAC,CAAsB,EAAE,EAAE,CAAC,CAAC;gBAC1C,EAAE,EAAE,CAAC,CAAC,OAAO;gBACb,KAAK,EAAE,CAAC,CAAC,YAAY;gBACrB,IAAI,EAAE,CAAC,CAAC,WAAW;gBACnB,KAAK,EAAE,CAAC,CAAC,QAAQ;gBACjB,MAAM,EAAE,CAAC,CAAC,QAAQ;gBAClB,SAAS,EAAE,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;gBACtE,GAAG,EAAE,CAAC,CAAC,SAAS;gBAChB,GAAG,EAAE,4BAA4B,CAAC,CAAC,OAAO,EAAE;gBAC5C,SAAS,EAAE,4BAA4B,CAAC,CAAC,OAAO,EAAE;aACnD,CAAC,CAAC;YACH,IAAI,EAAE,SAAS,OAAO,CAAC,IAAI,CAAC,EAAE;YAC9B,MAAM,EAAE;gBACN,IAAI,EAAE;oBACJ,IAAI,EAAE,IAAI;oBACV,IAAI,EAAE,OAAO;iBACd;gBACD,KAAK,EAAE;oBACL,IAAI,EAAE,IAAI;oBACV,IAAI,EAAE,QAAQ;iBACf;aACF;YACD,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,UAAU,EAAE,MAAM,CAAC,UAAU;SAC9B,CAAC;IACJ,CAAC;CACF,CAAA;AAnDY,kCAAW;sBAAX,WAAW;IAPvB,IAAA,mBAAU,GAAE;IACZ,IAAA,gCAAS,EAAC;QACT,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,OAAO;QACd,IAAI,EAAE,KAAK;QACX,IAAI,EAAE,iCAAiC;KACxC,CAAC;qCAE0C,gCAAiB;GADhD,WAAW,CAmDvB"}
|
|
@@ -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 BaiduSource implements HotListSource {
|
|
6
|
+
private readonly httpService;
|
|
7
|
+
constructor(httpService: HttpClientService);
|
|
8
|
+
getList(options: GetListOptions, noCache?: boolean): Promise<HotListGetListResponse>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
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.BaiduSource = 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
|
+
realtime: '热搜',
|
|
18
|
+
novel: '小说',
|
|
19
|
+
movie: '电影',
|
|
20
|
+
teleplay: '电视剧',
|
|
21
|
+
car: '汽车',
|
|
22
|
+
};
|
|
23
|
+
const setDesc = (desc) => {
|
|
24
|
+
return Array.isArray(desc) ? desc.join('\n') : (desc ?? '');
|
|
25
|
+
};
|
|
26
|
+
let BaiduSource = class BaiduSource {
|
|
27
|
+
constructor(httpService) {
|
|
28
|
+
this.httpService = httpService;
|
|
29
|
+
}
|
|
30
|
+
async getList(options, noCache) {
|
|
31
|
+
const type = options?.type ?? 'realtime';
|
|
32
|
+
const url = `https://top.baidu.com/board?tab=${type}`;
|
|
33
|
+
const result = await this.httpService.get({
|
|
34
|
+
url,
|
|
35
|
+
noCache,
|
|
36
|
+
headers: {
|
|
37
|
+
'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_2_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) FxiOS/1.0 Mobile/12F69 Safari/605.1.15',
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
const pattern = /<!--s-data:(.*?)-->/s;
|
|
41
|
+
const matchResult = result.data.match(pattern);
|
|
42
|
+
if (!matchResult)
|
|
43
|
+
throw new Error('Failed to parse baidu data');
|
|
44
|
+
const parsedData = JSON.parse(matchResult[1]);
|
|
45
|
+
const jsonObject = parsedData.cards[0].content;
|
|
46
|
+
const hotList = jsonObject[0]?.content || [];
|
|
47
|
+
const list = hotList.map((v) => ({
|
|
48
|
+
id: v.index,
|
|
49
|
+
title: v.word || v?.title,
|
|
50
|
+
desc: setDesc(v.desc) || setDesc(v?.hotScore?.desc),
|
|
51
|
+
cover: v.img || v.imgInfo?.src,
|
|
52
|
+
author: v.show?.length ? v.show : '',
|
|
53
|
+
timestamp: 0,
|
|
54
|
+
hot: Number(v.hotScore?.value || 0),
|
|
55
|
+
url: v.hotScore?.descUrl ||
|
|
56
|
+
v.url ||
|
|
57
|
+
`https://www.baidu.com/s?wd=${encodeURIComponent(v.word || v.query)}`,
|
|
58
|
+
mobileUrl: v.rawUrl,
|
|
59
|
+
}));
|
|
60
|
+
return {
|
|
61
|
+
data: list || [],
|
|
62
|
+
type: typeMap[type] || '热搜',
|
|
63
|
+
params: {
|
|
64
|
+
type: {
|
|
65
|
+
name: '热搜类别',
|
|
66
|
+
type: typeMap,
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
fromCache: result.fromCache,
|
|
70
|
+
updateTime: result.updateTime,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
exports.BaiduSource = BaiduSource;
|
|
75
|
+
exports.BaiduSource = BaiduSource = __decorate([
|
|
76
|
+
(0, common_1.Injectable)(),
|
|
77
|
+
(0, hot_source_decorator_1.HotSource)({
|
|
78
|
+
name: 'baidu',
|
|
79
|
+
title: '百度',
|
|
80
|
+
type: '热榜',
|
|
81
|
+
link: 'https://top.baidu.com/board',
|
|
82
|
+
}),
|
|
83
|
+
__metadata("design:paramtypes", [http_service_1.HttpClientService])
|
|
84
|
+
], BaiduSource);
|
|
85
|
+
//# sourceMappingURL=baidu.source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"baidu.source.js","sourceRoot":"","sources":["../../../src/host-lists/sources/baidu.source.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6EAA+D;AAG/D,0DAA4D;AAG5D,MAAM,OAAO,GAA2B;IACtC,QAAQ,EAAE,IAAI;IACd,KAAK,EAAE,IAAI;IACX,KAAK,EAAE,IAAI;IACX,QAAQ,EAAE,KAAK;IACf,GAAG,EAAE,IAAI;CACV,CAAC;AAEF,MAAM,OAAO,GAAG,CAAC,IAAwB,EAAE,EAAE;IAC3C,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;AAC9D,CAAC,CAAC;AASK,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,IAAI,GAAG,OAAO,EAAE,IAAI,IAAI,UAAU,CAAC;QAEzC,MAAM,GAAG,GAAG,mC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OAAO;gBACnB,CAAC,CAAC,GAAG;gBACL,8BAA8B,kBAAkB,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,KAAK,CAAC,EAAE;YACvE,SAAS,EAAE,CAAC,CAAC,MAAM;SACpB,CAAC,CAAC,CAAC;QACJ,OAAO;YACL,IAAI,EAAE,IAAI,IAAI,EAAE;YAChB,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI;YAC3B,MAAM,EAAE;gBACN,IAAI,EAAE;oBACJ,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,OAAO;iBACd;aACF;YACD,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,UAAU,EAAE,MAAM,CAAC,UAAU;SAC9B,CAAC;IACJ,CAAC;CACF,CAAA;AAxDY,kCAAW;sBAAX,WAAW;IAPvB,IAAA,mBAAU,GAAE;IACZ,IAAA,gCAAS,EAAC;QACT,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,IAAI;QACX,IAAI,EAAE,IAAI;QACV,IAAI,EAAE,6BAA6B;KACpC,CAAC;qCAE0C,gCAAiB;GADhD,WAAW,CAwDvB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
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 { TokenService } from '../../token/token.service';
|
|
5
|
+
import { GetListOptions } from './source.types';
|
|
6
|
+
export declare class BilibiliSource implements HotListSource {
|
|
7
|
+
private readonly httpService;
|
|
8
|
+
private readonly tokenService;
|
|
9
|
+
private readonly logger;
|
|
10
|
+
constructor(httpService: HttpClientService, tokenService: TokenService);
|
|
11
|
+
getList(options: GetListOptions, noCache?: boolean): Promise<HotListGetListResponse>;
|
|
12
|
+
private getFromNewAPI;
|
|
13
|
+
private getFromLegacyAPI;
|
|
14
|
+
}
|
|
@@ -0,0 +1,188 @@
|
|
|
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 BilibiliSource_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.BilibiliSource = void 0;
|
|
14
|
+
const common_1 = require("@nestjs/common");
|
|
15
|
+
const hot_source_decorator_1 = require("../decorators/hot-source.decorator");
|
|
16
|
+
const http_service_1 = require("../../http/http.service");
|
|
17
|
+
const token_service_1 = require("../../token/token.service");
|
|
18
|
+
const typeMap = {
|
|
19
|
+
'0': '全站',
|
|
20
|
+
'1': '动画',
|
|
21
|
+
'3': '音乐',
|
|
22
|
+
'4': '游戏',
|
|
23
|
+
'5': '娱乐',
|
|
24
|
+
'188': '科技',
|
|
25
|
+
'119': '鬼畜',
|
|
26
|
+
'129': '舞蹈',
|
|
27
|
+
'155': '时尚',
|
|
28
|
+
'160': '生活',
|
|
29
|
+
'168': '国创相关',
|
|
30
|
+
'181': '影视',
|
|
31
|
+
};
|
|
32
|
+
let BilibiliSource = BilibiliSource_1 = class BilibiliSource {
|
|
33
|
+
constructor(httpService, tokenService) {
|
|
34
|
+
this.httpService = httpService;
|
|
35
|
+
this.tokenService = tokenService;
|
|
36
|
+
this.logger = new common_1.Logger(BilibiliSource_1.name);
|
|
37
|
+
}
|
|
38
|
+
async getList(options, noCache) {
|
|
39
|
+
const type = options?.type ?? '0';
|
|
40
|
+
try {
|
|
41
|
+
const result = await this.getFromNewAPI(type, noCache);
|
|
42
|
+
return {
|
|
43
|
+
data: result.data || [],
|
|
44
|
+
type: `热榜 · ${typeMap[type]}`,
|
|
45
|
+
params: {
|
|
46
|
+
type: {
|
|
47
|
+
name: '排行榜分区',
|
|
48
|
+
type: typeMap,
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
fromCache: result.fromCache,
|
|
52
|
+
updateTime: result.updateTime,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
this.logger.warn('New API failed, trying legacy API', error);
|
|
57
|
+
const result = await this.getFromLegacyAPI(type, noCache);
|
|
58
|
+
return {
|
|
59
|
+
data: result.data || [],
|
|
60
|
+
type: `热榜 · ${typeMap[type]}`,
|
|
61
|
+
params: {
|
|
62
|
+
type: {
|
|
63
|
+
name: '排行榜分区',
|
|
64
|
+
type: typeMap,
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
fromCache: result.fromCache,
|
|
68
|
+
updateTime: result.updateTime,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
async getFromNewAPI(type, noCache) {
|
|
73
|
+
try {
|
|
74
|
+
const wbiSignature = await this.tokenService.getBiliWbi({
|
|
75
|
+
rid: type,
|
|
76
|
+
type: 'all',
|
|
77
|
+
});
|
|
78
|
+
const url = `https://api.bilibili.com/x/web-interface/ranking/v2?rid=${type}&type=all&${wbiSignature}`;
|
|
79
|
+
const result = await this.httpService.get({
|
|
80
|
+
url,
|
|
81
|
+
noCache,
|
|
82
|
+
headers: {
|
|
83
|
+
Referer: 'https://www.bilibili.com/ranking/all',
|
|
84
|
+
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36',
|
|
85
|
+
Accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
|
|
86
|
+
'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8',
|
|
87
|
+
'Accept-Encoding': 'gzip, deflate, br',
|
|
88
|
+
'Sec-Ch-Ua': '"Google Chrome";v="123", "Not:A-Brand";v="8", "Chromium";v="123"',
|
|
89
|
+
'Sec-Ch-Ua-Mobile': '?0',
|
|
90
|
+
'Sec-Ch-Ua-Platform': '"Windows"',
|
|
91
|
+
'Sec-Fetch-Dest': 'document',
|
|
92
|
+
'Sec-Fetch-Mode': 'navigate',
|
|
93
|
+
'Sec-Fetch-Site': 'same-origin',
|
|
94
|
+
'Sec-Fetch-User': '?1',
|
|
95
|
+
'Upgrade-Insecure-Requests': '1',
|
|
96
|
+
},
|
|
97
|
+
});
|
|
98
|
+
if (result.data?.data?.list?.length > 0) {
|
|
99
|
+
this.logger.log('Using bilibili new API');
|
|
100
|
+
const list = result.data.data.list;
|
|
101
|
+
return {
|
|
102
|
+
data: list.map((v) => ({
|
|
103
|
+
id: v.bvid,
|
|
104
|
+
title: v.title,
|
|
105
|
+
desc: v.desc || '该视频暂无简介',
|
|
106
|
+
cover: v.pic?.replace(/http:/, 'https:'),
|
|
107
|
+
author: v.owner?.name,
|
|
108
|
+
timestamp: v.pubdate
|
|
109
|
+
? new Date(Number(v.pubdate) * 1000).getTime()
|
|
110
|
+
: 0,
|
|
111
|
+
hot: v.stat?.view || 0,
|
|
112
|
+
url: v.short_link_v2 || `https://www.bilibili.com/video/${v.bvid}`,
|
|
113
|
+
mobileUrl: `https://m.bilibili.com/video/${v.bvid}`,
|
|
114
|
+
})),
|
|
115
|
+
fromCache: result.fromCache,
|
|
116
|
+
updateTime: result.updateTime,
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
throw new Error('No data from new API');
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
catch (error) {
|
|
124
|
+
this.logger.error('Failed to get data from new API', error);
|
|
125
|
+
throw error;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
async getFromLegacyAPI(type, noCache) {
|
|
129
|
+
try {
|
|
130
|
+
const url = `https://api.bilibili.com/x/web-interface/ranking?jsonp=jsonp&rid=${type}&type=all&callback=__jp0`;
|
|
131
|
+
const result = await this.httpService.get({
|
|
132
|
+
url,
|
|
133
|
+
noCache,
|
|
134
|
+
headers: {
|
|
135
|
+
Referer: 'https://www.bilibili.com/ranking/all',
|
|
136
|
+
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36',
|
|
137
|
+
},
|
|
138
|
+
});
|
|
139
|
+
this.logger.log('Using bilibili legacy API');
|
|
140
|
+
let jsonData;
|
|
141
|
+
if (typeof result.data === 'string') {
|
|
142
|
+
const jsonMatch = result.data.match(/^__jp0\((.*)\)$/);
|
|
143
|
+
if (jsonMatch) {
|
|
144
|
+
jsonData = JSON.parse(jsonMatch[1]);
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
jsonData = JSON.parse(result.data);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
jsonData = result.data;
|
|
152
|
+
}
|
|
153
|
+
const list = jsonData.data.list;
|
|
154
|
+
return {
|
|
155
|
+
data: list.map((v) => ({
|
|
156
|
+
id: v.bvid,
|
|
157
|
+
title: v.title,
|
|
158
|
+
desc: v.desc || '该视频暂无简介',
|
|
159
|
+
cover: v.pic?.replace(/http:/, 'https:'),
|
|
160
|
+
author: v.author,
|
|
161
|
+
timestamp: 0,
|
|
162
|
+
hot: v.video_review || 0,
|
|
163
|
+
url: `https://www.bilibili.com/video/${v.bvid}`,
|
|
164
|
+
mobileUrl: `https://m.bilibili.com/video/${v.bvid}`,
|
|
165
|
+
})),
|
|
166
|
+
fromCache: result.fromCache,
|
|
167
|
+
updateTime: result.updateTime,
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
catch (error) {
|
|
171
|
+
this.logger.error('Failed to get data from legacy API', error);
|
|
172
|
+
throw error;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
exports.BilibiliSource = BilibiliSource;
|
|
177
|
+
exports.BilibiliSource = BilibiliSource = BilibiliSource_1 = __decorate([
|
|
178
|
+
(0, common_1.Injectable)(),
|
|
179
|
+
(0, hot_source_decorator_1.HotSource)({
|
|
180
|
+
name: 'bilibili',
|
|
181
|
+
title: '哔哩哔哩',
|
|
182
|
+
type: '热榜',
|
|
183
|
+
link: 'https://www.bilibili.com/v/popular/rank/all',
|
|
184
|
+
}),
|
|
185
|
+
__metadata("design:paramtypes", [http_service_1.HttpClientService,
|
|
186
|
+
token_service_1.TokenService])
|
|
187
|
+
], BilibiliSource);
|
|
188
|
+
//# sourceMappingURL=bilibili.source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bilibili.source.js","sourceRoot":"","sources":["../../../src/host-lists/sources/bilibili.source.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAoD;AACpD,6EAA+D;AAG/D,0DAA4D;AAC5D,6DAAyD;AAGzD,MAAM,OAAO,GAA2B;IACtC,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,KAAK,EAAE,IAAI;IACX,KAAK,EAAE,IAAI;IACX,KAAK,EAAE,IAAI;IACX,KAAK,EAAE,IAAI;IACX,KAAK,EAAE,IAAI;IACX,KAAK,EAAE,MAAM;IACb,KAAK,EAAE,IAAI;CACZ,CAAC;AAqBK,IAAM,cAAc,sBAApB,MAAM,cAAc;IAGzB,YACmB,WAA8B,EAC9B,YAA0B;QAD1B,gBAAW,GAAX,WAAW,CAAmB;QAC9B,i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Ac;yBAAd,cAAc;IAP1B,IAAA,mBAAU,GAAE;IACZ,IAAA,gCAAS,EAAC;QACT,IAAI,EAAE,UAAU;QAChB,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,IAAI;QACV,IAAI,EAAE,6CAA6C;KACpD,CAAC;qCAKgC,gCAAiB;QAChB,4BAAY;GALlC,cAAc,CAgK1B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { HttpClientService } from '../../http/http.service';
|
|
2
|
+
import { HotListGetListResponse } from '../interfaces/hot-list.interface';
|
|
3
|
+
import { HotListSource } from '../interfaces/hot-list-source.interface';
|
|
4
|
+
import { GetListOptions } from './source.types';
|
|
5
|
+
export declare class CaixinSource implements HotListSource {
|
|
6
|
+
private readonly httpService;
|
|
7
|
+
constructor(httpService: HttpClientService);
|
|
8
|
+
getList(options: GetListOptions, noCache?: boolean): Promise<HotListGetListResponse>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
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.CaixinSource = void 0;
|
|
46
|
+
const http_service_1 = require("../../http/http.service");
|
|
47
|
+
const common_1 = require("@nestjs/common");
|
|
48
|
+
const cheerio = __importStar(require("cheerio"));
|
|
49
|
+
const hot_source_decorator_1 = require("../decorators/hot-source.decorator");
|
|
50
|
+
let CaixinSource = class CaixinSource {
|
|
51
|
+
constructor(httpService) {
|
|
52
|
+
this.httpService = httpService;
|
|
53
|
+
}
|
|
54
|
+
async getList(options, noCache) {
|
|
55
|
+
const url = 'https://www.caixin.com/';
|
|
56
|
+
const result = await this.httpService.get({
|
|
57
|
+
url,
|
|
58
|
+
noCache,
|
|
59
|
+
});
|
|
60
|
+
const $ = cheerio.load(result?.data);
|
|
61
|
+
const list = [];
|
|
62
|
+
$('.news_list dl').each((index, element) => {
|
|
63
|
+
const title = $(element).find('dd p a').text().trim();
|
|
64
|
+
const link = $(element).find('dd p a').attr('href');
|
|
65
|
+
const imgSrc = $(element).find('dt img').attr('src');
|
|
66
|
+
const author = $(element).find('dd span').text().trim();
|
|
67
|
+
list.push({
|
|
68
|
+
title,
|
|
69
|
+
link,
|
|
70
|
+
imgSrc,
|
|
71
|
+
author,
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
return {
|
|
75
|
+
data: list.map((v) => ({
|
|
76
|
+
id: v.link?.match(/\d+/)?.[0] || '',
|
|
77
|
+
title: v.title,
|
|
78
|
+
cover: v.imgSrc || undefined,
|
|
79
|
+
desc: '',
|
|
80
|
+
author: v.author,
|
|
81
|
+
timestamp: undefined,
|
|
82
|
+
hot: undefined,
|
|
83
|
+
url: v.link || '',
|
|
84
|
+
mobileUrl: v.link || '',
|
|
85
|
+
})),
|
|
86
|
+
fromCache: result.fromCache,
|
|
87
|
+
updateTime: result.updateTime,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
exports.CaixinSource = CaixinSource;
|
|
92
|
+
exports.CaixinSource = CaixinSource = __decorate([
|
|
93
|
+
(0, common_1.Injectable)(),
|
|
94
|
+
(0, hot_source_decorator_1.HotSource)({
|
|
95
|
+
name: 'caixin',
|
|
96
|
+
title: '财新网',
|
|
97
|
+
type: '排行榜',
|
|
98
|
+
link: 'https://www.caixin.com/',
|
|
99
|
+
}),
|
|
100
|
+
__metadata("design:paramtypes", [http_service_1.HttpClientService])
|
|
101
|
+
], CaixinSource);
|
|
102
|
+
//# sourceMappingURL=caixin.source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"caixin.source.js","sourceRoot":"","sources":["../../../src/host-lists/sources/caixin.source.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0DAA4D;AAI5D,2CAA4C;AAE5C,iDAAmC;AACnC,6EAA+D;AASxD,IAAM,YAAY,GAAlB,MAAM,YAAY;IACvB,YAA6B,WAA8B;QAA9B,gBAAW,GAAX,WAAW,CAAmB;IAAG,CAAC;IAE/D,KAAK,CAAC,OAAO,CACX,OAAuB,EACvB,OAAiB;QAEjB,MAAM,GAAG,GAAG,yBAAyB,CAAC;QACtC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,GAAG,CAAS;YAChD,GAAG;YACH,OAAO;SACR,CAAC,CAAC;QACH,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACrC,MAAM,IAAI,GAA2B,EAAE,CAAC;QAExC,CAAC,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;YACzC,MAAM,KAAK,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC;YACtD,MAAM,IAAI,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACpD,MAAM,MAAM,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACrD,MAAM,MAAM,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC;YAExD,I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