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
package/lib/v2/weibo/keyword.js
CHANGED
|
@@ -37,19 +37,10 @@ module.exports = async (ctx) => {
|
|
|
37
37
|
if (item.mblog.retweeted_status && item.mblog.retweeted_status.created_at) {
|
|
38
38
|
item.mblog.retweeted_status.created_at = timezone(item.mblog.retweeted_status.created_at, +8);
|
|
39
39
|
}
|
|
40
|
-
|
|
40
|
+
return weiboUtils.formatExtended(ctx, item.mblog, undefined, {
|
|
41
41
|
showAuthorInTitle: fallback(undefined, queryToBoolean(routeParams.showAuthorInTitle), true),
|
|
42
42
|
showAuthorInDesc: fallback(undefined, queryToBoolean(routeParams.showAuthorInDesc), true),
|
|
43
43
|
});
|
|
44
|
-
const title = formatExtended.title;
|
|
45
|
-
const description = formatExtended.description;
|
|
46
|
-
return {
|
|
47
|
-
title,
|
|
48
|
-
description,
|
|
49
|
-
pubDate: item.mblog.created_at,
|
|
50
|
-
author: item.mblog.user.screen_name,
|
|
51
|
-
link: `https://weibo.com/${item.mblog.user.id}/${item.mblog.bid}`,
|
|
52
|
-
};
|
|
53
44
|
}),
|
|
54
45
|
});
|
|
55
46
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
'/
|
|
2
|
+
'/group/:gid/:gname?/:routeParams?': ['monologconnor', 'Rongronggg9'],
|
|
3
|
+
'/keyword/:keyword/:routeParams?': ['DIYgod', 'Rongronggg9'],
|
|
3
4
|
'/oasis/user/:userid': ['kt286'],
|
|
4
5
|
'/search/hot': ['xyqfer'],
|
|
5
|
-
'/super_index/:id/:type?/:routeParams?': ['zengxs'],
|
|
6
|
-
'/timeline/:uid/:feature?/:routeParams?': ['zytomorrow', 'DIYgod
|
|
6
|
+
'/super_index/:id/:type?/:routeParams?': ['zengxs', 'Rongronggg9'],
|
|
7
|
+
'/timeline/:uid/:feature?/:routeParams?': ['zytomorrow', 'DIYgod', 'Rongronggg9'],
|
|
7
8
|
'/user/:uid/:routeParams?': ['DIYgod', 'iplusx', 'Rongronggg9'],
|
|
8
9
|
};
|
package/lib/v2/weibo/router.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
module.exports = (router) => {
|
|
2
|
+
router.get('/group/:gid/:gname?/:routeParams?', require('./group'));
|
|
2
3
|
router.get('/keyword/:keyword/:routeParams?', require('./keyword'));
|
|
3
4
|
router.get('/oasis/user/:userid', require('./oasis/user'));
|
|
4
5
|
router.get('/search/hot', require('./search/hot'));
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
const got = require('@/utils/got');
|
|
2
2
|
const weiboUtils = require('./utils');
|
|
3
|
-
const timezone = require('@/utils/timezone');
|
|
4
3
|
const queryString = require('query-string');
|
|
5
4
|
const config = require('@/config').value;
|
|
6
5
|
|
|
@@ -40,15 +39,7 @@ module.exports = async (ctx) => {
|
|
|
40
39
|
if (mblogCard.card_type === '9' && 'mblog' in mblogCard) {
|
|
41
40
|
const mblog = mblogCard.mblog;
|
|
42
41
|
const formatExtended = weiboUtils.formatExtended(ctx, mblog);
|
|
43
|
-
|
|
44
|
-
const desc = formatExtended.description;
|
|
45
|
-
resultItems.push({
|
|
46
|
-
title,
|
|
47
|
-
description: desc,
|
|
48
|
-
author: mblog.user.screen_name,
|
|
49
|
-
link: `https://weibo.com/${mblog.user.id}/${mblog.bid}`,
|
|
50
|
-
pubDate: timezone(mblog.created_at, +8),
|
|
51
|
-
});
|
|
42
|
+
resultItems.push(formatExtended);
|
|
52
43
|
}
|
|
53
44
|
}
|
|
54
45
|
}
|
package/lib/v2/weibo/timeline.js
CHANGED
|
@@ -83,11 +83,11 @@ module.exports = async (ctx) => {
|
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
const
|
|
86
|
+
const guid = `https://weibo.com/${uid}/${item.id}`;
|
|
87
|
+
// not using formatExtended.guid in order not to introduce breaking change
|
|
87
88
|
|
|
88
|
-
const formatExtended = weiboUtils.formatExtended(ctx, item);
|
|
89
|
+
const formatExtended = weiboUtils.formatExtended(ctx, item, uid);
|
|
89
90
|
let description = formatExtended.description;
|
|
90
|
-
const title = formatExtended.title;
|
|
91
91
|
const pubDate = isDataOK ? parseDate(data.created_at) : parseDate(item.created_at);
|
|
92
92
|
|
|
93
93
|
// 视频的处理
|
|
@@ -116,9 +116,9 @@ module.exports = async (ctx) => {
|
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
return {
|
|
119
|
-
|
|
119
|
+
...formatExtended,
|
|
120
|
+
guid,
|
|
120
121
|
description,
|
|
121
|
-
link,
|
|
122
122
|
pubDate,
|
|
123
123
|
author: item.user.screen_name,
|
|
124
124
|
};
|
package/lib/v2/weibo/user.js
CHANGED
|
@@ -94,11 +94,8 @@ module.exports = async (ctx) => {
|
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
const
|
|
98
|
-
const formatExtended = weiboUtils.formatExtended(ctx, item.mblog);
|
|
97
|
+
const formatExtended = weiboUtils.formatExtended(ctx, item.mblog, uid);
|
|
99
98
|
let description = formatExtended.description;
|
|
100
|
-
const title = formatExtended.title;
|
|
101
|
-
const pubDate = item.mblog.created_at;
|
|
102
99
|
|
|
103
100
|
// 视频的处理
|
|
104
101
|
if (displayVideo === '1') {
|
|
@@ -126,11 +123,8 @@ module.exports = async (ctx) => {
|
|
|
126
123
|
}
|
|
127
124
|
|
|
128
125
|
return {
|
|
129
|
-
|
|
126
|
+
...formatExtended,
|
|
130
127
|
description,
|
|
131
|
-
link,
|
|
132
|
-
pubDate,
|
|
133
|
-
author: item.mblog.user.screen_name,
|
|
134
128
|
isPinned: item.profile_type_id?.startsWith('proweibotop'),
|
|
135
129
|
};
|
|
136
130
|
})
|
package/lib/v2/weibo/utils.js
CHANGED
|
@@ -14,7 +14,9 @@ const weiboUtils = {
|
|
|
14
14
|
.replace(/<[^<]*>/g, '')
|
|
15
15
|
.replace(/\n/g, ' ')
|
|
16
16
|
.trim(),
|
|
17
|
-
formatExtended: (ctx, status, params = {}, picsPrefixes = []) => {
|
|
17
|
+
formatExtended: (ctx, status, uid = undefined, params = {}, picsPrefixes = []) => {
|
|
18
|
+
// `uid = undefined` to explicitly mark it as optional, avoiding IDEs prompting warnings
|
|
19
|
+
|
|
18
20
|
// undefined and strings like "1" is also safely parsed, so no if branch is needed
|
|
19
21
|
const routeParams = querystring.parse(ctx.params.routeParams);
|
|
20
22
|
|
|
@@ -35,6 +37,7 @@ const weiboUtils = {
|
|
|
35
37
|
sizeOfAuthorAvatar: fallback(params.sizeOfAuthorAvatar, queryToInteger(routeParams.sizeOfAuthorAvatar), 48),
|
|
36
38
|
showEmojiInDescription: fallback(params.showEmojiInDescription, queryToInteger(routeParams.showEmojiInDescription), true),
|
|
37
39
|
showLinkIconInDescription: fallback(params.showLinkIconInDescription, queryToInteger(routeParams.showLinkIconInDescription), true),
|
|
40
|
+
preferMobileLink: fallback(params.preferMobileLink, queryToBoolean(routeParams.preferMobileLink), false),
|
|
38
41
|
};
|
|
39
42
|
|
|
40
43
|
params = mergedParams;
|
|
@@ -56,6 +59,7 @@ const weiboUtils = {
|
|
|
56
59
|
sizeOfAuthorAvatar,
|
|
57
60
|
showEmojiInDescription,
|
|
58
61
|
showLinkIconInDescription,
|
|
62
|
+
preferMobileLink,
|
|
59
63
|
} = params;
|
|
60
64
|
|
|
61
65
|
let retweeted = '';
|
|
@@ -191,7 +195,7 @@ const weiboUtils = {
|
|
|
191
195
|
retweetedParams.showAuthorInDesc = true;
|
|
192
196
|
retweetedParams.showAuthorAvatarInDesc = false;
|
|
193
197
|
retweetedParams.showAtBeforeAuthor = true;
|
|
194
|
-
retweeted += weiboUtils.formatExtended(ctx, status.retweeted_status, retweetedParams, picsPrefixes).description;
|
|
198
|
+
retweeted += weiboUtils.formatExtended(ctx, status.retweeted_status, undefined, retweetedParams, picsPrefixes).description;
|
|
195
199
|
|
|
196
200
|
html += retweeted;
|
|
197
201
|
|
|
@@ -231,7 +235,15 @@ const weiboUtils = {
|
|
|
231
235
|
title += ' [视频]';
|
|
232
236
|
}
|
|
233
237
|
|
|
234
|
-
|
|
238
|
+
uid = uid || status.user?.id;
|
|
239
|
+
const bid = status.bid || status.id;
|
|
240
|
+
const guid = uid ? `https://weibo.com/${uid}/${bid}` : `https://m.weibo.cn/status/${bid}`;
|
|
241
|
+
const link = preferMobileLink ? `https://m.weibo.cn/status/${bid}` : guid;
|
|
242
|
+
|
|
243
|
+
const author = status.user?.screen_name;
|
|
244
|
+
const pubDate = status.created_at;
|
|
245
|
+
|
|
246
|
+
return { description: html, title, link, guid, author, pubDate };
|
|
235
247
|
},
|
|
236
248
|
getShowData: async (uid, bid) => {
|
|
237
249
|
const link = `https://m.weibo.cn/statuses/show?id=${bid}`;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
const config = require('@/config').value;
|
|
4
|
+
const { art } = require('@/utils/render');
|
|
5
|
+
const { join } = require('path');
|
|
6
|
+
|
|
7
|
+
module.exports = async (ctx) => {
|
|
8
|
+
const baseUrl = 'https://winstall.app';
|
|
9
|
+
const { appId } = ctx.params;
|
|
10
|
+
|
|
11
|
+
const buildId = await ctx.cache.tryGet(
|
|
12
|
+
'winget:buildId',
|
|
13
|
+
async () => {
|
|
14
|
+
const { data } = await got(baseUrl);
|
|
15
|
+
const $ = cheerio.load(data);
|
|
16
|
+
|
|
17
|
+
return JSON.parse($('#__NEXT_DATA__').text()).buildId;
|
|
18
|
+
},
|
|
19
|
+
config.cache.routeExpire,
|
|
20
|
+
false
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
const { data: response } = await got(`${baseUrl}/_next/data/${buildId}/apps/${appId}.json`);
|
|
24
|
+
const { app } = response.pageProps;
|
|
25
|
+
const items = app.versions.map((item) => ({
|
|
26
|
+
title: `${app.name} ${item.version}`,
|
|
27
|
+
description: art(join(__dirname, 'templates/desc.art'), {
|
|
28
|
+
installers: item.installers,
|
|
29
|
+
}),
|
|
30
|
+
author: app.publisher,
|
|
31
|
+
category: app.tags,
|
|
32
|
+
guid: `winstall:${appId}:${item.version}`,
|
|
33
|
+
}));
|
|
34
|
+
|
|
35
|
+
ctx.state.data = {
|
|
36
|
+
title: `${app.name} - winstall`,
|
|
37
|
+
description: app.desc,
|
|
38
|
+
link: `${baseUrl}/apps/${appId}`,
|
|
39
|
+
image: `https://api.winstall.app/icons/next/${appId}.webp`,
|
|
40
|
+
language: 'en',
|
|
41
|
+
item: items,
|
|
42
|
+
};
|
|
43
|
+
};
|
package/lib/v2/wnacg/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{{ if description }}
|
|
2
|
-
{{@ description }}
|
|
2
|
+
{{@ description }}
|
|
3
3
|
{{ /if }}
|
|
4
4
|
<br>
|
|
5
5
|
{{ if imgList }}
|
|
6
|
-
{{ each imgList img }}
|
|
7
|
-
<img src="https:{{ img.url }}" alt="{{ img.caption }}">
|
|
8
|
-
{{ /each }}
|
|
6
|
+
{{ each imgList img }}
|
|
7
|
+
<img src="https:{{ img.url }}" alt="{{ img.caption }}">
|
|
8
|
+
{{ /each }}
|
|
9
9
|
{{ /if }}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
3
|
+
const timezone = require('@/utils/timezone');
|
|
4
|
+
|
|
5
|
+
module.exports = async (ctx) => {
|
|
6
|
+
const apiUrl = 'https://ehall.wtu.edu.cn/wtu/api/queryBulletinListByConditional.do?pageNum=1&pageSize=20&columnId=';
|
|
7
|
+
const listUrl = 'https://ehall.wtu.edu.cn/new/list.html?type=';
|
|
8
|
+
const psgUrl = 'https://ehall.wtu.edu.cn/new/detail-word.html?';
|
|
9
|
+
const map = new Map([
|
|
10
|
+
[1, { title: '通知公告', type: '2', id: '1994a3b58bef4ee887e1efc19881decd' }],
|
|
11
|
+
[2, { title: '教务信息', type: '6', id: '36d47fcd3e774f289adfef1d93138a9d' }],
|
|
12
|
+
[3, { title: '科研动态', type: '7', id: '48e8abfb983b4e4486b69feacad1dc1b' }],
|
|
13
|
+
]);
|
|
14
|
+
|
|
15
|
+
const typeInt = parseInt(ctx.params.type);
|
|
16
|
+
const value = map.get(typeInt);
|
|
17
|
+
const title = value.title;
|
|
18
|
+
const columnId = value.id;
|
|
19
|
+
const type = value.type;
|
|
20
|
+
const res = await got({
|
|
21
|
+
method: 'get',
|
|
22
|
+
url: `${apiUrl}${columnId}`,
|
|
23
|
+
});
|
|
24
|
+
const resJson = res.data.bulletinList;
|
|
25
|
+
|
|
26
|
+
ctx.state.data = {
|
|
27
|
+
title: `${title} - 武汉纺织大学信息门户`,
|
|
28
|
+
link: `${listUrl}${type}`,
|
|
29
|
+
description: `${title} - 武汉纺织大学信息门户`,
|
|
30
|
+
item: resJson.map((item) => ({
|
|
31
|
+
title: item.TITLE,
|
|
32
|
+
pubDate: timezone(parseDate(item.CREATE_TIME), 8),
|
|
33
|
+
link: item.GOTO_URL ?? `${psgUrl}type=${type}?bulletinId=${item.WID}`,
|
|
34
|
+
author: item.PUBLISH_USER_DEPT_NAME,
|
|
35
|
+
})),
|
|
36
|
+
};
|
|
37
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
3
|
+
const zlib = require('zlib');
|
|
4
|
+
const cheerio = require('cheerio');
|
|
5
|
+
|
|
6
|
+
const baseUrl = 'https://wtu.91wllm.com/';
|
|
7
|
+
|
|
8
|
+
const typeMap = new Map([
|
|
9
|
+
['xxtz', { title: '信息通知', url: `${baseUrl}news/index/tag/xxtz` }],
|
|
10
|
+
['tzgg', { title: '通知公告', url: `${baseUrl}news/index/tag/tzgg` }],
|
|
11
|
+
['xwkd', { title: '新闻快递', url: `${baseUrl}news/index/tag/xwkd` }],
|
|
12
|
+
]);
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* 解压缩数据
|
|
16
|
+
* @param {String} str
|
|
17
|
+
* @returns {String}
|
|
18
|
+
*/
|
|
19
|
+
function decodeData(str) {
|
|
20
|
+
// 匹配正则
|
|
21
|
+
const regex = /Base64.decode\(unzip\("(.+?)"\)\.substr\((\d+)\)\)\.substr\((\d+)\)/;
|
|
22
|
+
const match = str.match(regex);
|
|
23
|
+
if (!match) {
|
|
24
|
+
return '';
|
|
25
|
+
}
|
|
26
|
+
// 获取数据
|
|
27
|
+
const compressedContent = match[1];
|
|
28
|
+
const substr1Num = Number.parseInt(match[2]);
|
|
29
|
+
const substr2Num = Number.parseInt(match[3]);
|
|
30
|
+
// 解压缩
|
|
31
|
+
const unzipContent = zlib.inflateSync(Buffer.from(compressedContent, 'base64')).toString('utf8');
|
|
32
|
+
const content = Buffer.from(unzipContent.substring(substr1Num), 'base64');
|
|
33
|
+
return content.toString('utf8').substring(substr2Num);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
module.exports = async (ctx) => {
|
|
37
|
+
// 获取参数 type
|
|
38
|
+
const type = ctx.params.type;
|
|
39
|
+
const mapItem = typeMap.get(type);
|
|
40
|
+
const msgTitle = `${mapItem.title} - 武汉纺织大学就业信息`;
|
|
41
|
+
const link = mapItem.url;
|
|
42
|
+
|
|
43
|
+
// 请求网页
|
|
44
|
+
const resp = await got.get(link);
|
|
45
|
+
// 解压缩列表数据
|
|
46
|
+
const listStr = decodeData(resp.data);
|
|
47
|
+
// 解析列表数据
|
|
48
|
+
const $ = cheerio.load(listStr);
|
|
49
|
+
const list = $('.newsList')
|
|
50
|
+
.toArray()
|
|
51
|
+
.map((item) => {
|
|
52
|
+
item = $(item);
|
|
53
|
+
const $date = item.find("li[class='span2 y']").text();
|
|
54
|
+
const $linkLi = item.find('li>a');
|
|
55
|
+
const $url = new URL($linkLi.attr('href'), baseUrl).href;
|
|
56
|
+
return {
|
|
57
|
+
title: $linkLi.text(),
|
|
58
|
+
pubDate: parseDate($date, 'YYYY-MM-DD'),
|
|
59
|
+
link: $url,
|
|
60
|
+
};
|
|
61
|
+
});
|
|
62
|
+
// 获取全文信息
|
|
63
|
+
const items = await Promise.all(
|
|
64
|
+
list.map((item) =>
|
|
65
|
+
ctx.cache.tryGet(item.link, async () => {
|
|
66
|
+
const { data: response } = await got.get(item.link);
|
|
67
|
+
const content = decodeData(response);
|
|
68
|
+
item.description = content;
|
|
69
|
+
return item;
|
|
70
|
+
})
|
|
71
|
+
)
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
ctx.state.data = {
|
|
75
|
+
title: msgTitle,
|
|
76
|
+
link,
|
|
77
|
+
description: msgTitle,
|
|
78
|
+
item: items,
|
|
79
|
+
};
|
|
80
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
'91wllm.com': {
|
|
3
|
+
_name: '湖北高校就业网络联盟',
|
|
4
|
+
wtu: [
|
|
5
|
+
{
|
|
6
|
+
title: '武汉纺织大学就业信息',
|
|
7
|
+
docs: 'https://docs.rsshub.app/university.html#wu-han-fang-zhi-da-xue',
|
|
8
|
+
source: '/news/index/tag/:type',
|
|
9
|
+
target: '/wtu/job/:type',
|
|
10
|
+
},
|
|
11
|
+
],
|
|
12
|
+
},
|
|
13
|
+
'wtu.edu.cn': {
|
|
14
|
+
_name: '武汉纺织大学',
|
|
15
|
+
wtu: [
|
|
16
|
+
{
|
|
17
|
+
title: '信息门户公告',
|
|
18
|
+
docs: 'https://docs.rsshub.app/university.html#wu-han-fang-zhi-da-xue',
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const { getNotes, formatText, formatNote } = require('./util');
|
|
2
|
+
|
|
3
|
+
module.exports = async (ctx) => {
|
|
4
|
+
const userId = ctx.params.user_id;
|
|
5
|
+
const url = `https://www.xiaohongshu.com/user/profile/${userId}`;
|
|
6
|
+
|
|
7
|
+
const { user, notes } = await getNotes(url, ctx.cache);
|
|
8
|
+
|
|
9
|
+
ctx.state.data = {
|
|
10
|
+
title: `${user.nickname} - 笔记 • 小红书 / RED`,
|
|
11
|
+
description: formatText(user.desc),
|
|
12
|
+
image: user.imageb || user.images,
|
|
13
|
+
link: url,
|
|
14
|
+
item: notes.map((item) => formatNote(url, item)),
|
|
15
|
+
};
|
|
16
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const config = require('@/config').value;
|
|
2
2
|
const logger = require('@/utils/logger');
|
|
3
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
3
4
|
|
|
4
5
|
const getUser = (url, cache) =>
|
|
5
6
|
cache.tryGet(
|
|
@@ -68,7 +69,128 @@ const getBoard = (url, cache) =>
|
|
|
68
69
|
false
|
|
69
70
|
);
|
|
70
71
|
|
|
72
|
+
const getNotes = (url, cache) =>
|
|
73
|
+
cache.tryGet(
|
|
74
|
+
url + '/notes', // To avoid mixing with the cache for `user.js`
|
|
75
|
+
async () => {
|
|
76
|
+
let user = '';
|
|
77
|
+
let notes = [];
|
|
78
|
+
|
|
79
|
+
const setPageFilter = async (page) => {
|
|
80
|
+
await page.setRequestInterception(true);
|
|
81
|
+
page.on('request', (req) => {
|
|
82
|
+
req.resourceType() === 'document' || req.resourceType() === 'script' || req.resourceType() === 'xhr' || req.resourceType() === 'other' ? req.continue() : req.abort();
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const browser = await require('@/utils/puppeteer')({ stealth: true });
|
|
87
|
+
try {
|
|
88
|
+
const page = await browser.newPage();
|
|
89
|
+
await setPageFilter(page);
|
|
90
|
+
|
|
91
|
+
logger.debug(`Requesting ${url}`);
|
|
92
|
+
await page.goto(url);
|
|
93
|
+
|
|
94
|
+
let otherInfo = {};
|
|
95
|
+
let userPosted = {};
|
|
96
|
+
try {
|
|
97
|
+
[otherInfo, userPosted] = await Promise.all(
|
|
98
|
+
['/api/sns/web/v1/user/otherinfo', '/api/sns/web/v1/user_posted'].map((p) =>
|
|
99
|
+
page
|
|
100
|
+
.waitForResponse((res) => {
|
|
101
|
+
const req = res.request();
|
|
102
|
+
return req.url().includes(p) && req.method() === 'GET';
|
|
103
|
+
})
|
|
104
|
+
.then((r) => r.json())
|
|
105
|
+
)
|
|
106
|
+
);
|
|
107
|
+
} catch (e) {
|
|
108
|
+
throw Error(`Could not get user information and note list\n${e}`);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
await page.close();
|
|
112
|
+
|
|
113
|
+
// Get full text for each note
|
|
114
|
+
const notesPromise = userPosted.data.notes.map((n) => {
|
|
115
|
+
const noteUrl = url + '/' + n.note_id;
|
|
116
|
+
|
|
117
|
+
return cache.tryGet(noteUrl, async () => {
|
|
118
|
+
const notePage = await browser.newPage();
|
|
119
|
+
await setPageFilter(notePage);
|
|
120
|
+
|
|
121
|
+
logger.debug(`Requesting ${noteUrl}`);
|
|
122
|
+
await notePage.goto(noteUrl);
|
|
123
|
+
|
|
124
|
+
let feed = {};
|
|
125
|
+
try {
|
|
126
|
+
feed = await notePage.evaluate(() => window.__INITIAL_STATE__);
|
|
127
|
+
|
|
128
|
+
// Sometimes the page is not server-side rendered
|
|
129
|
+
if (typeof feed?.note?.note === 'undefined' || JSON.stringify(feed?.note?.note) === '{}') {
|
|
130
|
+
const res = await notePage.waitForResponse((res) => {
|
|
131
|
+
const req = res.request();
|
|
132
|
+
return req.url().includes('/api/sns/web/v1/feed') && req.method() === 'POST';
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
const json = await res.json();
|
|
136
|
+
const note_card = json.data.items[0].note_card;
|
|
137
|
+
feed.note.note = {
|
|
138
|
+
title: note_card.title,
|
|
139
|
+
noteId: note_card.id,
|
|
140
|
+
desc: note_card.desc,
|
|
141
|
+
tagList: note_card.tag_list,
|
|
142
|
+
imageList: note_card.image_list,
|
|
143
|
+
user: note_card.user,
|
|
144
|
+
time: note_card.time,
|
|
145
|
+
lastUpdateTime: note_card.last_update_time,
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
} catch (e) {
|
|
149
|
+
throw Error(`Could not get note ${n.note_id}\n${e}`);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
await notePage.close();
|
|
153
|
+
|
|
154
|
+
if (typeof feed?.note?.note !== 'undefined' && JSON.stringify(feed?.note?.note) !== '{}') {
|
|
155
|
+
return feed.note.note;
|
|
156
|
+
} else {
|
|
157
|
+
throw Error(`Could not get note ${n.note_id}`);
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
user = otherInfo.data.basic_info;
|
|
163
|
+
notes = await Promise.all(notesPromise);
|
|
164
|
+
} finally {
|
|
165
|
+
await browser.close();
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
return { user, notes };
|
|
169
|
+
},
|
|
170
|
+
config.cache.routeExpire,
|
|
171
|
+
false
|
|
172
|
+
);
|
|
173
|
+
|
|
174
|
+
const formatText = (text) => text.replace(/(\r\n|\r|\n)/g, '<br>').replace(/\t/g, ' ');
|
|
175
|
+
|
|
176
|
+
// tag_list.id has nothing to do with its url
|
|
177
|
+
const formatTagList = (tagList) => tagList.reduce((acc, item) => acc + `#${item.name} `, ``);
|
|
178
|
+
|
|
179
|
+
const formatImageList = (imageList) => imageList.reduce((acc, item) => acc + `<img src="${item.url}"><br>`, ``);
|
|
180
|
+
|
|
181
|
+
const formatNote = (url, note) => ({
|
|
182
|
+
title: note.title,
|
|
183
|
+
link: url + '/' + note.noteId,
|
|
184
|
+
description: formatText(note.desc) + '<br><br>' + formatTagList(note.tagList) + '<br><br>' + formatImageList(note.imageList),
|
|
185
|
+
author: note.user.nickname,
|
|
186
|
+
pubDate: parseDate(note.time, 'x'),
|
|
187
|
+
updated: parseDate(note.lastUpdateTime, 'x'),
|
|
188
|
+
});
|
|
189
|
+
|
|
71
190
|
module.exports = {
|
|
72
191
|
getUser,
|
|
73
192
|
getBoard,
|
|
193
|
+
getNotes,
|
|
194
|
+
formatText,
|
|
195
|
+
formatNote,
|
|
74
196
|
};
|