rsshub 1.0.0-master.f7add90 → 1.0.0-master.f7bfacc
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/README.md +0 -8
- package/lib/app.js +2 -0
- package/lib/config.js +17 -1
- package/lib/middleware/cache/memory.js +2 -2
- package/lib/middleware/template.js +14 -1
- package/lib/radar-rules.js +0 -76
- package/lib/radar.js +22 -3
- package/lib/router.js +27 -30
- package/lib/routes/axis-studios/work.js +0 -0
- package/lib/routes/blow-studio/work.js +0 -0
- package/lib/routes/blur-studio/index.js +0 -0
- package/lib/routes/digic-pictures/index.js +0 -0
- package/lib/routes/gov/hunan/notice.js +1 -1
- package/lib/routes/method-studios/index.js +0 -0
- package/lib/routes/ps/product.js +0 -0
- package/lib/routes/unit-image/films.js +0 -0
- package/lib/static/logo.png +0 -0
- package/lib/utils/puppeteer.js +2 -2
- package/lib/utils/request-wrapper.js +2 -2
- package/lib/v2/141jav/index.js +71 -0
- package/lib/v2/141jav/maintainer.js +3 -0
- package/lib/v2/141jav/radar.js +40 -0
- package/lib/v2/141jav/router.js +3 -0
- package/lib/v2/141jav/templates/description.art +47 -0
- package/lib/v2/141ppv/index.js +71 -0
- package/lib/v2/141ppv/maintainer.js +3 -0
- package/lib/v2/141ppv/radar.js +40 -0
- package/lib/v2/141ppv/router.js +3 -0
- package/lib/v2/141ppv/templates/description.art +47 -0
- package/lib/v2/3dmgame/game.js +39 -0
- package/lib/v2/3dmgame/maintainer.js +4 -0
- package/lib/v2/3dmgame/news_center.js +42 -0
- package/lib/v2/3dmgame/radar.js +19 -0
- package/lib/v2/3dmgame/router.js +4 -0
- package/lib/v2/3dmgame/utils.js +30 -0
- package/lib/v2/4ksj/forum.js +128 -0
- package/lib/v2/4ksj/maintainer.js +3 -0
- package/lib/v2/4ksj/radar.js +13 -0
- package/lib/v2/4ksj/router.js +3 -0
- package/lib/v2/4ksj/templates/description.art +56 -0
- package/lib/v2/5eplay/index.js +100 -0
- package/lib/v2/5eplay/maintainer.js +3 -0
- package/lib/v2/5eplay/radar.js +13 -0
- package/lib/v2/5eplay/router.js +3 -0
- package/lib/v2/5eplay/utils.js +35 -0
- package/lib/v2/aeon/category.js +27 -0
- package/lib/v2/aeon/maintainer.js +4 -0
- package/lib/v2/aeon/radar.js +19 -0
- package/lib/v2/aeon/router.js +4 -0
- package/lib/v2/aeon/templates/essay.art +3 -0
- package/lib/v2/aeon/templates/video.art +10 -0
- package/lib/v2/aeon/type.js +29 -0
- package/lib/v2/aeon/utils.js +50 -0
- package/lib/v2/aisixiang/column.js +36 -0
- package/lib/v2/aisixiang/maintainer.js +6 -0
- package/lib/v2/aisixiang/radar.js +29 -0
- package/lib/v2/aisixiang/router.js +6 -0
- package/lib/v2/aisixiang/thinktank.js +49 -0
- package/lib/v2/aisixiang/toplist.js +37 -0
- package/lib/v2/aisixiang/utils.js +37 -0
- package/lib/v2/aliresearch/information.js +57 -0
- package/lib/v2/aliresearch/maintainer.js +3 -0
- package/lib/v2/aliresearch/radar.js +13 -0
- package/lib/v2/aliresearch/router.js +3 -0
- package/lib/v2/amazon/kindle-software-updates.js +1 -0
- package/lib/v2/atcoder/radar.js +1 -1
- package/lib/v2/bad/index.js +58 -0
- package/lib/v2/bad/maintainer.js +3 -0
- package/lib/v2/bad/radar.js +13 -0
- package/lib/v2/bad/router.js +3 -0
- package/lib/v2/baozimh/index.js +1 -1
- package/lib/v2/bilibili/cache.js +17 -5
- package/lib/v2/bilibili/hotSearch.js +5 -1
- package/lib/v2/bilibili/userChannel.js +2 -1
- package/lib/v2/bilibili/userCollection.js +3 -1
- package/lib/v2/bilibili/utils.js +3 -3
- package/lib/v2/bilibili/video-all.js +7 -2
- package/lib/v2/bilibili/video.js +1 -1
- package/lib/v2/bilibili/vsearch.js +1 -1
- package/lib/v2/bjsk/keti.js +54 -0
- package/lib/v2/bjsk/maintainer.js +1 -0
- package/lib/v2/bjsk/radar.js +8 -0
- package/lib/v2/bjsk/router.js +1 -0
- package/lib/v2/bmkg/earthquake.js +29 -0
- package/lib/v2/bmkg/maintainer.js +4 -0
- package/lib/v2/bmkg/news.js +42 -0
- package/lib/v2/bmkg/radar.js +19 -0
- package/lib/v2/bmkg/router.js +4 -0
- package/lib/v2/chinathinktanks/radar.js +1 -1
- package/lib/v2/cls/depth.js +34 -32
- package/lib/v2/cls/hot.js +38 -29
- package/lib/v2/cls/maintainer.js +1 -1
- package/lib/v2/cls/radar.js +1 -1
- package/lib/v2/cls/telegraph.js +25 -23
- package/lib/v2/cls/templates/depth.art +3 -3
- package/lib/v2/cls/templates/telegraph.art +5 -5
- package/lib/v2/cls/utils.js +12 -6
- package/lib/v2/cneb/maintainer.js +4 -0
- package/lib/v2/cneb/radar.js +19 -0
- package/lib/v2/cneb/router.js +5 -0
- package/lib/v2/cneb/yjxw.js +72 -0
- package/lib/v2/cneb/yjxx.js +50 -0
- package/lib/v2/cnki/author.js +38 -26
- package/lib/v2/cnki/maintainer.js +1 -1
- package/lib/v2/comicat/maintainer.js +3 -0
- package/lib/v2/comicat/radar.js +11 -0
- package/lib/v2/comicat/router.js +3 -0
- package/lib/v2/comicat/search.js +42 -0
- package/lib/v2/coomer/utils.js +3 -1
- package/lib/v2/cqgas/maintainer.js +3 -0
- package/lib/v2/cqgas/radar.js +13 -0
- package/lib/v2/cqgas/router.js +3 -0
- package/lib/v2/cqgas/tqtz.js +36 -0
- package/lib/v2/cssn/iolaw.js +38 -0
- package/lib/v2/cssn/maintainer.js +3 -0
- package/lib/v2/cssn/radar.js +11 -0
- package/lib/v2/cssn/router.js +3 -0
- package/lib/v2/daily/discussed.js +73 -0
- package/lib/v2/daily/index.js +83 -0
- package/lib/v2/daily/maintainer.js +5 -0
- package/lib/v2/daily/radar.js +25 -0
- package/lib/v2/daily/router.js +5 -0
- package/lib/v2/daily/upvoted.js +77 -0
- package/lib/v2/daily/utils.js +39 -0
- package/lib/v2/dblp/maintainer.js +3 -0
- package/lib/v2/dblp/publication.js +70 -0
- package/lib/v2/dblp/radar.js +13 -0
- package/lib/v2/dblp/router.js +3 -0
- package/lib/v2/deadline/maintainer.js +4 -0
- package/lib/v2/deadline/posts.js +53 -0
- package/lib/v2/deadline/radar.js +13 -0
- package/lib/v2/deadline/router.js +3 -0
- package/lib/v2/deadline/templates/desc.art +10 -0
- package/lib/v2/devolverdigital/blog.js +50 -0
- package/lib/v2/devolverdigital/maintainer.js +3 -0
- package/lib/v2/devolverdigital/radar.js +13 -0
- package/lib/v2/devolverdigital/router.js +3 -0
- package/lib/v2/dhu/maintainer.js +1 -0
- package/lib/v2/dhu/radar.js +6 -0
- package/lib/v2/dhu/router.js +1 -0
- package/lib/v2/dhu/yjs/zs.js +46 -0
- package/lib/v2/discord/channel.js +8 -8
- package/lib/v2/discord/maintainer.js +1 -1
- package/lib/v2/discord/radar.js +2 -2
- package/lib/v2/discord/router.js +1 -1
- package/lib/v2/domp4/detail.js +26 -0
- package/lib/v2/dorohedoro/maintainer.js +3 -0
- package/lib/v2/dorohedoro/news.js +69 -0
- package/lib/v2/dorohedoro/radar.js +13 -0
- package/lib/v2/dorohedoro/router.js +3 -0
- package/lib/v2/duozhuayu/maintainer.js +3 -0
- package/lib/v2/duozhuayu/radar.js +13 -0
- package/lib/v2/duozhuayu/router.js +3 -0
- package/lib/{routes → v2}/duozhuayu/search.js +23 -32
- package/lib/v2/duozhuayu/templates/book.art +10 -0
- package/lib/v2/dxy/maintainer.js +4 -0
- package/lib/v2/dxy/profile/thread.js +82 -0
- package/lib/v2/dxy/radar.js +21 -0
- package/lib/v2/dxy/router.js +4 -0
- package/lib/v2/dxy/special.js +79 -0
- package/lib/v2/dxy/utils.js +72 -0
- package/lib/v2/eastmoney/maintainer.js +1 -0
- package/lib/v2/eastmoney/radar.js +8 -0
- package/lib/v2/eastmoney/report/index.js +41 -0
- package/lib/v2/eastmoney/router.js +2 -1
- package/lib/v2/embassy/radar.js +1 -1
- package/lib/v2/embassy/supportedList.js +4 -4
- package/lib/v2/firecore/index.js +37 -0
- package/lib/v2/firecore/maintainer.js +3 -0
- package/lib/v2/firecore/radar.js +13 -0
- package/lib/v2/firecore/router.js +3 -0
- package/lib/v2/flyert/creditcard.js +3 -0
- package/lib/v2/flyert/utils.js +14 -8
- package/lib/v2/followin/index.js +35 -0
- package/lib/v2/followin/kol.js +25 -0
- package/lib/v2/followin/maintainer.js +7 -0
- package/lib/v2/followin/news.js +21 -0
- package/lib/v2/followin/radar.js +37 -0
- package/lib/v2/followin/router.js +7 -0
- package/lib/v2/followin/tag.js +44 -0
- package/lib/v2/followin/templates/thread.art +15 -0
- package/lib/v2/followin/topic.js +25 -0
- package/lib/v2/followin/utils.js +84 -0
- package/lib/v2/freebuf/index.js +41 -0
- package/lib/v2/freebuf/maintainer.js +3 -0
- package/lib/v2/freebuf/radar.js +13 -0
- package/lib/v2/freebuf/router.js +3 -0
- package/lib/v2/freecomputerbooks/index.js +41 -13
- package/lib/v2/freecomputerbooks/templates/desc.art +3 -0
- package/lib/v2/futunn/main.js +67 -0
- package/lib/v2/futunn/maintainer.js +3 -0
- package/lib/v2/futunn/radar.js +13 -0
- package/lib/v2/futunn/router.js +5 -0
- package/lib/v2/futunn/templates/description.art +6 -0
- package/lib/v2/fzmtr/announcements.js +38 -0
- package/lib/v2/fzmtr/maintainer.js +3 -0
- package/lib/v2/fzmtr/radar.js +11 -0
- package/lib/v2/fzmtr/router.js +3 -0
- package/lib/v2/github/gist.js +35 -0
- package/lib/v2/github/maintainer.js +1 -0
- package/lib/v2/github/radar.js +8 -0
- package/lib/v2/github/router.js +1 -0
- package/lib/v2/gov/cac/index.js +64 -0
- package/lib/v2/gov/ccdi/index.js +1 -1
- package/lib/v2/gov/ccdi/utils.js +1 -1
- package/lib/v2/gov/chongqing/rsks.js +38 -0
- package/lib/v2/gov/maintainer.js +2 -0
- package/lib/v2/gov/news/index.js +10 -5
- package/lib/v2/gov/radar.js +23 -1
- package/lib/v2/gov/router.js +2 -0
- package/lib/v2/gq/tw/index.js +1 -1
- package/lib/v2/guangzhoumetro/maintainer.js +3 -0
- package/lib/v2/guangzhoumetro/news.js +37 -0
- package/lib/v2/guangzhoumetro/radar.js +11 -0
- package/lib/v2/guangzhoumetro/router.js +3 -0
- package/lib/v2/hnu/careers.js +33 -0
- package/lib/v2/hnu/maintainer.js +3 -0
- package/lib/v2/hnu/radar.js +12 -0
- package/lib/v2/hnu/router.js +3 -0
- package/lib/v2/hust/aia/news.js +0 -0
- package/lib/v2/hust/aia/notice.js +0 -0
- package/lib/v2/i-cable/category.js +74 -0
- package/lib/v2/i-cable/maintainer.js +3 -0
- package/lib/v2/i-cable/radar.js +13 -0
- package/lib/v2/i-cable/router.js +3 -0
- package/lib/v2/i-cable/templates/desc.art +8 -0
- package/lib/v2/ibc/maintainer.js +4 -0
- package/lib/{routes/maitta/index.js → v2/ibc/maitta.js} +11 -8
- package/lib/v2/ibc/radar.js +19 -0
- package/lib/v2/ibc/radio.js +73 -0
- package/lib/v2/ibc/router.js +4 -0
- package/lib/v2/ibc/templates/description.art +6 -0
- package/lib/v2/instructables/projects.js +1 -1
- package/lib/v2/ithome/radar.js +3 -3
- package/lib/v2/iwara/index.js +36 -24
- package/lib/v2/iwara/radar.js +1 -1
- package/lib/v2/iwara/subscriptions.js +131 -32
- package/lib/v2/iwara/templates/subscriptions.art +1 -1
- package/lib/v2/line/publisher.js +1 -1
- package/lib/v2/mdpi/maintainer.js +0 -0
- package/lib/v2/mdpi/radar.js +0 -0
- package/lib/v2/mdpi/router.js +0 -0
- package/lib/v2/mdpi/templates/description.art +0 -0
- package/lib/v2/medium/following.js +31 -0
- package/lib/v2/medium/for-you.js +31 -0
- package/lib/v2/medium/graphql.js +190 -0
- package/lib/v2/medium/list.js +32 -0
- package/lib/v2/medium/maintainer.js +6 -0
- package/lib/v2/medium/parse-article.js +60 -0
- package/lib/v2/medium/radar.js +23 -0
- package/lib/v2/medium/router.js +6 -0
- package/lib/v2/medium/tag.js +32 -0
- package/lib/v2/mihoyo/maintainer.js +1 -0
- package/lib/v2/mihoyo/radar.js +16 -0
- package/lib/v2/mihoyo/router.js +1 -0
- package/lib/v2/mihoyo/sr/news.js +71 -0
- package/lib/v2/mihoyo/templates/ys.art +4 -0
- package/lib/v2/mihoyo/ys/news.js +132 -52
- package/lib/v2/nationalgeographic/latest-stories.js +56 -0
- package/lib/v2/nationalgeographic/maintainer.js +3 -0
- package/lib/v2/nationalgeographic/radar.js +13 -0
- package/lib/v2/nationalgeographic/router.js +3 -0
- package/lib/v2/nationalgeographic/templates/stories.art +44 -0
- package/lib/v2/nenu/maintainer.js +4 -0
- package/lib/v2/nenu/radar.js +21 -0
- package/lib/v2/nenu/router.js +4 -0
- package/lib/v2/nenu/sohac.js +60 -0
- package/lib/v2/nenu/yjsy.js +64 -0
- package/lib/v2/newzmz/index.js +55 -44
- package/lib/v2/newzmz/maintainer.js +1 -1
- package/lib/v2/newzmz/radar.js +1 -1
- package/lib/v2/newzmz/router.js +2 -1
- package/lib/v2/newzmz/templates/description.art +7 -0
- package/lib/v2/newzmz/view.js +32 -17
- package/lib/v2/nhentai/util.js +2 -1
- package/lib/v2/nikkei/cn/index.js +2 -2
- package/lib/v2/nju/zcc.js +7 -13
- package/lib/v2/notateslaapp/maintainer.js +3 -0
- package/lib/v2/notateslaapp/radar.js +13 -0
- package/lib/v2/notateslaapp/router.js +3 -0
- package/lib/{routes/tesla → v2/notateslaapp}/update.js +6 -12
- package/lib/v2/notefolio/maintainer.js +3 -0
- package/lib/v2/notefolio/radar.js +13 -0
- package/lib/v2/notefolio/router.js +3 -0
- package/lib/v2/notefolio/search.js +145 -0
- package/lib/v2/notefolio/templates/search.art +9 -0
- package/lib/v2/notion/database.js +161 -0
- package/lib/v2/notion/maintainer.js +3 -0
- package/lib/v2/notion/radar.js +13 -0
- package/lib/v2/notion/router.js +3 -0
- package/lib/v2/nytimes/author.js +1 -1
- package/lib/v2/oeeee/app/channel.js +36 -0
- package/lib/v2/oeeee/app/reporter.js +30 -0
- package/lib/v2/oeeee/maintainer.js +5 -0
- package/lib/v2/oeeee/radar.js +12 -0
- package/lib/v2/oeeee/router.js +5 -0
- package/lib/v2/oeeee/templates/description.art +7 -0
- package/lib/v2/oeeee/utils.js +41 -0
- package/lib/v2/oeeee/web.js +36 -0
- package/lib/v2/openai/blog.js +3 -56
- package/lib/v2/openai/common.js +72 -0
- package/lib/v2/openai/maintainer.js +1 -0
- package/lib/v2/openai/radar.js +8 -0
- package/lib/v2/openai/research.js +32 -0
- package/lib/v2/openai/router.js +1 -0
- package/lib/v2/pumc/maintainer.js +3 -0
- package/lib/v2/pumc/mdadmission.js +62 -0
- package/lib/v2/pumc/radar.js +13 -0
- package/lib/v2/pumc/router.js +3 -0
- package/lib/v2/rattibha/maintainer.js +3 -0
- package/lib/v2/rattibha/radar.js +13 -0
- package/lib/v2/rattibha/router.js +3 -0
- package/lib/v2/rattibha/user.js +45 -0
- package/lib/v2/readhub/index.js +1 -1
- package/lib/{routes → v2}/right/forum.js +21 -23
- package/lib/v2/right/maintainer.js +3 -0
- package/lib/v2/right/radar.js +13 -0
- package/lib/v2/right/router.js +3 -0
- package/lib/v2/rsshub/radar.js +2 -2
- package/lib/v2/sdust/maintainer.js +3 -0
- package/lib/v2/sdust/radar.js +13 -0
- package/lib/v2/sdust/router.js +3 -0
- package/lib/v2/sdust/yjsy/zhaosheng.js +52 -0
- package/lib/v2/sehuatang/maintainer.js +1 -0
- package/lib/v2/sehuatang/router.js +1 -0
- package/lib/v2/sehuatang/user.js +113 -0
- package/lib/v2/shiep/config.js +64 -0
- package/lib/v2/shiep/index.js +13 -34
- package/lib/v2/shiep/radar.js +303 -15
- package/lib/v2/shuiguopai/index.js +1 -1
- package/lib/v2/sina/chuangshiji.js +17 -0
- package/lib/v2/sina/discovery.js +32 -0
- package/lib/v2/sina/finance/china.js +25 -0
- package/lib/v2/sina/finance/stock/usstock.js +37 -0
- package/lib/v2/sina/maintainer.js +8 -0
- package/lib/v2/sina/radar.js +49 -0
- package/lib/v2/sina/rollnews.js +31 -0
- package/lib/v2/sina/router.js +8 -0
- package/lib/v2/sina/sports.js +43 -0
- package/lib/v2/sina/templates/slide.art +3 -0
- package/lib/v2/sina/templates/video.art +5 -0
- package/lib/v2/sina/utils.js +104 -0
- package/lib/v2/sony/downloads.js +1 -0
- package/lib/v2/springer/maintainer.js +0 -0
- package/lib/v2/springer/radar.js +0 -0
- package/lib/v2/springer/router.js +0 -0
- package/lib/v2/springer/templates/description.art +0 -0
- package/lib/v2/sspai/radar.js +1 -1
- package/lib/v2/stbu/jsjxy.js +51 -0
- package/lib/v2/stbu/maintainer.js +4 -0
- package/lib/v2/stbu/radar.js +21 -0
- package/lib/v2/stbu/router.js +4 -0
- package/lib/v2/stbu/xyxw.js +52 -0
- package/lib/v2/storyfm/episodes.js +63 -0
- package/lib/v2/storyfm/maintainer.js +4 -0
- package/lib/v2/storyfm/radar.js +19 -0
- package/lib/v2/storyfm/router.js +4 -0
- package/lib/v2/storyfm/templates/description.art +6 -0
- package/lib/v2/sysu/maintainer.js +1 -0
- package/lib/v2/sysu/radar.js +8 -0
- package/lib/v2/sysu/router.js +1 -0
- package/lib/v2/sysu/ygafz.js +69 -0
- package/lib/v2/techpowerup/index.js +69 -0
- package/lib/v2/techpowerup/maintainer.js +5 -0
- package/lib/v2/techpowerup/radar.js +19 -0
- package/lib/v2/techpowerup/review.js +69 -0
- package/lib/v2/techpowerup/router.js +4 -0
- package/lib/v2/techpowerup/utils.js +84 -0
- package/lib/v2/telecompaper/maintainer.js +4 -0
- package/lib/{routes → v2}/telecompaper/news.js +1 -0
- package/lib/v2/telecompaper/radar.js +15 -0
- package/lib/v2/telecompaper/router.js +4 -0
- package/lib/v2/tencent/news/author.js +12 -8
- package/lib/v2/tiktok/user.js +5 -5
- package/lib/v2/tingshuitz/maintainer.js +1 -0
- package/lib/v2/tingshuitz/radar.js +11 -0
- package/lib/v2/tingshuitz/router.js +1 -0
- package/lib/v2/tingshuitz/shenzhen.js +29 -0
- package/lib/v2/tingshuitz/templates/shenzhen.art +8 -0
- package/lib/v2/tingtingfm/maintainer.js +3 -0
- package/lib/v2/tingtingfm/program.js +104 -0
- package/lib/v2/tingtingfm/radar.js +13 -0
- package/lib/v2/tingtingfm/router.js +3 -0
- package/lib/v2/tingtingfm/templates/audio.art +5 -0
- package/lib/v2/tingtingfm/utils.js +32 -0
- package/lib/v2/twitter/maintainer.js +1 -0
- package/lib/v2/twitter/radar.js +10 -0
- package/lib/v2/twitter/router.js +1 -0
- package/lib/v2/twitter/tweet.js +5 -0
- package/lib/v2/twitter/web-api/tweet.js +25 -0
- package/lib/v2/twitter/web-api/twitter-api.js +41 -2
- package/lib/v2/ustb/maintainer.js +2 -22
- package/lib/v2/ustb/radar.js +8 -0
- package/lib/v2/ustb/router.js +1 -0
- package/lib/{routes/universities → v2}/ustb/tj/news.js +11 -12
- package/lib/v2/utgd/category.js +68 -0
- package/lib/v2/utgd/maintainer.js +5 -0
- package/lib/v2/utgd/radar.js +25 -0
- package/lib/v2/utgd/router.js +5 -0
- package/lib/v2/utgd/templates/description.art +7 -0
- package/lib/v2/utgd/timeline.js +54 -0
- package/lib/v2/utgd/topic.js +70 -0
- package/lib/v2/v1tx/index.js +41 -22
- package/lib/v2/wechat/feeddd.js +12 -3
- package/lib/v2/wechat/mp.js +0 -0
- package/lib/v2/wechat/radar.js +2 -2
- package/lib/v2/weibo/group.js +93 -0
- package/lib/v2/weibo/keyword.js +1 -10
- package/lib/v2/weibo/maintainer.js +4 -3
- package/lib/v2/weibo/router.js +1 -0
- package/lib/v2/weibo/super_index.js +1 -10
- package/lib/v2/weibo/timeline.js +5 -5
- package/lib/v2/weibo/user.js +2 -8
- package/lib/v2/weibo/utils.js +15 -3
- package/lib/v2/winstall/maintainer.js +3 -0
- package/lib/v2/winstall/radar.js +13 -0
- package/lib/v2/winstall/router.js +3 -0
- package/lib/v2/winstall/templates/desc.art +5 -0
- package/lib/v2/winstall/update.js +43 -0
- package/lib/v2/wnacg/index.js +1 -1
- package/lib/v2/wnacg/templates/manga.art +4 -4
- package/lib/v2/wtu/index.js +37 -0
- package/lib/v2/wtu/job.js +80 -0
- package/lib/v2/wtu/maintainer.js +4 -0
- package/lib/v2/wtu/radar.js +22 -0
- package/lib/v2/wtu/router.js +4 -0
- package/lib/v2/xiaohongshu/maintainer.js +1 -1
- package/lib/v2/xiaohongshu/notes.js +16 -0
- package/lib/v2/xiaohongshu/router.js +1 -0
- package/lib/v2/xiaohongshu/util.js +122 -0
- package/lib/v2/yomiuri/maintainer.js +1 -1
- package/lib/v2/yomiuri/news.js +50 -100
- package/lib/v2/yomiuri/radar.js +3 -3
- package/lib/v2/youtube/user.js +1 -1
- package/lib/v2/zcool/radar.js +6 -6
- package/lib/v2/zhihu/answers.js +13 -9
- package/lib/v2/zhihu/radar.js +2 -2
- package/lib/v2/zhubai/maintainer.js +1 -0
- package/lib/v2/zhubai/radar.js +7 -0
- package/lib/v2/zhubai/router.js +1 -0
- package/lib/v2/zhubai/templates/description.art +31 -0
- package/lib/v2/zhubai/top20.js +57 -0
- package/lib/v2/zju/radar.js +1 -1
- package/lib/v2/zyw/hot.js +63 -0
- package/lib/v2/zyw/maintainer.js +3 -0
- package/lib/v2/zyw/radar.js +16 -0
- package/lib/v2/zyw/router.js +3 -0
- package/lib/views/error.art +7 -3
- package/lib/views/rss.art +1 -1
- package/lib/views/welcome.art +2 -2
- package/package.json +115 -124
- package/lib/routes/141jav/141jav.js +0 -37
- package/lib/routes/141ppv/141ppv.js +0 -37
- package/lib/routes/3dm/game.js +0 -42
- package/lib/routes/3dm/news_center.js +0 -54
- package/lib/routes/aeon/category.js +0 -70
- package/lib/routes/aisixiang/column.js +0 -37
- package/lib/routes/aisixiang/ranking.js +0 -37
- package/lib/routes/aisixiang/thinktank.js +0 -40
- package/lib/routes/aisixiang/utils.js +0 -39
- package/lib/routes/cneb/guoneinews.js +0 -27
- package/lib/routes/cneb/yjxx.js +0 -36
- package/lib/routes/futunn/highlights.js +0 -58
- package/lib/routes/icable/category.js +0 -64
- package/lib/routes/notefolio/index.js +0 -67
- package/lib/routes/rss3/blog.js +0 -46
- package/lib/routes/sina/chuangshiji.js +0 -38
- package/lib/routes/sina/discovery.js +0 -52
- package/lib/routes/sina/finance.js +0 -37
- package/lib/routes/sina/rollnews.js +0 -41
- package/lib/routes/sina/sports.js +0 -54
- package/lib/routes/universities/wtu/index.js +0 -34
- /package/lib/{routes → v2}/storyfm/index.js +0 -0
- /package/lib/{routes → v2}/telecompaper/search.js +0 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
const timezone = require('@/utils/timezone');
|
|
4
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
5
|
+
const { art } = require('@/utils/render');
|
|
6
|
+
const path = require('path');
|
|
7
|
+
|
|
8
|
+
module.exports = async (ctx) => {
|
|
9
|
+
const id = ctx.params.id ?? 'maitta';
|
|
10
|
+
const limit = ctx.query.limit ? parseInt(ctx.query.limit) : 150;
|
|
11
|
+
|
|
12
|
+
const rootUrl = 'https://www.ibc.co.jp';
|
|
13
|
+
const currentUrl = `${rootUrl}/radio/${id}/audio/`;
|
|
14
|
+
|
|
15
|
+
let response = await got({
|
|
16
|
+
method: 'get',
|
|
17
|
+
url: currentUrl,
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
let $ = cheerio.load(response.data);
|
|
21
|
+
|
|
22
|
+
const image = $('meta[property="og:image"]').attr('content');
|
|
23
|
+
|
|
24
|
+
let radioId = $('link[title="RSS"]').attr('href')?.split('/rss/').pop().replace(/\/$/, '') ?? '';
|
|
25
|
+
|
|
26
|
+
let items = $('.audio_list section').toArray();
|
|
27
|
+
|
|
28
|
+
if (!radioId) {
|
|
29
|
+
const item = $(items[0]);
|
|
30
|
+
|
|
31
|
+
response = await got({
|
|
32
|
+
method: 'get',
|
|
33
|
+
url: new URL(item.find('a').attr('href'), rootUrl).href,
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
$ = cheerio.load(response.data);
|
|
37
|
+
|
|
38
|
+
radioId = $('audio')
|
|
39
|
+
.attr('src')
|
|
40
|
+
.match(/\/sound\/(\d+)_/)[1];
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
items = items.slice(0, limit).map((item) => {
|
|
44
|
+
item = $(item);
|
|
45
|
+
|
|
46
|
+
const link = new URL(item.find('a').attr('href'), rootUrl).href;
|
|
47
|
+
const audioId = link.match(/\/aitem\/(\d+)/)[1];
|
|
48
|
+
const audio = `https://media-data.cdn.ibc.co.jp/out/sound/${radioId}_${audioId}/${radioId}_${audioId}.mp3`;
|
|
49
|
+
|
|
50
|
+
return {
|
|
51
|
+
link,
|
|
52
|
+
title: item.find('h3').text(),
|
|
53
|
+
pubDate: timezone(parseDate(item.find('.update_date').text(), 'YYYY年MM月DD日'), +9),
|
|
54
|
+
enclosure_url: audio,
|
|
55
|
+
enclosure_type: 'audio/mpeg',
|
|
56
|
+
itunes_item_image: image,
|
|
57
|
+
description: art(path.join(__dirname, 'templates/description.art'), {
|
|
58
|
+
description: item.find('.audio_intro').text(),
|
|
59
|
+
audio,
|
|
60
|
+
}),
|
|
61
|
+
};
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
ctx.state.data = {
|
|
65
|
+
title: $('title').text() || `IBC岩手放送|${$('.programinfo h3').text()}`,
|
|
66
|
+
link: currentUrl,
|
|
67
|
+
item: items,
|
|
68
|
+
description: $('meta[property="og:description"]').attr('content'),
|
|
69
|
+
itunes_author: 'IBC岩手放送',
|
|
70
|
+
image,
|
|
71
|
+
allowEmpty: true,
|
|
72
|
+
};
|
|
73
|
+
};
|
|
@@ -48,7 +48,7 @@ module.exports = async (ctx) => {
|
|
|
48
48
|
title: item.document.title,
|
|
49
49
|
link: `https://${siteDomain}/${item.document.urlString}`,
|
|
50
50
|
author: item.document.screenName,
|
|
51
|
-
description: `<img src="${item.document.coverImageUrl}">`,
|
|
51
|
+
description: `<img src="${item.document.coverImageUrl}?auto=webp&crop=1.2%3A1&frame=1&width=500" width="500">`,
|
|
52
52
|
pubDate: new Date(item.document.publishDate).toUTCString(),
|
|
53
53
|
category: item.document.primaryClassification,
|
|
54
54
|
})),
|
package/lib/v2/ithome/radar.js
CHANGED
|
@@ -17,19 +17,19 @@ module.exports = {
|
|
|
17
17
|
{
|
|
18
18
|
title: '24 小时阅读榜',
|
|
19
19
|
docs: 'https://docs.rsshub.app/new-media.html#it-zhi-jia-re-bang',
|
|
20
|
-
source: ['
|
|
20
|
+
source: ['/*'],
|
|
21
21
|
target: '/ithome/ranking/24h',
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
24
|
title: '7 天最热',
|
|
25
25
|
docs: 'https://docs.rsshub.app/new-media.html#it-zhi-jia-re-bang',
|
|
26
|
-
source: ['
|
|
26
|
+
source: ['/*'],
|
|
27
27
|
target: '/ithome/ranking/7days',
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
30
|
title: '月榜',
|
|
31
31
|
docs: 'https://docs.rsshub.app/new-media.html#it-zhi-jia-re-bang',
|
|
32
|
-
source: ['
|
|
32
|
+
source: ['/*'],
|
|
33
33
|
target: '/ithome/ranking/monthly',
|
|
34
34
|
},
|
|
35
35
|
],
|
package/lib/v2/iwara/index.js
CHANGED
|
@@ -1,43 +1,55 @@
|
|
|
1
1
|
const got = require('@/utils/got');
|
|
2
|
-
const
|
|
2
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
3
|
+
const config = require('@/config').value;
|
|
3
4
|
|
|
4
|
-
const rootUrl = 'https://
|
|
5
|
+
const rootUrl = 'https://www.iwara.tv';
|
|
6
|
+
const apiRootUrl = 'https://api.iwara.tv';
|
|
7
|
+
const imageRootUrl = 'https://i.iwara.tv';
|
|
5
8
|
|
|
6
9
|
const typeMap = {
|
|
7
10
|
video: 'Videos',
|
|
8
11
|
image: 'Images',
|
|
9
12
|
};
|
|
10
13
|
|
|
11
|
-
const
|
|
12
|
-
video:
|
|
13
|
-
image:
|
|
14
|
+
const apiUrlMap = {
|
|
15
|
+
video: `${apiRootUrl}/videos`,
|
|
16
|
+
image: `${apiRootUrl}/images`,
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const parseThumbnail = (type, item) => {
|
|
20
|
+
if (type === 'image') {
|
|
21
|
+
return `<img src="${imageRootUrl}/image/original/${item.thumbnail.id}/${item.thumbnail.name}">`;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (item.embedUrl === null) {
|
|
25
|
+
return `<img src="${imageRootUrl}/image/original/${item.file.id}/thumbnail-${String(item.thumbnail).padStart(2, '0')}.jpg">`;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// regex borrowed from https://stackoverflow.com/a/3726073
|
|
29
|
+
const match = /http(?:s?):\/\/(?:www\.)?youtu(?:be\.com\/watch\?v=|\.be\/)([\w\-_]*)(&(amp;)?[\w?=]*)?/.exec(item.embedUrl);
|
|
30
|
+
if (match) {
|
|
31
|
+
return `<img src="${imageRootUrl}/image/embed/original/youtube/${match[1]}">`;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return '';
|
|
14
35
|
};
|
|
15
36
|
|
|
16
37
|
module.exports = async (ctx) => {
|
|
17
38
|
const username = ctx.params.username;
|
|
39
|
+
const id = await ctx.cache.tryGet(`${apiRootUrl}/profile/${username}`, async () => (await got(`${apiRootUrl}/profile/${username}`)).data.user.id);
|
|
18
40
|
const type = ctx.params.type ?? 'video';
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const imageUrl = 'https:' + $(item).find('img').attr('src');
|
|
28
|
-
return {
|
|
29
|
-
title: $(item).find('h3.title').text(),
|
|
30
|
-
author: username,
|
|
31
|
-
link: rootUrl + $(item).find('h3.title > a').attr('href'),
|
|
32
|
-
description: `<img src="${imageUrl}">`,
|
|
33
|
-
guid: (rootUrl + $(item).find('h3.title > a').attr('href')).split('?')[0],
|
|
34
|
-
};
|
|
35
|
-
})
|
|
36
|
-
.get();
|
|
41
|
+
const items = (await ctx.cache.tryGet(`${apiUrlMap[type]}?user=${id}`, async () => (await got(`${apiUrlMap[type]}?user=${id}`)).data.results, config.cache.routeExpire, false)).map((item) => ({
|
|
42
|
+
title: item.title,
|
|
43
|
+
author: username,
|
|
44
|
+
link: `${rootUrl}/${type}/${item.id}/${item.slug}`,
|
|
45
|
+
category: item.tags.map((i) => i.id),
|
|
46
|
+
description: parseThumbnail(type, item),
|
|
47
|
+
pubDate: parseDate(item.createdAt),
|
|
48
|
+
}));
|
|
37
49
|
|
|
38
50
|
ctx.state.data = {
|
|
39
51
|
title: `${username}'s iwara - ${typeMap[type]}`,
|
|
40
|
-
link:
|
|
52
|
+
link: `${rootUrl}/users/${username}`,
|
|
41
53
|
item: items,
|
|
42
54
|
};
|
|
43
55
|
};
|
package/lib/v2/iwara/radar.js
CHANGED
|
@@ -1,48 +1,147 @@
|
|
|
1
1
|
const got = require('@/utils/got');
|
|
2
2
|
const config = require('@/config').value;
|
|
3
|
-
const cheerio = require('cheerio');
|
|
4
3
|
const { art } = require('@/utils/render');
|
|
4
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
5
5
|
const path = require('path');
|
|
6
|
+
const md = require('markdown-it')({
|
|
7
|
+
html: true,
|
|
8
|
+
});
|
|
6
9
|
|
|
7
10
|
module.exports = async (ctx) => {
|
|
8
|
-
|
|
9
|
-
const subUrl = `https://ecchi.iwara.tv/subscriptions`;
|
|
10
|
-
const cookie = config.iwara.cookie;
|
|
11
|
-
|
|
12
|
-
if (cookie === undefined) {
|
|
11
|
+
if (!config.iwara || !config.iwara.username || !config.iwara.password) {
|
|
13
12
|
throw Error('Iwara subscription RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#pei-zhi-bu-fen-rss-mo-kuai-pei-zhi">relevant config</a>');
|
|
14
13
|
}
|
|
15
14
|
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
author: $(item).find('a.username').text(),
|
|
34
|
-
link: rootUrl + $(item).find('h3.title > a').attr('href'),
|
|
35
|
-
category: type,
|
|
36
|
-
description: art(path.join(__dirname, 'templates/subscriptions.art'), {
|
|
37
|
-
type,
|
|
38
|
-
imageUrl,
|
|
15
|
+
const rootUrl = `https://www.iwara.tv`;
|
|
16
|
+
const username = config.iwara.username;
|
|
17
|
+
const password = config.iwara.password;
|
|
18
|
+
|
|
19
|
+
// get refresh token
|
|
20
|
+
const refreshHeaders = await ctx.cache.tryGet(
|
|
21
|
+
'iwara:token',
|
|
22
|
+
async () => {
|
|
23
|
+
const loginResponse = await got({
|
|
24
|
+
method: 'post',
|
|
25
|
+
url: 'https://api.iwara.tv/user/login',
|
|
26
|
+
headers: {
|
|
27
|
+
'content-type': 'application/json',
|
|
28
|
+
},
|
|
29
|
+
data: JSON.stringify({
|
|
30
|
+
email: username,
|
|
31
|
+
password,
|
|
39
32
|
}),
|
|
33
|
+
});
|
|
34
|
+
return {
|
|
35
|
+
authorization: 'Bearer ' + loginResponse.data.token,
|
|
40
36
|
};
|
|
41
|
-
}
|
|
42
|
-
|
|
37
|
+
},
|
|
38
|
+
30 * 24 * 60 * 60,
|
|
39
|
+
false
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
// get subscription list
|
|
43
|
+
const videoSubUrl = 'https://api.iwara.tv/videos?page=0&limit=30&subscribed=true';
|
|
44
|
+
const imageSubUrl = 'https://api.iwara.tv/images?page=0&limit=30&subscribed=true';
|
|
45
|
+
|
|
46
|
+
// get access token
|
|
47
|
+
const accessResponse = await got({
|
|
48
|
+
method: 'post',
|
|
49
|
+
url: 'https://api.iwara.tv/user/token',
|
|
50
|
+
headers: refreshHeaders,
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
const authHeaders = {
|
|
54
|
+
authorization: 'Bearer ' + accessResponse.data.accessToken,
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const videoResponse = await got({
|
|
58
|
+
method: 'get',
|
|
59
|
+
url: videoSubUrl,
|
|
60
|
+
headers: authHeaders,
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
const imageResponse = await got({
|
|
64
|
+
method: 'get',
|
|
65
|
+
url: imageSubUrl,
|
|
66
|
+
headers: authHeaders,
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
const videoList = videoResponse.data.results.map((item) => {
|
|
70
|
+
let img_path;
|
|
71
|
+
if (item.private === true) {
|
|
72
|
+
img_path = 'https://i.iwara.tv/image/original/';
|
|
73
|
+
} else {
|
|
74
|
+
img_path = 'https://i.iwara.tv/image/thumbnail/';
|
|
75
|
+
}
|
|
76
|
+
const imageUrl = item.file ? img_path + item.file.id.toString().padStart(2, '0') + '/thumbnail-' + item.thumbnail.toString().padStart(2, '0') + '.jpg' : '';
|
|
77
|
+
|
|
78
|
+
return {
|
|
79
|
+
title: item.title,
|
|
80
|
+
author: item.user.name,
|
|
81
|
+
link: rootUrl + '/video/' + item.id,
|
|
82
|
+
category: 'Video',
|
|
83
|
+
imageUrl,
|
|
84
|
+
pubDate: parseDate(item.createdAt),
|
|
85
|
+
private: item.private,
|
|
86
|
+
};
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
const imageList = imageResponse.data.results.map((item) => {
|
|
90
|
+
const imageUrl = item.thumbnail ? 'https://i.iwara.tv/image/thumbnail/' + item.thumbnail.id + '/' + item.thumbnail.id + '.jpg' : '';
|
|
91
|
+
return {
|
|
92
|
+
title: item.title,
|
|
93
|
+
author: item.user.name,
|
|
94
|
+
link: rootUrl + '/image/' + item.id,
|
|
95
|
+
category: 'Image',
|
|
96
|
+
imageUrl,
|
|
97
|
+
pubDate: parseDate(item.createdAt),
|
|
98
|
+
};
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
// fulltext
|
|
102
|
+
const list = videoList.concat(imageList);
|
|
103
|
+
const items = await Promise.all(
|
|
104
|
+
list.map((item) =>
|
|
105
|
+
ctx.cache.tryGet(item.link, async () => {
|
|
106
|
+
let description = art(path.join(__dirname, 'templates/subscriptions.art'), {
|
|
107
|
+
type: item.category,
|
|
108
|
+
imageUrl: item.imageUrl,
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
if (item.private === true) {
|
|
112
|
+
description += 'private';
|
|
113
|
+
return {
|
|
114
|
+
title: item.title,
|
|
115
|
+
author: item.author,
|
|
116
|
+
link: item.link,
|
|
117
|
+
category: item.category,
|
|
118
|
+
pubDate: item.pubDate,
|
|
119
|
+
description,
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
const link = item.link.replace('www.iwara.tv', 'api.iwara.tv');
|
|
123
|
+
const response = await got({
|
|
124
|
+
method: 'get',
|
|
125
|
+
url: link,
|
|
126
|
+
headers: authHeaders,
|
|
127
|
+
});
|
|
128
|
+
const body = response.data.body ? md.render(response.data.body) : '';
|
|
129
|
+
description += body;
|
|
130
|
+
|
|
131
|
+
return {
|
|
132
|
+
title: item.title,
|
|
133
|
+
author: item.author,
|
|
134
|
+
link: item.link,
|
|
135
|
+
category: item.category,
|
|
136
|
+
pubDate: item.pubDate,
|
|
137
|
+
description,
|
|
138
|
+
};
|
|
139
|
+
})
|
|
140
|
+
)
|
|
141
|
+
);
|
|
43
142
|
|
|
44
143
|
ctx.state.data = {
|
|
45
|
-
title:
|
|
144
|
+
title: `Iwara Subscription`,
|
|
46
145
|
link: rootUrl,
|
|
47
146
|
item: items,
|
|
48
147
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<h3>{{ type }}</h3><br><img src="{{ imageUrl }}">
|
|
1
|
+
<h3>{{ type }}</h3><br><img src="{{ imageUrl }}"><br>
|
package/lib/v2/line/publisher.js
CHANGED
|
@@ -46,7 +46,7 @@ module.exports = async (ctx) => {
|
|
|
46
46
|
ctx.state.data = {
|
|
47
47
|
title: `${publisherInfo.data.name} - Line Today`,
|
|
48
48
|
description: publisherInfo.data.introduction,
|
|
49
|
-
image: `https://obs.line-scdn.net/${publisherInfo.data.icon.hash}
|
|
49
|
+
image: publisherInfo.data.icon ? `https://obs.line-scdn.net/${publisherInfo.data.icon.hash}` : undefined,
|
|
50
50
|
link: `${baseUrl}/${edition}/v2/publisher/${id}`,
|
|
51
51
|
item: items,
|
|
52
52
|
};
|
|
File without changes
|
package/lib/v2/mdpi/radar.js
CHANGED
|
File without changes
|
package/lib/v2/mdpi/router.js
CHANGED
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const config = require('@/config').value;
|
|
2
|
+
|
|
3
|
+
const parseArticle = require('./parse-article.js');
|
|
4
|
+
const { getFollowingFeedQuery } = require('./graphql.js');
|
|
5
|
+
|
|
6
|
+
module.exports = async (ctx) => {
|
|
7
|
+
const user = ctx.params.user;
|
|
8
|
+
|
|
9
|
+
const cookie = config.medium.cookies[user];
|
|
10
|
+
if (cookie === undefined) {
|
|
11
|
+
throw Error(`缺少 Medium 用户 ${user} 登录后的 Cookie 值`);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const posts = await getFollowingFeedQuery(user, cookie);
|
|
15
|
+
ctx.state.json = posts;
|
|
16
|
+
|
|
17
|
+
if (!posts) {
|
|
18
|
+
// login failed
|
|
19
|
+
throw Error(`Medium 用户 ${user} 的 Cookie 无效或已过期`);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const urls = posts.items.map((data) => data.post.mediumUrl);
|
|
23
|
+
|
|
24
|
+
const parsedArticles = await Promise.all(urls.map((url) => parseArticle(ctx, url)));
|
|
25
|
+
|
|
26
|
+
ctx.state.data = {
|
|
27
|
+
title: `${user} Medium Following`,
|
|
28
|
+
link: 'https://medium.com/?feed=following',
|
|
29
|
+
item: parsedArticles,
|
|
30
|
+
};
|
|
31
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const config = require('@/config').value;
|
|
2
|
+
|
|
3
|
+
const parseArticle = require('./parse-article.js');
|
|
4
|
+
const { getWebInlineRecommendedFeedQuery } = require('./graphql.js');
|
|
5
|
+
|
|
6
|
+
module.exports = async (ctx) => {
|
|
7
|
+
const user = ctx.params.user;
|
|
8
|
+
|
|
9
|
+
const cookie = config.medium.cookies[user];
|
|
10
|
+
if (cookie === undefined) {
|
|
11
|
+
throw Error(`缺少 Medium 用户 ${user} 登录后的 Cookie 值`);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const posts = await getWebInlineRecommendedFeedQuery(user, cookie);
|
|
15
|
+
ctx.state.json = posts;
|
|
16
|
+
|
|
17
|
+
if (!posts) {
|
|
18
|
+
// login failed
|
|
19
|
+
throw Error(`Medium 用户 ${user} 的 Cookie 无效或已过期`);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const urls = posts.items.map((data) => data.post.mediumUrl);
|
|
23
|
+
|
|
24
|
+
const parsedArticles = await Promise.all(urls.map((url) => parseArticle(ctx, url)));
|
|
25
|
+
|
|
26
|
+
ctx.state.data = {
|
|
27
|
+
title: `${user} Medium For You`,
|
|
28
|
+
link: 'https://medium.com/',
|
|
29
|
+
item: parsedArticles,
|
|
30
|
+
};
|
|
31
|
+
};
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
|
|
3
|
+
async function graphqlRequest(body, cookie) {
|
|
4
|
+
const { data } = await got('https://medium.com/_/graphql', {
|
|
5
|
+
method: 'POST',
|
|
6
|
+
headers: {
|
|
7
|
+
accept: '*/*',
|
|
8
|
+
'accept-language': 'en-US,en;q=0.9,zh;q=0.8,zh-CN;q=0.7',
|
|
9
|
+
'apollographql-client-name': 'lite',
|
|
10
|
+
'apollographql-client-version': 'main-20230505-195233-209f54c418',
|
|
11
|
+
'cache-control': 'no-cache',
|
|
12
|
+
'content-type': 'application/json',
|
|
13
|
+
'medium-frontend-app': 'lite/main-20230505-195233-209f54c418',
|
|
14
|
+
'medium-frontend-path': '/',
|
|
15
|
+
'medium-frontend-route': 'homepage',
|
|
16
|
+
'ot-tracer-sampled': 'true',
|
|
17
|
+
'ot-tracer-spanid': '2db0b0d7263ffad8',
|
|
18
|
+
'ot-tracer-traceid': '679eb621b33147c4',
|
|
19
|
+
pragma: 'no-cache',
|
|
20
|
+
'sec-ch-ua': '"Chromium";v="113", "Not-A.Brand";v="24"',
|
|
21
|
+
'sec-ch-ua-mobile': '?0',
|
|
22
|
+
'sec-ch-ua-platform': '"macOS"',
|
|
23
|
+
'sec-fetch-dest': 'empty',
|
|
24
|
+
'sec-fetch-mode': 'cors',
|
|
25
|
+
'sec-fetch-site': 'same-origin',
|
|
26
|
+
'graphql-operation': body.operationName,
|
|
27
|
+
cookie,
|
|
28
|
+
},
|
|
29
|
+
data: JSON.stringify([body]),
|
|
30
|
+
});
|
|
31
|
+
return data[0].data;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
async function getFollowingFeedQuery(user, cookie, pagingLimit = 20) {
|
|
35
|
+
return (await graphqlRequest(newFollowingFeedQuery(pagingLimit), cookie))?.followingFeed;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
async function getWebInlineRecommendedFeedQuery(user, cookie, pagingLimit = 20) {
|
|
39
|
+
return (await graphqlRequest(newWebInlineRecommendedFeedQuery(pagingLimit), cookie))?.webRecommendedFeed;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
async function getWebInlineTopicFeedQuery(user, tagSlug, cookie, pagingLimit = 20) {
|
|
43
|
+
return (await graphqlRequest(newWebInlineTopicFeedQuery(tagSlug, pagingLimit), cookie))?.personalisedTagFeed;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
async function getUserCatalogMainContentQuery(user, catalogId, cookie, pagingLimit = 20) {
|
|
47
|
+
return (await graphqlRequest(newUserCatalogMainContentQuery(catalogId, pagingLimit), cookie))?.catalogById;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
module.exports = {
|
|
51
|
+
getWebInlineRecommendedFeedQuery,
|
|
52
|
+
getFollowingFeedQuery,
|
|
53
|
+
getWebInlineTopicFeedQuery,
|
|
54
|
+
getUserCatalogMainContentQuery,
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
function newFollowingFeedQuery(pagingLimit = 5) {
|
|
58
|
+
return {
|
|
59
|
+
operationName: 'FollowingFeedQuery',
|
|
60
|
+
variables: {
|
|
61
|
+
paging: {
|
|
62
|
+
limit: pagingLimit,
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
query: `query FollowingFeedQuery($paging: PagingOptions) {
|
|
66
|
+
followingFeed(paging: $paging) {
|
|
67
|
+
items {
|
|
68
|
+
feedId
|
|
69
|
+
post {
|
|
70
|
+
mediumUrl
|
|
71
|
+
__typename
|
|
72
|
+
}
|
|
73
|
+
__typename
|
|
74
|
+
}
|
|
75
|
+
pagingInfo {
|
|
76
|
+
next {
|
|
77
|
+
to
|
|
78
|
+
from
|
|
79
|
+
limit
|
|
80
|
+
source
|
|
81
|
+
__typename
|
|
82
|
+
}
|
|
83
|
+
__typename
|
|
84
|
+
}
|
|
85
|
+
__typename
|
|
86
|
+
}
|
|
87
|
+
}`,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function newWebInlineRecommendedFeedQuery(pagingLimit = 5) {
|
|
92
|
+
return {
|
|
93
|
+
operationName: 'WebInlineRecommendedFeedQuery',
|
|
94
|
+
variables: {
|
|
95
|
+
forceRank: true,
|
|
96
|
+
paging: {
|
|
97
|
+
limit: pagingLimit,
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
query: `query WebInlineRecommendedFeedQuery($paging: PagingOptions, $forceRank: Boolean) {
|
|
101
|
+
webRecommendedFeed(paging: $paging, forceRank: $forceRank) {
|
|
102
|
+
items {
|
|
103
|
+
feedId
|
|
104
|
+
post {
|
|
105
|
+
mediumUrl
|
|
106
|
+
__typename
|
|
107
|
+
}
|
|
108
|
+
__typename
|
|
109
|
+
}
|
|
110
|
+
pagingInfo {
|
|
111
|
+
next {
|
|
112
|
+
limit
|
|
113
|
+
to
|
|
114
|
+
source
|
|
115
|
+
__typename
|
|
116
|
+
}
|
|
117
|
+
__typename
|
|
118
|
+
}
|
|
119
|
+
__typename
|
|
120
|
+
}
|
|
121
|
+
}`,
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function newWebInlineTopicFeedQuery(tagSlug, pagingLimit = 5) {
|
|
126
|
+
return {
|
|
127
|
+
operationName: 'WebInlineTopicFeedQuery',
|
|
128
|
+
variables: {
|
|
129
|
+
tagSlug,
|
|
130
|
+
paging: {
|
|
131
|
+
limit: pagingLimit,
|
|
132
|
+
},
|
|
133
|
+
skipCache: true,
|
|
134
|
+
},
|
|
135
|
+
query: `query WebInlineTopicFeedQuery($tagSlug: String!, $paging: PagingOptions!, $skipCache: Boolean) {
|
|
136
|
+
personalisedTagFeed(tagSlug: $tagSlug, paging: $paging, skipCache: $skipCache) {
|
|
137
|
+
items {
|
|
138
|
+
feedId
|
|
139
|
+
post {
|
|
140
|
+
mediumUrl
|
|
141
|
+
__typename
|
|
142
|
+
}
|
|
143
|
+
__typename
|
|
144
|
+
}
|
|
145
|
+
pagingInfo {
|
|
146
|
+
next {
|
|
147
|
+
source
|
|
148
|
+
limit
|
|
149
|
+
from
|
|
150
|
+
to
|
|
151
|
+
__typename
|
|
152
|
+
}
|
|
153
|
+
__typename
|
|
154
|
+
}
|
|
155
|
+
__typename
|
|
156
|
+
}
|
|
157
|
+
}`,
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
function newUserCatalogMainContentQuery(catalogId, pagingLimit = 20) {
|
|
162
|
+
return {
|
|
163
|
+
operationName: 'UserCatalogMainContentQuery',
|
|
164
|
+
variables: {
|
|
165
|
+
catalogId,
|
|
166
|
+
pagingOptions: {
|
|
167
|
+
limit: pagingLimit,
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
query: `query UserCatalogMainContentQuery($catalogId: ID!, $pagingOptions: CatalogPagingOptionsInput!) {
|
|
171
|
+
catalogById(catalogId: $catalogId) {
|
|
172
|
+
__typename
|
|
173
|
+
... on Catalog {
|
|
174
|
+
name
|
|
175
|
+
itemsConnection(pagingOptions: $pagingOptions) {
|
|
176
|
+
items {
|
|
177
|
+
entity {
|
|
178
|
+
... on Post {
|
|
179
|
+
mediumUrl
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
__typename
|
|
183
|
+
}
|
|
184
|
+
__typename
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}`,
|
|
189
|
+
};
|
|
190
|
+
}
|