@ttkit/daily-hot-api 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +77 -0
- package/LICENSE +21 -0
- package/README.md +317 -2
- package/bin/daily-hot-api.js +25 -0
- package/dist/app.controller.d.ts +41 -0
- package/dist/app.controller.js +91 -0
- package/dist/app.controller.js.map +1 -0
- package/dist/app.module.d.ts +4 -0
- package/dist/app.module.js +44 -0
- package/dist/app.module.js.map +1 -0
- package/dist/app.service.d.ts +19 -0
- package/dist/app.service.js +57 -0
- package/dist/app.service.js.map +1 -0
- package/dist/cache/cache.module.d.ts +2 -0
- package/dist/cache/cache.module.js +52 -0
- package/dist/cache/cache.module.js.map +1 -0
- package/dist/cache/cache.service.d.ts +26 -0
- package/dist/cache/cache.service.js +163 -0
- package/dist/cache/cache.service.js.map +1 -0
- package/dist/cli/args.d.ts +24 -0
- package/dist/cli/args.js +261 -0
- package/dist/cli/args.js.map +1 -0
- package/dist/cli/commands/logs.d.ts +3 -0
- package/dist/cli/commands/logs.js +55 -0
- package/dist/cli/commands/logs.js.map +1 -0
- package/dist/cli/commands/restart.d.ts +3 -0
- package/dist/cli/commands/restart.js +62 -0
- package/dist/cli/commands/restart.js.map +1 -0
- package/dist/cli/commands/start.d.ts +3 -0
- package/dist/cli/commands/start.js +280 -0
- package/dist/cli/commands/start.js.map +1 -0
- package/dist/cli/commands/status.d.ts +3 -0
- package/dist/cli/commands/status.js +78 -0
- package/dist/cli/commands/status.js.map +1 -0
- package/dist/cli/commands/stop.d.ts +12 -0
- package/dist/cli/commands/stop.js +135 -0
- package/dist/cli/commands/stop.js.map +1 -0
- package/dist/cli/context.d.ts +4 -0
- package/dist/cli/context.js +3 -0
- package/dist/cli/context.js.map +1 -0
- package/dist/cli/env.d.ts +2 -0
- package/dist/cli/env.js +80 -0
- package/dist/cli/env.js.map +1 -0
- package/dist/cli/errors.d.ts +14 -0
- package/dist/cli/errors.js +25 -0
- package/dist/cli/errors.js.map +1 -0
- package/dist/cli/health.d.ts +2 -0
- package/dist/cli/health.js +44 -0
- package/dist/cli/health.js.map +1 -0
- package/dist/cli/help.d.ts +3 -0
- package/dist/cli/help.js +158 -0
- package/dist/cli/help.js.map +1 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +94 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/log-file.d.ts +8 -0
- package/dist/cli/log-file.js +58 -0
- package/dist/cli/log-file.js.map +1 -0
- package/dist/cli/output.d.ts +7 -0
- package/dist/cli/output.js +46 -0
- package/dist/cli/output.js.map +1 -0
- package/dist/cli/paths.d.ts +33 -0
- package/dist/cli/paths.js +76 -0
- package/dist/cli/paths.js.map +1 -0
- package/dist/cli/run-state.d.ts +25 -0
- package/dist/cli/run-state.js +159 -0
- package/dist/cli/run-state.js.map +1 -0
- package/dist/common/middlewares/logger.middleware.d.ts +7 -0
- package/dist/common/middlewares/logger.middleware.js +29 -0
- package/dist/common/middlewares/logger.middleware.js.map +1 -0
- package/dist/config/config.module.d.ts +2 -0
- package/dist/config/config.module.js +47 -0
- package/dist/config/config.module.js.map +1 -0
- package/dist/config/configuration.d.ts +3 -0
- package/dist/config/configuration.js +5 -0
- package/dist/config/configuration.js.map +1 -0
- package/dist/config/validation.schema.d.ts +114 -0
- package/dist/config/validation.schema.js +69 -0
- package/dist/config/validation.schema.js.map +1 -0
- package/dist/daily-brief/clients/ai-analysis.client.d.ts +20 -0
- package/dist/daily-brief/clients/ai-analysis.client.js +217 -0
- package/dist/daily-brief/clients/ai-analysis.client.js.map +1 -0
- package/dist/daily-brief/clients/brief-search.service.d.ts +11 -0
- package/dist/daily-brief/clients/brief-search.service.js +52 -0
- package/dist/daily-brief/clients/brief-search.service.js.map +1 -0
- package/dist/daily-brief/clients/deepseek-search.client.d.ts +11 -0
- package/dist/daily-brief/clients/deepseek-search.client.js +70 -0
- package/dist/daily-brief/clients/deepseek-search.client.js.map +1 -0
- package/dist/daily-brief/clients/tavily-search.client.d.ts +11 -0
- package/dist/daily-brief/clients/tavily-search.client.js +72 -0
- package/dist/daily-brief/clients/tavily-search.client.js.map +1 -0
- package/dist/daily-brief/daily-brief.config.d.ts +31 -0
- package/dist/daily-brief/daily-brief.config.js +108 -0
- package/dist/daily-brief/daily-brief.config.js.map +1 -0
- package/dist/daily-brief/daily-brief.controller.d.ts +72 -0
- package/dist/daily-brief/daily-brief.controller.js +169 -0
- package/dist/daily-brief/daily-brief.controller.js.map +1 -0
- package/dist/daily-brief/daily-brief.module.d.ts +2 -0
- package/dist/daily-brief/daily-brief.module.js +49 -0
- package/dist/daily-brief/daily-brief.module.js.map +1 -0
- package/dist/daily-brief/daily-brief.scheduler.d.ts +30 -0
- package/dist/daily-brief/daily-brief.scheduler.js +113 -0
- package/dist/daily-brief/daily-brief.scheduler.js.map +1 -0
- package/dist/daily-brief/daily-brief.service.d.ts +101 -0
- package/dist/daily-brief/daily-brief.service.js +412 -0
- package/dist/daily-brief/daily-brief.service.js.map +1 -0
- package/dist/daily-brief/dto/brief-date-param.dto.d.ts +3 -0
- package/dist/daily-brief/dto/brief-date-param.dto.js +23 -0
- package/dist/daily-brief/dto/brief-date-param.dto.js.map +1 -0
- package/dist/daily-brief/dto/generate-brief.dto.d.ts +6 -0
- package/dist/daily-brief/dto/generate-brief.dto.js +39 -0
- package/dist/daily-brief/dto/generate-brief.dto.js.map +1 -0
- package/dist/daily-brief/dto/list-briefs-query.dto.d.ts +6 -0
- package/dist/daily-brief/dto/list-briefs-query.dto.js +42 -0
- package/dist/daily-brief/dto/list-briefs-query.dto.js.map +1 -0
- package/dist/daily-brief/dto/stock-ranking-query.dto.d.ts +6 -0
- package/dist/daily-brief/dto/stock-ranking-query.dto.js +46 -0
- package/dist/daily-brief/dto/stock-ranking-query.dto.js.map +1 -0
- package/dist/daily-brief/interfaces/daily-brief.interface.d.ts +59 -0
- package/dist/daily-brief/interfaces/daily-brief.interface.js +3 -0
- package/dist/daily-brief/interfaces/daily-brief.interface.js.map +1 -0
- package/dist/daily-brief/interfaces/search-provider.interface.d.ts +11 -0
- package/dist/daily-brief/interfaces/search-provider.interface.js +3 -0
- package/dist/daily-brief/interfaces/search-provider.interface.js.map +1 -0
- package/dist/daily-brief/utils/brief-date.d.ts +2 -0
- package/dist/daily-brief/utils/brief-date.js +16 -0
- package/dist/daily-brief/utils/brief-date.js.map +1 -0
- package/dist/daily-brief/utils/concurrency.d.ts +1 -0
- package/dist/daily-brief/utils/concurrency.js +20 -0
- package/dist/daily-brief/utils/concurrency.js.map +1 -0
- package/dist/database/database.module.d.ts +2 -0
- package/dist/database/database.module.js +57 -0
- package/dist/database/database.module.js.map +1 -0
- package/dist/database/repositories/daily-brief.repository.d.ts +96 -0
- package/dist/database/repositories/daily-brief.repository.js +457 -0
- package/dist/database/repositories/daily-brief.repository.js.map +1 -0
- package/dist/database/repositories/hot-item.repository.d.ts +52 -0
- package/dist/database/repositories/hot-item.repository.js +255 -0
- package/dist/database/repositories/hot-item.repository.js.map +1 -0
- package/dist/database/repositories/source-config.repository.d.ts +15 -0
- package/dist/database/repositories/source-config.repository.js +77 -0
- package/dist/database/repositories/source-config.repository.js.map +1 -0
- package/dist/database/schemas/daily-brief.schema.d.ts +30 -0
- package/dist/database/schemas/daily-brief.schema.js +103 -0
- package/dist/database/schemas/daily-brief.schema.js.map +1 -0
- package/dist/database/schemas/hot-item.schema.d.ts +20 -0
- package/dist/database/schemas/hot-item.schema.js +72 -0
- package/dist/database/schemas/hot-item.schema.js.map +1 -0
- package/dist/database/schemas/source-config.schema.d.ts +15 -0
- package/dist/database/schemas/source-config.schema.js +47 -0
- package/dist/database/schemas/source-config.schema.js.map +1 -0
- package/dist/history/dto/history-response.dto.d.ts +17 -0
- package/dist/history/dto/history-response.dto.js +13 -0
- package/dist/history/dto/history-response.dto.js.map +1 -0
- package/dist/history/dto/search-history.dto.d.ts +10 -0
- package/dist/history/dto/search-history.dto.js +72 -0
- package/dist/history/dto/search-history.dto.js.map +1 -0
- package/dist/history/history.controller.d.ts +13 -0
- package/dist/history/history.controller.js +92 -0
- package/dist/history/history.controller.js.map +1 -0
- package/dist/history/history.module.d.ts +2 -0
- package/dist/history/history.module.js +25 -0
- package/dist/history/history.module.js.map +1 -0
- package/dist/history/history.service.d.ts +15 -0
- package/dist/history/history.service.js +68 -0
- package/dist/history/history.service.js.map +1 -0
- package/dist/host-lists/decorators/hot-source.decorator.d.ts +9 -0
- package/dist/host-lists/decorators/hot-source.decorator.js +11 -0
- package/dist/host-lists/decorators/hot-source.decorator.js.map +1 -0
- package/dist/host-lists/dto/hot-list.dto.d.ts +14 -0
- package/dist/host-lists/dto/hot-list.dto.js +94 -0
- package/dist/host-lists/dto/hot-list.dto.js.map +1 -0
- package/dist/host-lists/hot-lists.controller.d.ts +39 -0
- package/dist/host-lists/hot-lists.controller.js +87 -0
- package/dist/host-lists/hot-lists.controller.js.map +1 -0
- package/dist/host-lists/hot-lists.module.d.ts +2 -0
- package/dist/host-lists/hot-lists.module.js +36 -0
- package/dist/host-lists/hot-lists.module.js.map +1 -0
- package/dist/host-lists/hot-lists.service.d.ts +21 -0
- package/dist/host-lists/hot-lists.service.js +115 -0
- package/dist/host-lists/hot-lists.service.js.map +1 -0
- package/dist/host-lists/interfaces/hot-list-source.interface.d.ts +5 -0
- package/dist/host-lists/interfaces/hot-list-source.interface.js +3 -0
- package/dist/host-lists/interfaces/hot-list-source.interface.js.map +1 -0
- package/dist/host-lists/interfaces/hot-list.interface.d.ts +31 -0
- package/dist/host-lists/interfaces/hot-list.interface.js +3 -0
- package/dist/host-lists/interfaces/hot-list.interface.js.map +1 -0
- package/dist/host-lists/interfaces/router-data.interface.d.ts +19 -0
- package/dist/host-lists/interfaces/router-data.interface.js +3 -0
- package/dist/host-lists/interfaces/router-data.interface.js.map +1 -0
- package/dist/host-lists/sources/36kr.source.d.ts +9 -0
- package/dist/host-lists/sources/36kr.source.js +89 -0
- package/dist/host-lists/sources/36kr.source.js.map +1 -0
- package/dist/host-lists/sources/51cto.source.d.ts +11 -0
- package/dist/host-lists/sources/51cto.source.js +71 -0
- package/dist/host-lists/sources/51cto.source.js.map +1 -0
- package/dist/host-lists/sources/52pojie.source.d.ts +9 -0
- package/dist/host-lists/sources/52pojie.source.js +109 -0
- package/dist/host-lists/sources/52pojie.source.js.map +1 -0
- package/dist/host-lists/sources/acfun.source.d.ts +9 -0
- package/dist/host-lists/sources/acfun.source.js +90 -0
- package/dist/host-lists/sources/acfun.source.js.map +1 -0
- package/dist/host-lists/sources/baidu.source.d.ts +9 -0
- package/dist/host-lists/sources/baidu.source.js +85 -0
- package/dist/host-lists/sources/baidu.source.js.map +1 -0
- package/dist/host-lists/sources/bilibili.source.d.ts +14 -0
- package/dist/host-lists/sources/bilibili.source.js +188 -0
- package/dist/host-lists/sources/bilibili.source.js.map +1 -0
- package/dist/host-lists/sources/caixin.source.d.ts +9 -0
- package/dist/host-lists/sources/caixin.source.js +102 -0
- package/dist/host-lists/sources/caixin.source.js.map +1 -0
- package/dist/host-lists/sources/cls.source.d.ts +9 -0
- package/dist/host-lists/sources/cls.source.js +62 -0
- package/dist/host-lists/sources/cls.source.js.map +1 -0
- package/dist/host-lists/sources/coolapk.source.d.ts +9 -0
- package/dist/host-lists/sources/coolapk.source.js +57 -0
- package/dist/host-lists/sources/coolapk.source.js.map +1 -0
- package/dist/host-lists/sources/csdn.source.d.ts +9 -0
- package/dist/host-lists/sources/csdn.source.js +59 -0
- package/dist/host-lists/sources/csdn.source.js.map +1 -0
- package/dist/host-lists/sources/dgtle.source.d.ts +9 -0
- package/dist/host-lists/sources/dgtle.source.js +57 -0
- package/dist/host-lists/sources/dgtle.source.js.map +1 -0
- package/dist/host-lists/sources/douban-group.source.d.ts +11 -0
- package/dist/host-lists/sources/douban-group.source.js +100 -0
- package/dist/host-lists/sources/douban-group.source.js.map +1 -0
- package/dist/host-lists/sources/douban-movie.source.d.ts +10 -0
- package/dist/host-lists/sources/douban-movie.source.js +103 -0
- package/dist/host-lists/sources/douban-movie.source.js.map +1 -0
- package/dist/host-lists/sources/douyin.d.ts +16 -0
- package/dist/host-lists/sources/douyin.js +215 -0
- package/dist/host-lists/sources/douyin.js.map +1 -0
- package/dist/host-lists/sources/eastmoney-stock.source.d.ts +11 -0
- package/dist/host-lists/sources/eastmoney-stock.source.js +151 -0
- package/dist/host-lists/sources/eastmoney-stock.source.js.map +1 -0
- package/dist/host-lists/sources/eastmoney.source.d.ts +9 -0
- package/dist/host-lists/sources/eastmoney.source.js +86 -0
- package/dist/host-lists/sources/eastmoney.source.js.map +1 -0
- package/dist/host-lists/sources/geekpark.source.d.ts +9 -0
- package/dist/host-lists/sources/geekpark.source.js +60 -0
- package/dist/host-lists/sources/geekpark.source.js.map +1 -0
- package/dist/host-lists/sources/gelonghui.source.d.ts +9 -0
- package/dist/host-lists/sources/gelonghui.source.js +139 -0
- package/dist/host-lists/sources/gelonghui.source.js.map +1 -0
- package/dist/host-lists/sources/github.source.d.ts +12 -0
- package/dist/host-lists/sources/github.source.js +171 -0
- package/dist/host-lists/sources/github.source.js.map +1 -0
- package/dist/host-lists/sources/guokr.source.d.ts +11 -0
- package/dist/host-lists/sources/guokr.source.js +98 -0
- package/dist/host-lists/sources/guokr.source.js.map +1 -0
- package/dist/host-lists/sources/hackernews.source.d.ts +11 -0
- package/dist/host-lists/sources/hackernews.source.js +121 -0
- package/dist/host-lists/sources/hackernews.source.js.map +1 -0
- package/dist/host-lists/sources/hellogithub.source.d.ts +11 -0
- package/dist/host-lists/sources/hellogithub.source.js +98 -0
- package/dist/host-lists/sources/hellogithub.source.js.map +1 -0
- package/dist/host-lists/sources/history.source.d.ts +11 -0
- package/dist/host-lists/sources/history.source.js +92 -0
- package/dist/host-lists/sources/history.source.js.map +1 -0
- package/dist/host-lists/sources/honkai.source.d.ts +9 -0
- package/dist/host-lists/sources/honkai.source.js +72 -0
- package/dist/host-lists/sources/honkai.source.js.map +1 -0
- package/dist/host-lists/sources/hostloc.source.d.ts +9 -0
- package/dist/host-lists/sources/hostloc.source.js +75 -0
- package/dist/host-lists/sources/hostloc.source.js.map +1 -0
- package/dist/host-lists/sources/hupu.source.d.ts +9 -0
- package/dist/host-lists/sources/hupu.source.js +73 -0
- package/dist/host-lists/sources/hupu.source.js.map +1 -0
- package/dist/host-lists/sources/huxiu.source.d.ts +9 -0
- package/dist/host-lists/sources/huxiu.source.js +153 -0
- package/dist/host-lists/sources/huxiu.source.js.map +1 -0
- package/dist/host-lists/sources/ifanr.source.d.ts +9 -0
- package/dist/host-lists/sources/ifanr.source.js +57 -0
- package/dist/host-lists/sources/ifanr.source.js.map +1 -0
- package/dist/host-lists/sources/index.d.ts +2 -0
- package/dist/host-lists/sources/index.js +134 -0
- package/dist/host-lists/sources/index.js.map +1 -0
- package/dist/host-lists/sources/ithome-xijiayi.source.d.ts +9 -0
- package/dist/host-lists/sources/ithome-xijiayi.source.js +75 -0
- package/dist/host-lists/sources/ithome-xijiayi.source.js.map +1 -0
- package/dist/host-lists/sources/ithome.source.d.ts +9 -0
- package/dist/host-lists/sources/ithome.source.js +71 -0
- package/dist/host-lists/sources/ithome.source.js.map +1 -0
- package/dist/host-lists/sources/jd.source.d.ts +9 -0
- package/dist/host-lists/sources/jd.source.js +82 -0
- package/dist/host-lists/sources/jd.source.js.map +1 -0
- package/dist/host-lists/sources/jianshu.source.d.ts +9 -0
- package/dist/host-lists/sources/jianshu.source.js +72 -0
- package/dist/host-lists/sources/jianshu.source.js.map +1 -0
- package/dist/host-lists/sources/jin10.source.d.ts +9 -0
- package/dist/host-lists/sources/jin10.source.js +63 -0
- package/dist/host-lists/sources/jin10.source.js.map +1 -0
- package/dist/host-lists/sources/juejin.source.d.ts +10 -0
- package/dist/host-lists/sources/juejin.source.js +81 -0
- package/dist/host-lists/sources/juejin.source.js.map +1 -0
- package/dist/host-lists/sources/kuaishou.source.d.ts +13 -0
- package/dist/host-lists/sources/kuaishou.source.js +179 -0
- package/dist/host-lists/sources/kuaishou.source.js.map +1 -0
- package/dist/host-lists/sources/linuxdo.source.d.ts +9 -0
- package/dist/host-lists/sources/linuxdo.source.js +62 -0
- package/dist/host-lists/sources/linuxdo.source.js.map +1 -0
- package/dist/host-lists/sources/lol.source.d.ts +9 -0
- package/dist/host-lists/sources/lol.source.js +58 -0
- package/dist/host-lists/sources/lol.source.js.map +1 -0
- package/dist/host-lists/sources/miyoushe.source.d.ts +9 -0
- package/dist/host-lists/sources/miyoushe.source.js +88 -0
- package/dist/host-lists/sources/miyoushe.source.js.map +1 -0
- package/dist/host-lists/sources/netease-news.source.d.ts +9 -0
- package/dist/host-lists/sources/netease-news.source.js +56 -0
- package/dist/host-lists/sources/netease-news.source.js.map +1 -0
- package/dist/host-lists/sources/ngabbs.source.d.ts +9 -0
- package/dist/host-lists/sources/ngabbs.source.js +70 -0
- package/dist/host-lists/sources/ngabbs.source.js.map +1 -0
- package/dist/host-lists/sources/nodeseek.source.d.ts +9 -0
- package/dist/host-lists/sources/nodeseek.source.js +62 -0
- package/dist/host-lists/sources/nodeseek.source.js.map +1 -0
- package/dist/host-lists/sources/nytimes.source.d.ts +9 -0
- package/dist/host-lists/sources/nytimes.source.js +77 -0
- package/dist/host-lists/sources/nytimes.source.js.map +1 -0
- package/dist/host-lists/sources/producthunt.source.d.ts +9 -0
- package/dist/host-lists/sources/producthunt.source.js +75 -0
- package/dist/host-lists/sources/producthunt.source.js.map +1 -0
- package/dist/host-lists/sources/qq-news.source.d.ts +9 -0
- package/dist/host-lists/sources/qq-news.source.js +53 -0
- package/dist/host-lists/sources/qq-news.source.js.map +1 -0
- package/dist/host-lists/sources/sina-news.source.d.ts +9 -0
- package/dist/host-lists/sources/sina-news.source.js +98 -0
- package/dist/host-lists/sources/sina-news.source.js.map +1 -0
- package/dist/host-lists/sources/sina.source.d.ts +9 -0
- package/dist/host-lists/sources/sina.source.js +78 -0
- package/dist/host-lists/sources/sina.source.js.map +1 -0
- package/dist/host-lists/sources/smzdm.source.d.ts +9 -0
- package/dist/host-lists/sources/smzdm.source.js +71 -0
- package/dist/host-lists/sources/smzdm.source.js.map +1 -0
- package/dist/host-lists/sources/sspai.source.d.ts +9 -0
- package/dist/host-lists/sources/sspai.source.js +69 -0
- package/dist/host-lists/sources/sspai.source.js.map +1 -0
- package/dist/host-lists/sources/starrail.source.d.ts +9 -0
- package/dist/host-lists/sources/starrail.source.js +72 -0
- package/dist/host-lists/sources/starrail.source.js.map +1 -0
- package/dist/host-lists/sources/taobao.source.d.ts +10 -0
- package/dist/host-lists/sources/taobao.source.js +169 -0
- package/dist/host-lists/sources/taobao.source.js.map +1 -0
- package/dist/host-lists/sources/thepaper.source.d.ts +9 -0
- package/dist/host-lists/sources/thepaper.source.js +56 -0
- package/dist/host-lists/sources/thepaper.source.js.map +1 -0
- package/dist/host-lists/sources/tieba.source.d.ts +9 -0
- package/dist/host-lists/sources/tieba.source.js +58 -0
- package/dist/host-lists/sources/tieba.source.js.map +1 -0
- package/dist/host-lists/sources/tonghuashun.source.d.ts +9 -0
- package/dist/host-lists/sources/tonghuashun.source.js +112 -0
- package/dist/host-lists/sources/tonghuashun.source.js.map +1 -0
- package/dist/host-lists/sources/toutiao.source.d.ts +9 -0
- package/dist/host-lists/sources/toutiao.source.js +56 -0
- package/dist/host-lists/sources/toutiao.source.js.map +1 -0
- package/dist/host-lists/sources/v2ex.source.d.ts +9 -0
- package/dist/host-lists/sources/v2ex.source.js +67 -0
- package/dist/host-lists/sources/v2ex.source.js.map +1 -0
- package/dist/host-lists/sources/wallstreet.source.d.ts +9 -0
- package/dist/host-lists/sources/wallstreet.source.js +59 -0
- package/dist/host-lists/sources/wallstreet.source.js.map +1 -0
- package/dist/host-lists/sources/weatheralarm.source.d.ts +9 -0
- package/dist/host-lists/sources/weatheralarm.source.js +68 -0
- package/dist/host-lists/sources/weatheralarm.source.js.map +1 -0
- package/dist/host-lists/sources/weibo.source.d.ts +15 -0
- package/dist/host-lists/sources/weibo.source.js +180 -0
- package/dist/host-lists/sources/weibo.source.js.map +1 -0
- package/dist/host-lists/sources/weread.source.d.ts +9 -0
- package/dist/host-lists/sources/weread.source.js +82 -0
- package/dist/host-lists/sources/weread.source.js.map +1 -0
- package/dist/host-lists/sources/xinyu.source.d.ts +9 -0
- package/dist/host-lists/sources/xinyu.source.js +151 -0
- package/dist/host-lists/sources/xinyu.source.js.map +1 -0
- package/dist/host-lists/sources/yicai.source.d.ts +9 -0
- package/dist/host-lists/sources/yicai.source.js +113 -0
- package/dist/host-lists/sources/yicai.source.js.map +1 -0
- package/dist/host-lists/sources/yystv.source.d.ts +9 -0
- package/dist/host-lists/sources/yystv.source.js +57 -0
- package/dist/host-lists/sources/yystv.source.js.map +1 -0
- package/dist/host-lists/sources/zhihu-daily.source.d.ts +9 -0
- package/dist/host-lists/sources/zhihu-daily.source.js +60 -0
- package/dist/host-lists/sources/zhihu-daily.source.js.map +1 -0
- package/dist/host-lists/sources/zhihu.source.d.ts +12 -0
- package/dist/host-lists/sources/zhihu.source.js +195 -0
- package/dist/host-lists/sources/zhihu.source.js.map +1 -0
- package/dist/http/http.module.d.ts +2 -0
- package/dist/http/http.module.js +30 -0
- package/dist/http/http.module.js.map +1 -0
- package/dist/http/http.service.d.ts +53 -0
- package/dist/http/http.service.js +277 -0
- package/dist/http/http.service.js.map +1 -0
- package/dist/main.d.ts +3 -0
- package/dist/main.js +70 -0
- package/dist/main.js.map +1 -0
- package/dist/rss/rss.module.d.ts +2 -0
- package/dist/rss/rss.module.js +21 -0
- package/dist/rss/rss.module.js.map +1 -0
- package/dist/rss/rss.service.d.ts +5 -0
- package/dist/rss/rss.service.js +55 -0
- package/dist/rss/rss.service.js.map +1 -0
- package/dist/scheduler/dto/trigger-fetch.dto.d.ts +3 -0
- package/dist/scheduler/dto/trigger-fetch.dto.js +22 -0
- package/dist/scheduler/dto/trigger-fetch.dto.js.map +1 -0
- package/dist/scheduler/dto/update-source-config.dto.d.ts +4 -0
- package/dist/scheduler/dto/update-source-config.dto.js +29 -0
- package/dist/scheduler/dto/update-source-config.dto.js.map +1 -0
- package/dist/scheduler/scheduler.controller.d.ts +52 -0
- package/dist/scheduler/scheduler.controller.js +132 -0
- package/dist/scheduler/scheduler.controller.js.map +1 -0
- package/dist/scheduler/scheduler.module.d.ts +2 -0
- package/dist/scheduler/scheduler.module.js +34 -0
- package/dist/scheduler/scheduler.module.js.map +1 -0
- package/dist/scheduler/scheduler.service.d.ts +54 -0
- package/dist/scheduler/scheduler.service.js +238 -0
- package/dist/scheduler/scheduler.service.js.map +1 -0
- package/dist/scheduler/tasks/fetch-hot-data.task.d.ts +34 -0
- package/dist/scheduler/tasks/fetch-hot-data.task.js +175 -0
- package/dist/scheduler/tasks/fetch-hot-data.task.js.map +1 -0
- package/dist/token/coolapk.d.ts +11 -0
- package/dist/token/coolapk.js +40 -0
- package/dist/token/coolapk.js.map +1 -0
- package/dist/token/token.module.d.ts +2 -0
- package/dist/token/token.module.js +23 -0
- package/dist/token/token.module.js.map +1 -0
- package/dist/token/token.service.d.ts +19 -0
- package/dist/token/token.service.js +115 -0
- package/dist/token/token.service.js.map +1 -0
- package/dist/token/tools.d.ts +1 -0
- package/dist/token/tools.js +15 -0
- package/dist/token/tools.js.map +1 -0
- package/dist/token/weread.d.ts +2 -0
- package/dist/token/weread.js +55 -0
- package/dist/token/weread.js.map +1 -0
- package/dist/utils/getNum.d.ts +1 -0
- package/dist/utils/getNum.js +20 -0
- package/dist/utils/getNum.js.map +1 -0
- package/dist/utils/getTime.d.ts +11 -0
- package/dist/utils/getTime.js +134 -0
- package/dist/utils/getTime.js.map +1 -0
- package/dist/utils/headers.d.ts +16 -0
- package/dist/utils/headers.js +20 -0
- package/dist/utils/headers.js.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +12 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/parseRSS.d.ts +11 -0
- package/dist/utils/parseRSS.js +47 -0
- package/dist/utils/parseRSS.js.map +1 -0
- package/package.json +148 -4
- package/views/home.hbs +65 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.NeteaseNewsSource = 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 NeteaseNewsSource = class NeteaseNewsSource {
|
|
18
|
+
constructor(httpService) {
|
|
19
|
+
this.httpService = httpService;
|
|
20
|
+
}
|
|
21
|
+
async getList(_options, noCache) {
|
|
22
|
+
const url = 'https://m.163.com/fe/api/hot/news/flow';
|
|
23
|
+
const result = await this.httpService.get({
|
|
24
|
+
url,
|
|
25
|
+
noCache,
|
|
26
|
+
});
|
|
27
|
+
const list = result.data.data.list || [];
|
|
28
|
+
return {
|
|
29
|
+
data: list.map((v) => ({
|
|
30
|
+
id: v.docid,
|
|
31
|
+
title: v.title,
|
|
32
|
+
cover: v.imgsrc,
|
|
33
|
+
author: v.source,
|
|
34
|
+
hot: undefined,
|
|
35
|
+
timestamp: (0, getTime_1.getTime)(v.ptime),
|
|
36
|
+
url: `https://www.163.com/dy/article/${v.docid}.html`,
|
|
37
|
+
mobileUrl: `https://m.163.com/dy/article/${v.docid}.html`,
|
|
38
|
+
})),
|
|
39
|
+
type: '热点榜',
|
|
40
|
+
fromCache: result.fromCache,
|
|
41
|
+
updateTime: result.updateTime,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
exports.NeteaseNewsSource = NeteaseNewsSource;
|
|
46
|
+
exports.NeteaseNewsSource = NeteaseNewsSource = __decorate([
|
|
47
|
+
(0, common_1.Injectable)(),
|
|
48
|
+
(0, hot_source_decorator_1.HotSource)({
|
|
49
|
+
name: 'netease-news',
|
|
50
|
+
title: '网易新闻',
|
|
51
|
+
type: '热点榜',
|
|
52
|
+
link: 'https://m.163.com/hot',
|
|
53
|
+
}),
|
|
54
|
+
__metadata("design:paramtypes", [http_service_1.HttpClientService])
|
|
55
|
+
], NeteaseNewsSource);
|
|
56
|
+
//# sourceMappingURL=netease-news.source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"netease-news.source.js","sourceRoot":"","sources":["../../../src/host-lists/sources/netease-news.source.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6EAA+D;AAG/D,0DAA4D;AAE5D,iDAA4C;AAerC,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAC5B,YAA6B,WAA8B;QAA9B,gBAAW,GAAX,WAAW,CAAmB;IAAG,CAAC;IAE/D,KAAK,CAAC,OAAO,CACX,QAAwB,EACxB,OAAiB;QAEjB,MAAM,GAAG,GAAG,wCAAwC,CAAC;QACrD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,GAAG,CAAyB;YAChE,GAAG;YACH,OAAO;SACR,CAAC,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC;QACzC,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;gBACrB,EAAE,EAAE,CAAC,CAAC,KAAK;gBACX,KAAK,EAAE,CAAC,CAAC,KAAK;gBACd,KAAK,EAAE,CAAC,CAAC,MAAM;gBACf,MAAM,EAAE,CAAC,CAAC,MAAM;gBAChB,GAAG,EAAE,SAAS;gBACd,SAAS,EAAE,IAAA,iBAAO,EAAC,CAAC,CAAC,KAAK,CAAC;gBAC3B,GAAG,EAAE,kCAAkC,CAAC,CAAC,KAAK,OAAO;gBACrD,SAAS,EAAE,gCAAgC,CAAC,CAAC,KAAK,OAAO;aAC1D,CAAC,CAAC;YACH,IAAI,EAAE,KAAK;YACX,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,UAAU,EAAE,MAAM,CAAC,UAAU;SAC9B,CAAC;IACJ,CAAC;CACF,CAAA;AA7BY,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,uBAAuB;KAC9B,CAAC;qCAE0C,gCAAiB;GADhD,iBAAiB,CA6B7B"}
|
|
@@ -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 NgabbsSource implements HotListSource {
|
|
6
|
+
private readonly httpService;
|
|
7
|
+
constructor(httpService: HttpClientService);
|
|
8
|
+
getList(_options: GetListOptions, noCache?: boolean): Promise<HotListGetListResponse>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
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.NgabbsSource = 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 NgabbsSource = class NgabbsSource {
|
|
18
|
+
constructor(httpService) {
|
|
19
|
+
this.httpService = httpService;
|
|
20
|
+
}
|
|
21
|
+
async getList(_options, noCache) {
|
|
22
|
+
const url = 'https://ngabbs.com/nuke.php?__lib=load_topic&__act=load_topic_reply_ladder2&opt=1&all=1';
|
|
23
|
+
const result = await this.httpService.post({
|
|
24
|
+
url,
|
|
25
|
+
noCache,
|
|
26
|
+
headers: {
|
|
27
|
+
Accept: '*/*',
|
|
28
|
+
Host: 'ngabbs.com',
|
|
29
|
+
Referer: 'https://ngabbs.com/',
|
|
30
|
+
Connection: 'keep-alive',
|
|
31
|
+
'Content-Length': '11',
|
|
32
|
+
'Accept-Encoding': 'gzip, deflate, br',
|
|
33
|
+
'Accept-Language': 'zh-Hans-CN;q=1',
|
|
34
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
35
|
+
'User-Agent': 'Apifox/1.0.0 (https://apifox.com)',
|
|
36
|
+
'X-User-Agent': 'NGA_skull/7.3.1(iPhone13,2;iOS 17.2.1)',
|
|
37
|
+
},
|
|
38
|
+
data: {
|
|
39
|
+
__output: '14',
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
const list = result.data.result[0] || [];
|
|
43
|
+
return {
|
|
44
|
+
data: list.map((v) => ({
|
|
45
|
+
id: v.tid,
|
|
46
|
+
title: v.subject,
|
|
47
|
+
author: v.author,
|
|
48
|
+
hot: v.replies,
|
|
49
|
+
timestamp: (0, getTime_1.getTime)(v.postdate),
|
|
50
|
+
url: `https://bbs.nga.cn${v.tpcurl}`,
|
|
51
|
+
mobileUrl: `https://bbs.nga.cn${v.tpcurl}`,
|
|
52
|
+
})),
|
|
53
|
+
fromCache: result.fromCache,
|
|
54
|
+
updateTime: result.updateTime,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
exports.NgabbsSource = NgabbsSource;
|
|
59
|
+
exports.NgabbsSource = NgabbsSource = __decorate([
|
|
60
|
+
(0, common_1.Injectable)(),
|
|
61
|
+
(0, hot_source_decorator_1.HotSource)({
|
|
62
|
+
name: 'ngabbs',
|
|
63
|
+
title: 'NGA',
|
|
64
|
+
type: '论坛热帖',
|
|
65
|
+
description: '精英玩家俱乐部',
|
|
66
|
+
link: 'https://ngabbs.com/',
|
|
67
|
+
}),
|
|
68
|
+
__metadata("design:paramtypes", [http_service_1.HttpClientService])
|
|
69
|
+
], NgabbsSource);
|
|
70
|
+
//# sourceMappingURL=ngabbs.source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngabbs.source.js","sourceRoot":"","sources":["../../../src/host-lists/sources/ngabbs.source.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6EAA+D;AAG/D,0DAA4D;AAE5D,iDAA4C;AAcrC,IAAM,YAAY,GAAlB,MAAM,YAAY;IACvB,YAA6B,WA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AZ,YAAY;IARxB,IAAA,mBAAU,GAAE;IACZ,IAAA,gCAAS,EAAC;QACT,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,KAAK;QACZ,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,SAAS;QACtB,IAAI,EAAE,qBAAqB;KAC5B,CAAC;qCAE0C,gCAAiB;GADhD,YAAY,CA2CxB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { HotListSource } from '../interfaces/hot-list-source.interface';
|
|
2
|
+
import { HotListGetListResponse } from '../interfaces/hot-list.interface';
|
|
3
|
+
import { HttpClientService } from '../../http/http.service';
|
|
4
|
+
import { GetListOptions } from './source.types';
|
|
5
|
+
export declare class NodeseekSource 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.NodeseekSource = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const hot_source_decorator_1 = require("../decorators/hot-source.decorator");
|
|
15
|
+
const http_service_1 = require("../../http/http.service");
|
|
16
|
+
const getTime_1 = require("../../utils/getTime");
|
|
17
|
+
const parseRSS_1 = require("../../utils/parseRSS");
|
|
18
|
+
let NodeseekSource = class NodeseekSource {
|
|
19
|
+
constructor(httpService) {
|
|
20
|
+
this.httpService = httpService;
|
|
21
|
+
}
|
|
22
|
+
async getList(_options, noCache) {
|
|
23
|
+
const url = 'https://rss.nodeseek.com/';
|
|
24
|
+
const result = await this.httpService.get({ url, noCache });
|
|
25
|
+
const list = await (0, parseRSS_1.parseRSS)(result.data);
|
|
26
|
+
return {
|
|
27
|
+
data: list.map((v, i) => ({
|
|
28
|
+
id: v.guid || i,
|
|
29
|
+
title: v.title || '',
|
|
30
|
+
desc: v.content?.trim() || '',
|
|
31
|
+
author: v.author,
|
|
32
|
+
timestamp: (0, getTime_1.getTime)(v.pubDate || 0),
|
|
33
|
+
hot: undefined,
|
|
34
|
+
url: v.link || '',
|
|
35
|
+
mobileUrl: v.link || '',
|
|
36
|
+
})),
|
|
37
|
+
type: '最新',
|
|
38
|
+
params: {
|
|
39
|
+
type: {
|
|
40
|
+
name: '分类',
|
|
41
|
+
type: {
|
|
42
|
+
all: '所有',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
fromCache: result.fromCache,
|
|
47
|
+
updateTime: result.updateTime,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
exports.NodeseekSource = NodeseekSource;
|
|
52
|
+
exports.NodeseekSource = NodeseekSource = __decorate([
|
|
53
|
+
(0, common_1.Injectable)(),
|
|
54
|
+
(0, hot_source_decorator_1.HotSource)({
|
|
55
|
+
name: 'nodeseek',
|
|
56
|
+
title: 'NodeSeek',
|
|
57
|
+
type: '最新',
|
|
58
|
+
link: 'https://www.nodeseek.com/',
|
|
59
|
+
}),
|
|
60
|
+
__metadata("design:paramtypes", [http_service_1.HttpClientService])
|
|
61
|
+
], NodeseekSource);
|
|
62
|
+
//# sourceMappingURL=nodeseek.source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nodeseek.source.js","sourceRoot":"","sources":["../../../src/host-lists/sources/nodeseek.source.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6EAA+D;AAG/D,0DAA4D;AAE5D,iDAA4C;AAC5C,mDAA8C;AASvC,IAAM,cAAc,GAApB,MAAM,cAAc;IACzB,YAA6B,WAA8B;QAA9B,gBAAW,GAAX,WAAW,CAAmB;IAAG,CAAC;IAE/D,KAAK,CAAC,OAAO,CACX,QAAwB,EACxB,OAAiB;QAEjB,MAAM,GAAG,GAAG,2BAA2B,CAAC;QACxC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,GAAG,CAAS,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC;QACpE,MAAM,IAAI,GAAG,MAAM,IAAA,mBAAQ,EAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACzC,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;gBACxB,EAAE,EAAE,CAAC,CAAC,IAAI,IAAI,CAAC;gBACf,KAAK,EAAE,CAAC,CAAC,KAAK,IAAI,EAAE;gBACpB,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE;gBAC7B,MAAM,EAAE,CAAC,CAAC,MAAM;gBAChB,SAAS,EAAE,IAAA,iBAAO,EAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC;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,IAAI;YACV,MAAM,EAAE;gBACN,IAAI,EAAE;oBACJ,IAAI,EAAE,IAAI;oBACV,IAAI,EAAE;wBACJ,GAAG,EAAE,IAAI;qBACV;iBACF;aACF;YACD,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,UAAU,EAAE,MAAM,CAAC,UAAU;SAC9B,CAAC;IACJ,CAAC;CACF,CAAA;AAlCY,wCAAc;yBAAd,cAAc;IAP1B,IAAA,mBAAU,GAAE;IACZ,IAAA,gCAAS,EAAC;QACT,IAAI,EAAE,UAAU;QAChB,KAAK,EAAE,UAAU;QACjB,IAAI,EAAE,IAAI;QACV,IAAI,EAAE,2BAA2B;KAClC,CAAC;qCAE0C,gCAAiB;GADhD,cAAc,CAkC1B"}
|
|
@@ -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 NyTimesSource implements HotListSource {
|
|
6
|
+
private readonly httpService;
|
|
7
|
+
constructor(httpService: HttpClientService);
|
|
8
|
+
getList(options: GetListOptions, noCache?: boolean): Promise<HotListGetListResponse>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
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.NyTimesSource = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const hot_source_decorator_1 = require("../decorators/hot-source.decorator");
|
|
15
|
+
const http_service_1 = require("../../http/http.service");
|
|
16
|
+
const getTime_1 = require("../../utils/getTime");
|
|
17
|
+
const parseRSS_1 = require("../../utils/parseRSS");
|
|
18
|
+
const areaMap = {
|
|
19
|
+
china: '中文网',
|
|
20
|
+
global: '全球版',
|
|
21
|
+
};
|
|
22
|
+
let NyTimesSource = class NyTimesSource {
|
|
23
|
+
constructor(httpService) {
|
|
24
|
+
this.httpService = httpService;
|
|
25
|
+
}
|
|
26
|
+
async getList(options, noCache) {
|
|
27
|
+
const area = options?.area || 'china';
|
|
28
|
+
const url = area === 'china'
|
|
29
|
+
? 'https://cn.nytimes.com/rss/'
|
|
30
|
+
: 'https://rss.nytimes.com/services/xml/rss/nyt/World.xml';
|
|
31
|
+
const result = await this.httpService.get({
|
|
32
|
+
url,
|
|
33
|
+
noCache,
|
|
34
|
+
headers: {
|
|
35
|
+
'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',
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
const list = await (0, parseRSS_1.parseRSS)(result.data);
|
|
39
|
+
return {
|
|
40
|
+
data: list.map((v, i) => ({
|
|
41
|
+
id: v.guid || i,
|
|
42
|
+
title: v.title || '',
|
|
43
|
+
desc: v.content?.trim() || '',
|
|
44
|
+
author: v.author,
|
|
45
|
+
timestamp: (0, getTime_1.getTime)(v.pubDate || 0),
|
|
46
|
+
hot: undefined,
|
|
47
|
+
url: v.link || '',
|
|
48
|
+
mobileUrl: v.link || '',
|
|
49
|
+
})),
|
|
50
|
+
type: areaMap[area],
|
|
51
|
+
params: {
|
|
52
|
+
type: {
|
|
53
|
+
name: '地区分类',
|
|
54
|
+
type: areaMap,
|
|
55
|
+
},
|
|
56
|
+
area: {
|
|
57
|
+
name: '地区分类',
|
|
58
|
+
type: areaMap,
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
fromCache: result.fromCache,
|
|
62
|
+
updateTime: result.updateTime,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
exports.NyTimesSource = NyTimesSource;
|
|
67
|
+
exports.NyTimesSource = NyTimesSource = __decorate([
|
|
68
|
+
(0, common_1.Injectable)(),
|
|
69
|
+
(0, hot_source_decorator_1.HotSource)({
|
|
70
|
+
name: 'nytimes',
|
|
71
|
+
title: '纽约时报',
|
|
72
|
+
type: '新闻',
|
|
73
|
+
link: 'https://www.nytimes.com/',
|
|
74
|
+
}),
|
|
75
|
+
__metadata("design:paramtypes", [http_service_1.HttpClientService])
|
|
76
|
+
], NyTimesSource);
|
|
77
|
+
//# sourceMappingURL=nytimes.source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nytimes.source.js","sourceRoot":"","sources":["../../../src/host-lists/sources/nytimes.source.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6EAA+D;AAG/D,0DAA4D;AAE5D,iDAA4C;AAC5C,mDAA8C;AAE9C,MAAM,OAAO,GAA2B;IACtC,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE,KAAK;CACd,CAAC;AASK,IAAM,aAAa,GAAnB,MAAM,aAAa;IACxB,YAA6B,WAA8B;QAA9B,gBAAW,GAAX,WAAW,CAAmB;IAAG,CAAC;IAE/D,KAAK,CAAC,OAAO,CACX,OAAuB,EACvB,OAAiB;QAEjB,MAAM,IAAI,GAAG,OAAO,EAAE,IAAI,IAAI,OAAO,CAAC;QACtC,MAAM,GAAG,GACP,IAAI,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AAI,EAAE,SAAS;QACf,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,IAAI;QACV,IAAI,EAAE,0BAA0B;KACjC,CAAC;qCAE0C,gCAAiB;GADhD,aAAa,CA+CzB"}
|
|
@@ -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 ProductHuntSource implements HotListSource {
|
|
6
|
+
private readonly httpService;
|
|
7
|
+
constructor(httpService: HttpClientService);
|
|
8
|
+
getList(_options: GetListOptions, noCache?: boolean): Promise<HotListGetListResponse>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ProductHuntSource = 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 cheerio_1 = require("cheerio");
|
|
17
|
+
let ProductHuntSource = class ProductHuntSource {
|
|
18
|
+
constructor(httpService) {
|
|
19
|
+
this.httpService = httpService;
|
|
20
|
+
}
|
|
21
|
+
async getList(_options, noCache) {
|
|
22
|
+
const baseUrl = 'https://www.producthunt.com';
|
|
23
|
+
const result = await this.httpService.get({
|
|
24
|
+
url: baseUrl,
|
|
25
|
+
noCache,
|
|
26
|
+
headers: {
|
|
27
|
+
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36',
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
try {
|
|
31
|
+
const $ = (0, cheerio_1.load)(result.data);
|
|
32
|
+
const stories = [];
|
|
33
|
+
$('[data-test=homepage-section-0] [data-test^=post-item]').each((_, el) => {
|
|
34
|
+
const a = $(el).find('a').first();
|
|
35
|
+
const path = a.attr('href');
|
|
36
|
+
const title = $(el).find('a[data-test^=post-name]').text().trim();
|
|
37
|
+
const id = $(el).attr('data-test')?.replace('post-item-', '');
|
|
38
|
+
const vote = $(el).find('[data-test=vote-button]').text().trim();
|
|
39
|
+
if (path && id && title) {
|
|
40
|
+
stories.push({
|
|
41
|
+
id,
|
|
42
|
+
title,
|
|
43
|
+
hot: parseInt(vote) || undefined,
|
|
44
|
+
timestamp: undefined,
|
|
45
|
+
url: `${baseUrl}${path}`,
|
|
46
|
+
mobileUrl: `${baseUrl}${path}`,
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
return {
|
|
51
|
+
data: stories,
|
|
52
|
+
type: 'Today',
|
|
53
|
+
description: 'The best new products, every day',
|
|
54
|
+
fromCache: result.fromCache,
|
|
55
|
+
updateTime: result.updateTime,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
throw new Error(`Failed to parse Product Hunt HTML: ${error}`);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
exports.ProductHuntSource = ProductHuntSource;
|
|
64
|
+
exports.ProductHuntSource = ProductHuntSource = __decorate([
|
|
65
|
+
(0, common_1.Injectable)(),
|
|
66
|
+
(0, hot_source_decorator_1.HotSource)({
|
|
67
|
+
name: 'producthunt',
|
|
68
|
+
title: 'Product Hunt',
|
|
69
|
+
type: 'Today',
|
|
70
|
+
description: 'The best new products, every day',
|
|
71
|
+
link: 'https://www.producthunt.com/',
|
|
72
|
+
}),
|
|
73
|
+
__metadata("design:paramtypes", [http_service_1.HttpClientService])
|
|
74
|
+
], ProductHuntSource);
|
|
75
|
+
//# sourceMappingURL=producthunt.source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"producthunt.source.js","sourceRoot":"","sources":["../../../src/host-lists/sources/producthunt.source.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6EAA+D;AAG/D,0DAA4D;AAE5D,qCAA+B;AAUxB,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAC5B,YAA6B,WAA8B;QAA9B,gBAAW,GAAX,WAAW,CAAmB;IAAG,CAAC;IAE/D,KAAK,CAAC,OAAO,CACX,QAAwB,EACxB,OAAiB;QAEjB,MAAM,OAAO,GAAG,6BAA6B,CAAC;QAC9C,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,GAAG,CAAS;YAChD,GAAG,EAAE,OAAO;YACZ,OAAO;YACP,OAAO,EAAE;gBACP,YAAY,EACV,qHAAqH;aACxH;SACF,CAAC,CAAC;QAEH,IAAI,CAAC;YACH,MAAM,CAAC,GAAG,IAAA,cAAI,EAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YAC5B,MAAM,OAAO,GAAgC,EAAE,CAAC;YAEhD,CAAC,CAAC,uDAAuD,CAAC,CAAC,IAAI,CAC7D,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE;gBACR,MAAM,CAAC,GAAG,CAAC,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E;IACZ,IAAA,gCAAS,EAAC;QACT,IAAI,EAAE,aAAa;QACnB,KAAK,EAAE,cAAc;QACrB,IAAI,EAAE,OAAO;QACb,WAAW,EAAE,kCAAkC;QAC/C,IAAI,EAAE,8BAA8B;KACrC,CAAC;qCAE0C,gCAAiB;GADhD,iBAAiB,CAqD7B"}
|
|
@@ -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 QQNewsSource implements HotListSource {
|
|
6
|
+
private readonly httpService;
|
|
7
|
+
constructor(httpService: HttpClientService);
|
|
8
|
+
getList(_options: GetListOptions, noCache?: boolean): Promise<HotListGetListResponse>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
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.QQNewsSource = 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 QQNewsSource = class QQNewsSource {
|
|
18
|
+
constructor(httpService) {
|
|
19
|
+
this.httpService = httpService;
|
|
20
|
+
}
|
|
21
|
+
async getList(_options, noCache) {
|
|
22
|
+
const url = 'https://r.inews.qq.com/gw/event/hot_ranking_list?page_size=50';
|
|
23
|
+
const result = await this.httpService.get({ url, noCache });
|
|
24
|
+
const list = result.data.idlist[0].newslist.slice(1);
|
|
25
|
+
return {
|
|
26
|
+
data: list.map((v) => ({
|
|
27
|
+
id: v.id,
|
|
28
|
+
title: v.title,
|
|
29
|
+
desc: v.abstract,
|
|
30
|
+
cover: v.miniProShareImage,
|
|
31
|
+
author: v.source,
|
|
32
|
+
hot: v.hotEvent.hotScore,
|
|
33
|
+
timestamp: (0, getTime_1.getTime)(v.timestamp),
|
|
34
|
+
url: `https://new.qq.com/rain/a/${v.id}`,
|
|
35
|
+
mobileUrl: `https://view.inews.qq.com/k/${v.id}`,
|
|
36
|
+
})),
|
|
37
|
+
fromCache: result.fromCache,
|
|
38
|
+
updateTime: result.updateTime,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
exports.QQNewsSource = QQNewsSource;
|
|
43
|
+
exports.QQNewsSource = QQNewsSource = __decorate([
|
|
44
|
+
(0, common_1.Injectable)(),
|
|
45
|
+
(0, hot_source_decorator_1.HotSource)({
|
|
46
|
+
name: 'qq-news',
|
|
47
|
+
title: '腾讯新闻',
|
|
48
|
+
type: '热点榜',
|
|
49
|
+
link: 'https://news.qq.com/',
|
|
50
|
+
}),
|
|
51
|
+
__metadata("design:paramtypes", [http_service_1.HttpClientService])
|
|
52
|
+
], QQNewsSource);
|
|
53
|
+
//# sourceMappingURL=qq-news.source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qq-news.source.js","sourceRoot":"","sources":["../../../src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AAS,EAAC;QACT,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,KAAK;QACX,IAAI,EAAE,sBAAsB;KAC7B,CAAC;qCAE0C,gCAAiB;GADhD,YAAY,CA0BxB"}
|
|
@@ -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 SinaNewsSource implements HotListSource {
|
|
6
|
+
private readonly httpService;
|
|
7
|
+
constructor(httpService: HttpClientService);
|
|
8
|
+
getList(options: GetListOptions, noCache?: boolean): Promise<HotListGetListResponse>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.SinaNewsSource = 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 listType = {
|
|
18
|
+
'1': { name: '总排行', www: 'news', params: 'www_www_all_suda_suda' },
|
|
19
|
+
'2': { name: '视频排行', www: 'news', params: 'video_news_all_by_vv' },
|
|
20
|
+
'3': { name: '图片排行', www: 'news', params: 'total_slide_suda' },
|
|
21
|
+
'4': { name: '国内新闻', www: 'news', params: 'news_china_suda' },
|
|
22
|
+
'5': { name: '国际新闻', www: 'news', params: 'news_world_suda' },
|
|
23
|
+
'6': { name: '社会新闻', www: 'news', params: 'news_society_suda' },
|
|
24
|
+
'7': { name: '体育新闻', www: 'sports', params: 'sports_suda' },
|
|
25
|
+
'8': { name: '财经新闻', www: 'finance', params: 'finance_0_suda' },
|
|
26
|
+
'9': { name: '娱乐新闻', www: 'ent', params: 'ent_suda' },
|
|
27
|
+
'10': { name: '科技新闻', www: 'tech', params: 'tech_news_suda' },
|
|
28
|
+
'11': { name: '军事新闻', www: 'news', params: 'news_mil_suda' },
|
|
29
|
+
};
|
|
30
|
+
function parseData(data) {
|
|
31
|
+
const prefix = 'var data = ';
|
|
32
|
+
if (!data.startsWith(prefix))
|
|
33
|
+
throw new Error('Input data does not start with the expected prefix');
|
|
34
|
+
let jsonString = data.slice(prefix.length).trim();
|
|
35
|
+
if (jsonString.endsWith(';')) {
|
|
36
|
+
jsonString = jsonString.slice(0, -1).trim();
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
throw new Error('Input data does not end with a semicolon');
|
|
40
|
+
}
|
|
41
|
+
if (jsonString.startsWith('{') && jsonString.endsWith('}')) {
|
|
42
|
+
try {
|
|
43
|
+
return JSON.parse(jsonString);
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
throw new Error('Failed to parse JSON: ' + error);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
throw new Error('Invalid JSON format');
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
let SinaNewsSource = class SinaNewsSource {
|
|
54
|
+
constructor(httpService) {
|
|
55
|
+
this.httpService = httpService;
|
|
56
|
+
}
|
|
57
|
+
async getList(options, noCache) {
|
|
58
|
+
const type = options?.type || '1';
|
|
59
|
+
const { params, www } = listType[type];
|
|
60
|
+
const { year, month, day } = (0, getTime_1.getCurrentDateTime)(true);
|
|
61
|
+
const url = `https://top.${www}.sina.com.cn/ws/GetTopDataList.php?top_type=day&top_cat=${params}&top_time=${year + month + day}&top_show_num=50`;
|
|
62
|
+
const result = await this.httpService.get({ url, noCache });
|
|
63
|
+
const list = parseData(result.data).data;
|
|
64
|
+
const typeMap = Object.fromEntries(Object.entries(listType).map(([key, value]) => [key, value.name]));
|
|
65
|
+
return {
|
|
66
|
+
data: list.map((v) => ({
|
|
67
|
+
id: v.id,
|
|
68
|
+
title: v.title,
|
|
69
|
+
author: v.media || undefined,
|
|
70
|
+
hot: parseFloat(v.top_num.replace(/,/g, '')),
|
|
71
|
+
timestamp: (0, getTime_1.getTime)(v.create_date + ' ' + v.create_time),
|
|
72
|
+
url: v.url,
|
|
73
|
+
mobileUrl: v.url,
|
|
74
|
+
})),
|
|
75
|
+
type: listType[type].name,
|
|
76
|
+
params: {
|
|
77
|
+
type: {
|
|
78
|
+
name: '榜单分类',
|
|
79
|
+
type: typeMap,
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
fromCache: result.fromCache,
|
|
83
|
+
updateTime: result.updateTime,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
exports.SinaNewsSource = SinaNewsSource;
|
|
88
|
+
exports.SinaNewsSource = SinaNewsSource = __decorate([
|
|
89
|
+
(0, common_1.Injectable)(),
|
|
90
|
+
(0, hot_source_decorator_1.HotSource)({
|
|
91
|
+
name: 'sina-news',
|
|
92
|
+
title: '新浪新闻',
|
|
93
|
+
type: '榜单',
|
|
94
|
+
link: 'https://sinanews.sina.cn/',
|
|
95
|
+
}),
|
|
96
|
+
__metadata("design:paramtypes", [http_service_1.HttpClientService])
|
|
97
|
+
], SinaNewsSource);
|
|
98
|
+
//# sourceMappingURL=sina-news.source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sina-news.source.js","sourceRoot":"","sources":["../../../src/host-lists/sources/sina-news.source.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6EAA+D;AAG/D,0DAA4D;AAE5D,iDAAgE;AAEhE,MAAM,QAAQ,GAAG;IACf,GAAG,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,uBAAuB,EAAE;IAClE,GAAG,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,sBAAsB,EAAE;IAClE,GAAG,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,EAAE;IAC9D,GAAG,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,EAAE;IAC7D,GAAG,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,EAAE;IAC7D,GAAG,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,mBAAmB,EAAE;IAC/D,GAAG,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAE;IAC3D,GAAG,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,gBAAgB,EAAE;IAC/D,GAAG,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE;IACrD,IAAI,EAAE,EAAE,IAAI,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aACjB,CAAC,CAAC;YACH,IAAI,EAAE,QAAQ,CAAC,IAA6B,CAAC,CAAC,IAAI;YAClD,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;AArCY,wCAAc;yBAAd,cAAc;IAP1B,IAAA,mBAAU,GAAE;IACZ,IAAA,gCAAS,EAAC;QACT,IAAI,EAAE,WAAW;QACjB,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,IAAI;QACV,IAAI,EAAE,2BAA2B;KAClC,CAAC;qCAE0C,gCAAiB;GADhD,cAAc,CAqC1B"}
|
|
@@ -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 SinaSource implements HotListSource {
|
|
6
|
+
private readonly httpService;
|
|
7
|
+
constructor(httpService: HttpClientService);
|
|
8
|
+
getList(options: GetListOptions, noCache?: boolean): Promise<HotListGetListResponse>;
|
|
9
|
+
}
|