rsshub 1.0.0-master.c034cfb → 1.0.0-master.c06353f
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 +3 -3
- package/lib/config.js +28 -10
- package/lib/maintainer.js +7 -2
- package/lib/middleware/access-control.js +5 -5
- package/lib/middleware/parameter.js +66 -11
- package/lib/middleware/template.js +79 -85
- package/lib/router.js +20 -20
- package/lib/routes/index.js +6 -13
- package/lib/routes/universities/ynnu/edu/news.js +3 -3
- package/lib/utils/rand-user-agent.js +2 -1
- package/lib/utils/render.js +2 -0
- package/lib/v2/2048/index.js +18 -13
- package/lib/v2/95mm/utils.js +3 -2
- package/lib/v2/abc/index.js +162 -0
- package/lib/v2/abc/maintainer.js +3 -0
- package/lib/v2/abc/radar.js +13 -0
- package/lib/v2/abc/router.js +3 -0
- package/lib/v2/abc/templates/description.art +21 -0
- package/lib/v2/aliyun/notice.js +1 -1
- package/lib/v2/aljazeera/index.js +1 -1
- package/lib/v2/apnews/topics.js +1 -0
- package/lib/v2/apple/apps.js +88 -17
- package/lib/v2/apple/maintainer.js +1 -1
- package/lib/v2/apple/radar.js +3 -3
- package/lib/v2/apple/router.js +1 -1
- package/lib/v2/asiantolick/index.js +73 -27
- package/lib/v2/asiantolick/maintainer.js +5 -3
- package/lib/v2/asiantolick/radar.js +34 -12
- package/lib/v2/asiantolick/router.js +2 -2
- package/lib/v2/asiantolick/templates/description.art +9 -3
- package/lib/v2/bangumi/maintainer.js +2 -0
- package/lib/v2/bangumi/radar.js +12 -0
- package/lib/v2/bangumi/router.js +2 -0
- package/lib/v2/bangumi/tv/other/followrank.js +42 -0
- package/lib/v2/bangumi/tv/user/wish.js +38 -0
- package/lib/v2/bilibili/cache.js +10 -7
- package/lib/v2/bilibili/fav.js +2 -0
- package/lib/v2/bilibili/maintainer.js +1 -0
- package/lib/v2/bilibili/platform.js +43 -0
- package/lib/v2/bilibili/radar.js +8 -0
- package/lib/v2/bilibili/router.js +1 -0
- package/lib/v2/bilibili/userFav.js +2 -0
- package/lib/v2/bilibili/video.js +8 -1
- package/lib/v2/bnu/dwxgb.js +17 -22
- package/lib/v2/booru/maintainer.js +3 -0
- package/lib/v2/booru/mmda.js +47 -0
- package/lib/v2/booru/radar.js +12 -0
- package/lib/v2/booru/router.js +3 -0
- package/lib/v2/bossdesign/index.js +41 -0
- package/lib/v2/bossdesign/maintainer.js +3 -0
- package/lib/v2/bossdesign/radar.js +13 -0
- package/lib/v2/bossdesign/router.js +3 -0
- package/lib/v2/brave/latest.js +4 -2
- package/lib/v2/buaa/maintainer.js +4 -0
- package/lib/v2/buaa/news/index.js +46 -0
- package/lib/v2/buaa/radar.js +21 -0
- package/lib/v2/buaa/router.js +4 -0
- package/lib/v2/buaa/sme.js +59 -0
- package/lib/v2/bytes/maintainer.js +0 -1
- package/lib/v2/caixin/blog.js +68 -45
- package/lib/v2/caixin/router.js +1 -1
- package/lib/v2/caixinglobal/latest.js +64 -0
- package/lib/v2/caixinglobal/maintainer.js +3 -0
- package/lib/v2/caixinglobal/radar.js +13 -0
- package/lib/v2/caixinglobal/router.js +3 -0
- package/lib/v2/cbc/topics.js +3 -1
- package/lib/v2/china/finance/finance.js +61 -0
- package/lib/v2/china/maintainer.js +1 -0
- package/lib/v2/china/news/military/news.js +5 -6
- package/lib/v2/china/radar.js +9 -0
- package/lib/v2/china/router.js +1 -0
- package/lib/v2/chinafactcheck/index.js +20 -21
- package/lib/v2/chinafactcheck/utils.js +16 -16
- package/lib/v2/chinaisa/index.js +83 -0
- package/lib/v2/chinaisa/maintainer.js +3 -0
- package/lib/v2/chinaisa/radar.js +18 -0
- package/lib/v2/chinaisa/router.js +3 -0
- package/lib/v2/cma/channel.js +87 -0
- package/lib/v2/cma/maintainer.js +3 -0
- package/lib/v2/cma/radar.js +18 -0
- package/lib/v2/cma/router.js +3 -0
- package/lib/v2/cma/templates/description.art +13 -0
- package/lib/v2/cmpxchg8b/articles.js +43 -0
- package/lib/v2/cmpxchg8b/maintainer.js +3 -0
- package/lib/v2/cmpxchg8b/radar.js +13 -0
- package/lib/v2/cmpxchg8b/router.js +3 -0
- package/lib/v2/cna/index.js +1 -0
- package/lib/v2/cna/maintainer.js +1 -0
- package/lib/v2/cna/radar.js +6 -0
- package/lib/v2/cna/router.js +1 -0
- package/lib/v2/cna/web/index.js +62 -0
- package/lib/v2/cnbeta/type.js +15 -9
- package/lib/v2/cnbeta/utils.js +3 -0
- package/lib/v2/cqwu/index.js +11 -8
- package/lib/v2/cqwu/radar.js +2 -2
- package/lib/v2/creative-comic/book.js +40 -34
- package/lib/v2/creative-comic/utils.js +1 -2
- package/lib/v2/cyzone/maintainer.js +1 -1
- package/lib/v2/deadline/maintainer.js +0 -1
- package/lib/v2/dlsite/ci-en/article.js +1 -1
- package/lib/v2/dongqiudi/special.js +13 -21
- package/lib/v2/dongqiudi/utils.js +26 -2
- package/lib/v2/douban/maintainer.js +4 -2
- package/lib/v2/douban/other/discussion.js +58 -0
- package/lib/v2/douban/other/doulist.js +9 -7
- package/lib/v2/douban/other/list.js +28 -19
- package/lib/v2/douban/other/recommended.js +68 -0
- package/lib/v2/douban/people/status.js +1 -1
- package/lib/v2/douban/radar.js +8 -0
- package/lib/v2/douban/router.js +3 -1
- package/lib/v2/egsea/flash.js +30 -0
- package/lib/v2/egsea/maintainer.js +3 -0
- package/lib/v2/egsea/radar.js +13 -0
- package/lib/v2/egsea/router.js +3 -0
- package/lib/v2/ehentai/ehapi.js +3 -1
- package/lib/v2/epicgames/index.js +18 -11
- package/lib/v2/epicgames/templates/description.art +1 -0
- package/lib/v2/farmatters/index.js +85 -0
- package/lib/v2/farmatters/maintainer.js +7 -0
- package/lib/v2/farmatters/radar.js +36 -0
- package/lib/v2/farmatters/router.js +6 -0
- package/lib/v2/farmatters/templates/description.art +9 -0
- package/lib/{routes → v2}/firefox/addons.js +3 -1
- package/lib/v2/firefox/breaches.js +38 -0
- package/lib/v2/firefox/maintainer.js +2 -0
- package/lib/v2/firefox/radar.js +17 -0
- package/lib/{routes → v2}/firefox/release.js +3 -3
- package/lib/v2/firefox/router.js +3 -1
- package/lib/v2/foresightnews/maintainer.js +0 -1
- package/lib/v2/fuliba/latest.js +25 -0
- package/lib/v2/fuliba/maintainer.js +3 -0
- package/lib/v2/fuliba/radar.js +15 -0
- package/lib/v2/fuliba/router.js +3 -0
- package/lib/v2/gcores/category.js +1 -0
- package/lib/v2/gcores/radio.js +1 -0
- package/lib/v2/gdsrx/index.js +72 -0
- package/lib/v2/gdsrx/maintainer.js +3 -0
- package/lib/v2/gdsrx/radar.js +61 -0
- package/lib/v2/gdsrx/router.js +3 -0
- package/lib/v2/getitfree/index.js +42 -34
- package/lib/v2/getitfree/maintainer.js +3 -1
- package/lib/v2/getitfree/radar.js +19 -2
- package/lib/v2/getitfree/router.js +10 -2
- package/lib/v2/getitfree/util.js +326 -0
- package/lib/v2/github/topic.js +26 -10
- package/lib/v2/gocn/jobs.js +14 -9
- package/lib/v2/gocn/maintainer.js +3 -1
- package/lib/v2/gocn/news.js +31 -0
- package/lib/v2/gocn/radar.js +8 -2
- package/lib/v2/gocn/router.js +3 -1
- package/lib/v2/gocn/topics.js +15 -7
- package/lib/v2/gocn/utils.js +38 -0
- package/lib/v2/gogoanimehd/radar.js +1 -1
- package/lib/v2/gogoanimehd/recent-releases.js +1 -1
- package/lib/v2/google/alerts.js +33 -0
- package/lib/v2/google/maintainer.js +1 -0
- package/lib/v2/google/router.js +1 -0
- package/lib/v2/gov/forestry/gjlckjdjt.js +96 -0
- package/lib/v2/gov/forestry/templates/description.art +15 -0
- package/lib/v2/gov/maintainer.js +12 -3
- package/lib/v2/gov/mem/sgcc.js +64 -0
- package/lib/v2/gov/moa/zdscxx.js +104 -0
- package/lib/v2/gov/mot/index.js +66 -0
- package/lib/v2/gov/nifdc/index.js +40 -33
- package/lib/v2/gov/npc/index.js +47 -0
- package/lib/v2/gov/radar.js +290 -2
- package/lib/v2/gov/router.js +12 -2
- package/lib/v2/gov/samr/templates/description.art +26 -0
- package/lib/v2/gov/samr/xgzlyhd.js +100 -0
- package/lib/v2/gov/zhejiang/gwy.js +84 -0
- package/lib/v2/gov/zhengce/index.js +99 -0
- package/lib/v2/greasyfork/maintainer.js +1 -0
- package/lib/v2/greasyfork/router.js +1 -0
- package/lib/v2/greasyfork/scripts.js +25 -20
- package/lib/v2/grubstreet/maintainer.js +3 -0
- package/lib/v2/grubstreet/radar.js +13 -0
- package/lib/v2/grubstreet/router.js +3 -0
- package/lib/v2/grubstreet/utils.js +84 -0
- package/lib/v2/guangdiu/maintainer.js +1 -0
- package/lib/v2/guangdiu/radar.js +6 -0
- package/lib/v2/guangdiu/router.js +1 -0
- package/lib/v2/guangdiu/search.js +40 -0
- package/lib/v2/guanhai/maintainer.js +0 -1
- package/lib/{routes/universities → v2}/harvard/health/blog.js +8 -7
- package/lib/v2/harvard/maintainer.js +3 -0
- package/lib/v2/harvard/radar.js +13 -0
- package/lib/v2/harvard/router.js +3 -0
- package/lib/v2/hebtv/maintainer.js +3 -0
- package/lib/v2/hebtv/nong-bo-shi-zai-xing-dong.js +109 -0
- package/lib/v2/hebtv/radar.js +13 -0
- package/lib/v2/hebtv/router.js +3 -0
- package/lib/v2/hebtv/templates/description.art +24 -0
- package/lib/v2/hostmonit/cloudflareyes.js +91 -0
- package/lib/v2/hostmonit/maintainer.js +3 -0
- package/lib/v2/hostmonit/radar.js +17 -0
- package/lib/v2/hostmonit/router.js +8 -0
- package/lib/v2/hostmonit/templates/description.art +28 -0
- package/lib/v2/hostmonit/templates/title.art +1 -0
- package/lib/v2/ianspriggs/index.js +90 -0
- package/lib/v2/ianspriggs/maintainer.js +3 -0
- package/lib/v2/ianspriggs/radar.js +17 -0
- package/lib/v2/ianspriggs/router.js +3 -0
- package/lib/v2/ianspriggs/templates/description.art +13 -0
- package/lib/v2/instagram/templates/images.art +8 -2
- package/lib/v2/instagram/templates/video.art +4 -1
- package/lib/v2/instagram/web-api/index.js +21 -11
- package/lib/v2/instagram/web-api/utils.js +86 -15
- package/lib/v2/iqilu/maintainer.js +3 -0
- package/lib/v2/iqilu/program.js +98 -0
- package/lib/v2/iqilu/radar.js +107 -0
- package/lib/v2/iqilu/router.js +3 -0
- package/lib/v2/iqilu/templates/description.art +24 -0
- package/lib/v2/javbus/index.js +6 -0
- package/lib/v2/javlibrary/maintainer.js +1 -0
- package/lib/v2/javlibrary/maker.js +10 -0
- package/lib/v2/javlibrary/router.js +1 -0
- package/lib/v2/javlibrary/utils.js +1 -0
- package/lib/v2/kamen-rider-official/news.js +1 -1
- package/lib/v2/kemono/index.js +28 -4
- package/lib/v2/kemono/radar.js +1 -1
- package/lib/v2/leetcode/articles.js +14 -10
- package/lib/v2/leetcode/dailyquestion-solution-cn.js +6 -3
- package/lib/v2/leetcode/dailyquestion-solution-en.js +7 -4
- package/lib/v2/liquipedia/cs_matches.js +52 -0
- package/lib/v2/liquipedia/dota2_matches.js +47 -0
- package/lib/v2/liquipedia/maintainer.js +4 -0
- package/lib/v2/liquipedia/radar.js +19 -0
- package/lib/v2/liquipedia/router.js +4 -0
- package/lib/v2/logclub/index.js +134 -0
- package/lib/v2/logclub/maintainer.js +9 -0
- package/lib/v2/logclub/radar.js +139 -0
- package/lib/v2/logclub/report.js +98 -0
- package/lib/v2/logclub/router.js +5 -0
- package/lib/v2/logclub/templates/description.art +33 -0
- package/lib/v2/metacritic/index.js +121 -0
- package/lib/v2/metacritic/maintainer.js +5 -0
- package/lib/v2/metacritic/radar.js +43 -0
- package/lib/v2/metacritic/router.js +3 -0
- package/lib/v2/metacritic/templates/description.art +19 -0
- package/lib/v2/metacritic/util.js +42 -0
- package/lib/v2/mittrchina/index.js +104 -0
- package/lib/v2/mittrchina/maintainer.js +3 -0
- package/lib/v2/mittrchina/radar.js +31 -0
- package/lib/v2/mittrchina/router.js +3 -0
- package/lib/v2/mittrchina/templates/movie.art +5 -0
- package/lib/v2/modb/maintainer.js +3 -0
- package/lib/v2/modb/radar.js +13 -0
- package/lib/v2/modb/router.js +3 -0
- package/lib/v2/modb/topic.js +59 -0
- package/lib/v2/mymusicsheet/maintainer.js +3 -0
- package/lib/v2/mymusicsheet/radar.js +13 -0
- package/lib/v2/mymusicsheet/router.js +3 -0
- package/lib/v2/mymusicsheet/templates/description.art +41 -0
- package/lib/v2/mymusicsheet/usersheets.js +120 -0
- package/lib/v2/nature/cover.js +32 -42
- package/lib/v2/nature/highlight.js +2 -2
- package/lib/v2/nature/news-and-comment.js +2 -2
- package/lib/v2/nature/news.js +2 -2
- package/lib/v2/nature/research.js +2 -2
- package/lib/v2/nature/siteindex.js +5 -5
- package/lib/v2/nature/utils.js +124 -5
- package/lib/v2/nbd/index.js +4 -1
- package/lib/v2/nbd/maintainer.js +1 -1
- package/lib/v2/nbd/radar.js +3 -3
- package/lib/v2/nbd/router.js +1 -1
- package/lib/v2/netflav/index.js +39 -0
- package/lib/v2/netflav/maintainer.js +3 -0
- package/lib/v2/netflav/radar.js +13 -0
- package/lib/v2/netflav/router.js +3 -0
- package/lib/v2/netflav/templates/description.art +8 -0
- package/lib/v2/niaogebiji/maintainer.js +0 -1
- package/lib/v2/npr/radar.js +2 -2
- package/lib/v2/oschina/news.js +1 -0
- package/lib/v2/ouc/it-tx.js +44 -0
- package/lib/v2/ouc/it.js +2 -2
- package/lib/v2/ouc/maintainer.js +2 -1
- package/lib/v2/ouc/radar.js +6 -0
- package/lib/v2/ouc/router.js +1 -0
- package/lib/v2/paulgraham/article.js +62 -0
- package/lib/v2/paulgraham/maintainer.js +3 -0
- package/lib/v2/paulgraham/radar.js +13 -0
- package/lib/v2/paulgraham/router.js +5 -0
- package/lib/v2/people/index.js +15 -24
- package/lib/v2/people/router.js +1 -2
- package/lib/v2/pixiv/ranking.js +1 -0
- package/lib/v2/pixiv/user.js +2 -1
- package/lib/v2/pixiv/utils.js +2 -2
- package/lib/v2/pku/cls/announcement.js +42 -0
- package/lib/v2/pku/maintainer.js +1 -0
- package/lib/v2/pku/radar.js +6 -0
- package/lib/v2/pku/router.js +1 -0
- package/lib/v2/qbitai/category.js +27 -0
- package/lib/v2/qbitai/maintainer.js +4 -0
- package/lib/v2/qbitai/radar.js +19 -0
- package/lib/v2/qbitai/router.js +4 -0
- package/lib/v2/qbitai/tag.js +27 -0
- package/lib/v2/qqorw/maintainer.js +1 -1
- package/lib/v2/reactnewsletter/maintainer.js +0 -1
- package/lib/v2/readhub/index.js +92 -83
- package/lib/v2/readhub/maintainer.js +1 -1
- package/lib/v2/readhub/radar.js +6 -2
- package/lib/v2/readhub/router.js +1 -4
- package/lib/v2/readhub/templates/description.art +40 -0
- package/lib/v2/reuters/common.js +19 -6
- package/lib/v2/reuters/maintainer.js +0 -2
- package/lib/v2/reuters/router.js +0 -2
- package/lib/v2/rfi/maintainer.js +1 -1
- package/lib/v2/rfi/news.js +35 -22
- package/lib/v2/rfi/radar.js +5 -5
- package/lib/v2/rfi/router.js +1 -1
- package/lib/v2/runtrail/maintainer.js +0 -1
- package/lib/v2/scau/maintainer.js +1 -0
- package/lib/v2/scau/radar.js +8 -0
- package/lib/v2/scau/router.js +1 -0
- package/lib/v2/scau/yjs.js +2 -2
- package/lib/v2/scau/yjsy.js +27 -0
- package/lib/v2/science/utils.js +4 -4
- package/lib/v2/scmp/index.js +61 -85
- package/lib/v2/scmp/utils.js +60 -0
- package/lib/v2/segmentfault/blogs.js +6 -23
- package/lib/v2/segmentfault/channel.js +18 -30
- package/lib/v2/segmentfault/user.js +6 -32
- package/lib/v2/segmentfault/utils.js +32 -0
- package/lib/v2/showstart/artist.js +15 -0
- package/lib/v2/showstart/brand.js +15 -0
- package/lib/v2/showstart/const.js +4 -0
- package/lib/v2/showstart/event.js +18 -0
- package/lib/v2/showstart/maintainer.js +6 -0
- package/lib/v2/showstart/radar.js +40 -0
- package/lib/v2/showstart/router.js +6 -0
- package/lib/v2/showstart/search.js +51 -0
- package/lib/v2/showstart/service.js +166 -0
- package/lib/v2/showstart/utils.js +92 -0
- package/lib/v2/sohu/mp.js +48 -35
- package/lib/v2/sohu/templates/video.art +7 -0
- package/lib/v2/tableau/maintainer.js +3 -0
- package/lib/v2/tableau/radar.js +11 -0
- package/lib/v2/tableau/router.js +3 -0
- package/lib/v2/tableau/viz-of-the-day.js +26 -0
- package/lib/v2/techpowerup/maintainer.js +0 -1
- package/lib/v2/telegram/maintainer.js +3 -3
- package/lib/v2/tesla/cx.js +119 -0
- package/lib/v2/tesla/maintainer.js +1 -0
- package/lib/v2/tesla/radar.js +13 -1
- package/lib/v2/tesla/router.js +1 -0
- package/lib/v2/tesla/templates/description.art +140 -0
- package/lib/v2/test/index.js +46 -0
- package/lib/v2/tfc-taiwan/maintainer.js +0 -1
- package/lib/v2/thepaper/featured.js +1 -1
- package/lib/v2/thepaper/utils.js +18 -12
- package/lib/v2/thoughtco/index.js +95 -0
- package/lib/v2/thoughtco/maintainer.js +3 -0
- package/lib/v2/thoughtco/radar.js +155 -0
- package/lib/v2/thoughtco/router.js +3 -0
- package/lib/v2/thoughtco/templates/description.art +16 -0
- package/lib/v2/threads/index.js +20 -150
- package/lib/v2/threads/utils.js +147 -0
- package/lib/v2/twitch/live.js +88 -0
- package/lib/v2/twitch/maintainer.js +5 -0
- package/lib/v2/twitch/radar.js +37 -0
- package/lib/v2/twitch/router.js +5 -0
- package/lib/v2/twitch/schedule.js +75 -0
- package/lib/v2/twitch/video.js +64 -0
- package/lib/v2/twitter/keyword.js +1 -3
- package/lib/v2/twitter/media.js +1 -5
- package/lib/v2/twitter/user.js +1 -3
- package/lib/v2/twitter/utils.js +5 -3
- package/lib/v2/twitter/web-api/constants.js +80 -68
- package/lib/v2/twitter/web-api/twitter-api.js +96 -103
- package/lib/v2/udn/breaking-news.js +6 -2
- package/lib/v2/uniqlo/maintainer.js +3 -0
- package/lib/v2/uniqlo/new.js +62 -0
- package/lib/v2/uniqlo/radar.js +12 -0
- package/lib/v2/uniqlo/router.js +3 -0
- package/lib/v2/v1tx/maintainer.js +0 -1
- package/lib/v2/weekendhk/maintainer.js +0 -1
- package/lib/v2/weibo/maintainer.js +1 -1
- package/lib/v2/weibo/oasis/user.js +4 -3
- package/lib/v2/weibo/radar.js +1 -1
- package/lib/v2/weibo/router.js +1 -1
- package/lib/v2/weibo/search/hot.js +118 -7
- package/lib/v2/weibo/search/template/digest.art +17 -0
- package/lib/v2/whu/hyxt.js +50 -0
- package/lib/v2/whu/maintainer.js +2 -1
- package/lib/v2/whu/news.js +48 -80
- package/lib/v2/whu/radar.js +252 -4
- package/lib/v2/whu/router.js +2 -1
- package/lib/v2/whu/templates/description.art +39 -0
- package/lib/v2/whu/util.js +148 -0
- package/lib/v2/x-mol/maintainer.js +4 -0
- package/lib/v2/x-mol/news.js +63 -0
- package/lib/v2/x-mol/paper.js +73 -0
- package/lib/v2/x-mol/radar.js +25 -0
- package/lib/v2/x-mol/router.js +4 -0
- package/lib/v2/x-mol/templates/description.art +6 -0
- package/lib/v2/x-mol/utils.js +3 -0
- package/lib/v2/xiaohongshu/user.js +33 -9
- package/lib/v2/xiaohongshu/util.js +26 -20
- package/lib/v2/xmnn/docs.js +0 -0
- package/lib/v2/xmnn/maintainer.js +1 -0
- package/lib/v2/xmnn/news.js +65 -0
- package/lib/v2/xmnn/radar.js +67 -1
- package/lib/v2/xmnn/router.js +1 -0
- package/lib/v2/yomujp/level.js +101 -0
- package/lib/v2/yomujp/maintainer.js +3 -0
- package/lib/v2/yomujp/radar.js +13 -0
- package/lib/v2/yomujp/router.js +3 -0
- package/lib/v2/yuque/utils.js +1 -0
- package/lib/v2/zcool/maintainer.js +1 -1
- package/lib/v2/zhubai/radar.js +2 -1
- package/lib/v2/zhubai/templates/description.art +41 -13
- package/lib/v2/zhubai/top20.js +31 -22
- package/lib/{routes → v2}/zimuxia/index.js +16 -8
- package/lib/v2/zimuxia/maintainer.js +4 -0
- package/lib/v2/zimuxia/portfolio.js +52 -0
- package/lib/v2/zimuxia/radar.js +19 -0
- package/lib/v2/zimuxia/router.js +4 -0
- package/lib/v2/zjuvag/blog.js +33 -0
- package/lib/v2/zjuvag/maintainer.js +3 -0
- package/lib/v2/zjuvag/radar.js +11 -0
- package/lib/v2/zjuvag/router.js +3 -0
- package/lib/views/rss3-ums.js +62 -0
- package/package.json +60 -60
- package/lib/routes/abc/documentId.js +0 -7272
- package/lib/routes/abc/id.js +0 -7272
- package/lib/routes/abc/index.js +0 -74
- package/lib/routes/blogs/paulgraham.js +0 -46
- package/lib/routes/egsea/flash.js +0 -40
- package/lib/routes/getitfree/category.js +0 -59
- package/lib/routes/getitfree/search.js +0 -25
- package/lib/routes/getitfree/utils.js +0 -47
- package/lib/routes/gov/moa/sjzxfb.js +0 -20
- package/lib/routes/growincity/news.js +0 -49
- package/lib/routes/grubstreet/utils.js +0 -78
- package/lib/routes/liquipedia/dota2_matches.js +0 -50
- package/lib/routes/mittrchina/index.js +0 -45
- package/lib/routes/npc/index.js +0 -42
- package/lib/routes/uniqlo/stylingbook.js +0 -24
- package/lib/routes/universities/buaa/news/index.js +0 -66
- package/lib/routes/universities/buaa/utils.js +0 -57
- package/lib/routes/x-mol/news.js +0 -48
- package/lib/routes/x-mol/paper.js +0 -78
- package/lib/routes/x-mol/utils.js +0 -16
- package/lib/routes/zimuxia/portfolio.js +0 -39
- package/lib/v2/chinafactcheck/templates/description.art +0 -1
- package/lib/v2/firefox/index.js +0 -74
- package/lib/v2/gocn/util.js +0 -17
- package/lib/v2/gov/zhengce/zuixin.js +0 -39
- package/lib/v2/nbd/article.js +0 -50
- package/lib/v2/reuters/migration_prompt.js +0 -3
- package/lib/v2/twitter/web-api/twitter-got.js +0 -113
- /package/lib/{routes → v2}/gov/moa/moa.js +0 -0
- /package/lib/{routes → v2}/grubstreet/index.js +0 -0
- /package/lib/{routes → v2}/metacritic/release.js +0 -0
|
@@ -5,8 +5,25 @@ module.exports = {
|
|
|
5
5
|
{
|
|
6
6
|
title: '分类',
|
|
7
7
|
docs: 'https://docs.rsshub.app/routes/shopping#zheng-ban-zhong-guo-fen-lei',
|
|
8
|
-
source: ['/category/:
|
|
9
|
-
target: '/getitfree/:
|
|
8
|
+
source: ['/category/:id'],
|
|
9
|
+
target: '/getitfree/category/:id',
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
title: '标签',
|
|
13
|
+
docs: 'https://docs.rsshub.app/routes/shopping#zheng-ban-zhong-guo-biao-qian',
|
|
14
|
+
source: ['/tag/:id'],
|
|
15
|
+
target: '/getitfree/tag/:id',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
title: '搜索',
|
|
19
|
+
docs: 'https://docs.rsshub.app/routes/shopping#zheng-ban-zhong-guo-sou-suo',
|
|
20
|
+
source: ['/'],
|
|
21
|
+
target: (_, url) => {
|
|
22
|
+
url = new URL(url);
|
|
23
|
+
const keyword = url.searchParams.get('s');
|
|
24
|
+
|
|
25
|
+
return `/getitfree/search${keyword ? `/${keyword}` : ''}`;
|
|
26
|
+
},
|
|
10
27
|
},
|
|
11
28
|
],
|
|
12
29
|
},
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
-
module.exports =
|
|
2
|
-
router.get('/:
|
|
1
|
+
module.exports = (router) => {
|
|
2
|
+
router.get('/:filter*', (ctx) => {
|
|
3
|
+
const { filter } = ctx.params;
|
|
4
|
+
|
|
5
|
+
if (filter && !filter.includes('/') && !filter.includes(',')) {
|
|
6
|
+
ctx.redirect(`/getitfree/category/${filter}`);
|
|
7
|
+
} else {
|
|
8
|
+
return require('./')(ctx);
|
|
9
|
+
}
|
|
10
|
+
});
|
|
3
11
|
};
|
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
|
|
4
|
+
const rootUrl = 'https://getitfree.cn';
|
|
5
|
+
const apiSlug = 'wp-json/wp/v2';
|
|
6
|
+
|
|
7
|
+
const filterKeys = {
|
|
8
|
+
search: 's',
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const filterApiKeys = {
|
|
12
|
+
category: 'categories',
|
|
13
|
+
tag: 'tags',
|
|
14
|
+
search: undefined,
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const filterApiKeysWithNoId = ['search'];
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Bake filter search parameters.
|
|
21
|
+
*
|
|
22
|
+
* @param {Object} filterPairs - The filter pairs object.
|
|
23
|
+
* e.g. `{ category: [ { id: ..., name: ..., slug: ... }, { id: ..., name: ..., slug: ... } ], tag: [ { id: ..., name: ..., slug: ... } ] }`.
|
|
24
|
+
* @param {string} pairKey - The filter pair key.
|
|
25
|
+
* e.g. `{ id: ..., name: ..., slug: ... }`.
|
|
26
|
+
* @param {boolean} [isApi=false] - IIndicates if the search parameters are for API.
|
|
27
|
+
* @returns {URLSearchParams} The baked filter search parameters.
|
|
28
|
+
*/
|
|
29
|
+
const bakeFilterSearchParams = (filterPairs, pairKey, isApi = false) => {
|
|
30
|
+
/**
|
|
31
|
+
* Bake filters recursively.
|
|
32
|
+
*
|
|
33
|
+
* @param {Object} filterPairs - The filter pairs object.
|
|
34
|
+
* e.g. `{ category: [ { id: ..., name: ..., slug: ... }, { id: ..., name: ..., slug: ... } ], tag: [ { id: ..., name: ..., slug: ... } ] }`.
|
|
35
|
+
* @param {URLSearchParams} filterSearchParams - The filter search parameters.
|
|
36
|
+
* e.g. `category=a,b&tag=c`.
|
|
37
|
+
* @returns {URLSearchParams} The baked filter search parameters.
|
|
38
|
+
* e.g. `category=a,b&tag=c`.
|
|
39
|
+
*/
|
|
40
|
+
const bakeFilters = (filterPairs, filterSearchParams) => {
|
|
41
|
+
const keys = Object.keys(filterPairs).filter((key) => filterPairs[key]?.length > 0 && (isApi ? filterApiKeys.hasOwnProperty(key) : filterKeys.hasOwnProperty(key)));
|
|
42
|
+
|
|
43
|
+
if (keys.length === 0) {
|
|
44
|
+
return filterSearchParams;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const key = keys[0];
|
|
48
|
+
const pairs = filterPairs[key];
|
|
49
|
+
|
|
50
|
+
const originalFilters = Object.assign({}, filterPairs);
|
|
51
|
+
delete originalFilters[key];
|
|
52
|
+
|
|
53
|
+
filterSearchParams.append(getFilterKeyForSearchParams(key, isApi), pairs.map((pair) => (pair.hasOwnProperty(pairKey) ? pair[pairKey] : pair)).join(','));
|
|
54
|
+
|
|
55
|
+
return bakeFilters(originalFilters, filterSearchParams);
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
return bakeFilters(filterPairs, new URLSearchParams());
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Bake filters with pair.
|
|
63
|
+
*
|
|
64
|
+
* @param {Object} filters - The filters object.
|
|
65
|
+
* e.g. `{ category: [ a, b ], tag: [ c ] }`.
|
|
66
|
+
* @returns {Promise<Object>} The baked filters.
|
|
67
|
+
* e.g. `{ category: [ { id: ..., name: ..., slug: ... }, { id: ..., name: ..., slug: ... } ], tag: [ { id: ..., name: ..., slug: ... } ] }`.
|
|
68
|
+
*/
|
|
69
|
+
const bakeFiltersWithPair = async (filters) => {
|
|
70
|
+
/**
|
|
71
|
+
* Bake keywords recursively.
|
|
72
|
+
*
|
|
73
|
+
* @param {string} key - The key.
|
|
74
|
+
* e.g. `category` or `tag`.
|
|
75
|
+
* @param {Array<string>} keywords - The keywords.
|
|
76
|
+
* e.g. `[ a, b ]`.
|
|
77
|
+
* @returns {Promise<Array<Object>>} The baked keywords.
|
|
78
|
+
* e.g. `[ { id: ..., name: ..., slug: ... }, { id: ..., name: ..., slug: ... } ]`.
|
|
79
|
+
*/
|
|
80
|
+
const bakeKeywords = async (key, keywords) => {
|
|
81
|
+
if (keywords.length === 0) {
|
|
82
|
+
return [];
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const [keyword, ...rest] = keywords;
|
|
86
|
+
|
|
87
|
+
const filter = await getFilterByKeyAndKeyword(key, keyword);
|
|
88
|
+
|
|
89
|
+
return [
|
|
90
|
+
...(filter?.id && filter?.slug
|
|
91
|
+
? [
|
|
92
|
+
{
|
|
93
|
+
id: filter.id,
|
|
94
|
+
name: filter.name,
|
|
95
|
+
slug: filter.slug,
|
|
96
|
+
},
|
|
97
|
+
]
|
|
98
|
+
: []),
|
|
99
|
+
...(await bakeKeywords(key, rest)),
|
|
100
|
+
];
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Bake filters recursively.
|
|
105
|
+
*
|
|
106
|
+
* @param {Object} filters - The filters object.
|
|
107
|
+
* e.g. `{ category: [ a, b ], tag: [ c ] }`.
|
|
108
|
+
* @param {Object} filtersWithPair - The filters with pairs.
|
|
109
|
+
* e.g. `{ category: [ { id: ..., name: ..., slug: ... }, { id: ..., name: ..., slug: ... } ], tag: [ { id: ..., name: ..., slug: ... } ] }`.
|
|
110
|
+
* @returns {Promise<Object>} The baked filters.
|
|
111
|
+
* e.g. `{ category: [ { id: ..., name: ..., slug: ... }, { id: ..., name: ..., slug: ... } ], tag: [ { id: ..., name: ..., slug: ... } ] }`.
|
|
112
|
+
*/
|
|
113
|
+
const bakeFilters = async (filters, filtersWithPair) => {
|
|
114
|
+
const keys = Object.keys(filters);
|
|
115
|
+
|
|
116
|
+
if (keys.length === 0) {
|
|
117
|
+
return filtersWithPair;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const key = keys[0];
|
|
121
|
+
const keywords = filters[key];
|
|
122
|
+
|
|
123
|
+
const originalFilters = Object.assign({}, filters);
|
|
124
|
+
delete originalFilters[key];
|
|
125
|
+
|
|
126
|
+
return bakeFilters(originalFilters, {
|
|
127
|
+
...filtersWithPair,
|
|
128
|
+
[key]: filterApiKeysWithNoId.includes(key) ? keywords : await bakeKeywords(key, keywords),
|
|
129
|
+
});
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
return await bakeFilters(filters, {});
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Bake URL with search parameters.
|
|
137
|
+
*
|
|
138
|
+
* @param {string} url - The URL.
|
|
139
|
+
* @param {string} rootUrl - The root URL.
|
|
140
|
+
* @param {URLSearchParams} [searchParams=new URLSearchParams()] - The search parameters.
|
|
141
|
+
* @returns {string} The baked URL.
|
|
142
|
+
*/
|
|
143
|
+
const bakeUrl = (url, rootUrl, searchParams = new URLSearchParams()) => {
|
|
144
|
+
const searchParamsStr = String(searchParams) ? `?${searchParams}` : '';
|
|
145
|
+
|
|
146
|
+
return new URL(`${url}${searchParamsStr}`, rootUrl).href;
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Fetch data from the specified URL.
|
|
151
|
+
*
|
|
152
|
+
* @param {string} url - The URL to fetch data from.
|
|
153
|
+
* @returns {Promise<Object>} A promise that resolves to an object containing the fetched data
|
|
154
|
+
* to be added into `ctx.state.data`.
|
|
155
|
+
*/
|
|
156
|
+
const fetchData = async (url) => {
|
|
157
|
+
/**
|
|
158
|
+
* Request URLs recursively.
|
|
159
|
+
*
|
|
160
|
+
* @param {Array<string>} urls - The URLs to request.
|
|
161
|
+
* @returns {Promise<undefined|Object>} A promise that resolves to the response data
|
|
162
|
+
* or undefined if no response is available.
|
|
163
|
+
*/
|
|
164
|
+
const requestUrls = async (urls) => {
|
|
165
|
+
if (urls.length === 0) {
|
|
166
|
+
return undefined;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
const [currentUrl, ...remainingUrls] = urls;
|
|
170
|
+
try {
|
|
171
|
+
const { data: response } = await got(currentUrl);
|
|
172
|
+
return response;
|
|
173
|
+
} catch (e) {
|
|
174
|
+
return requestUrls(remainingUrls);
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
const response = await requestUrls([url, rootUrl]);
|
|
179
|
+
|
|
180
|
+
if (!response) {
|
|
181
|
+
return {};
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
const $ = cheerio.load(response);
|
|
185
|
+
|
|
186
|
+
const title = $('title').text().split(/\|/)[0];
|
|
187
|
+
const image = new URL('wp-content/uploads/site_logo.png', rootUrl).href;
|
|
188
|
+
const icon = new URL($('link[rel="shortcut icon"]').prop('href'), rootUrl).href;
|
|
189
|
+
|
|
190
|
+
return {
|
|
191
|
+
title,
|
|
192
|
+
link: url,
|
|
193
|
+
description: $('meta[name="description"]').prop('content'),
|
|
194
|
+
language: $('html').prop('lang'),
|
|
195
|
+
image,
|
|
196
|
+
icon,
|
|
197
|
+
logo: icon,
|
|
198
|
+
subtitle: title.split(/【/)[0],
|
|
199
|
+
author: $('h1.logo a').prop('title'),
|
|
200
|
+
allowEmpty: true,
|
|
201
|
+
};
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Get filter by key and keyword.
|
|
206
|
+
*
|
|
207
|
+
* @param {string} key - The key.
|
|
208
|
+
* e.g. `category` or `tag`.
|
|
209
|
+
* @param {string} keyword - The keywords.
|
|
210
|
+
* e.g. `keyword1`.
|
|
211
|
+
* @returns {Promise<Object|undefined>} A promise that resolves to the filter object if found,
|
|
212
|
+
* or undefined if not found.
|
|
213
|
+
*/
|
|
214
|
+
const getFilterByKeyAndKeyword = async (key, keyword) => {
|
|
215
|
+
const apiFilterUrl = new URL(`${apiSlug}/${getFilterKeyForSearchParams(key, true)}`, rootUrl).href;
|
|
216
|
+
|
|
217
|
+
const { data: response } = await got(apiFilterUrl, {
|
|
218
|
+
searchParams: {
|
|
219
|
+
search: keyword,
|
|
220
|
+
},
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
return response.length > 0 ? response[0] : undefined;
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Get filter key for search parameters.
|
|
228
|
+
*
|
|
229
|
+
* @param {string} key - The key. e.g. `category` or `tag`.
|
|
230
|
+
* @param {boolean} [isApi=false] - Indicates whether the key is for the API.
|
|
231
|
+
* @returns {string|undefined} The filter key for search parameters, or undefined if not found.
|
|
232
|
+
* e.g. `categories` or `tags`.
|
|
233
|
+
*/
|
|
234
|
+
const getFilterKeyForSearchParams = (key, isApi = false) => {
|
|
235
|
+
const keys = isApi ? filterApiKeys : filterKeys;
|
|
236
|
+
|
|
237
|
+
return keys.hasOwnProperty(key) ? keys[key] ?? key : undefined;
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Get filter names for titles.
|
|
242
|
+
*
|
|
243
|
+
* @param {Object} filterPairs - The filter pairs object.
|
|
244
|
+
* e.g. `{ category: [ { id: ..., name: ..., slug: ... }, { id: ..., name: ..., slug: ... } ], tag: [ { id: ..., name: ..., slug: ... } ] }`.
|
|
245
|
+
* @returns {string} A string containing the joined filter names for titles.
|
|
246
|
+
* e.g. `name1,name2`.
|
|
247
|
+
*/
|
|
248
|
+
const getFilterNameForTitle = (filterPairs) =>
|
|
249
|
+
Object.values(filterPairs)
|
|
250
|
+
.flat()
|
|
251
|
+
.map((pair) => pair?.name ?? pair?.slug ?? pair)
|
|
252
|
+
.filter((name) => name)
|
|
253
|
+
.join(',');
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Get filter parameters for URL.
|
|
257
|
+
*
|
|
258
|
+
* @param {Object} filterPairs - The filter pairs object.
|
|
259
|
+
* e.g. `{ category: [ { id: ..., name: ..., slug: ... }, { id: ..., name: ..., slug: ... } ], tag: [ { id: ..., name: ..., slug: ... } ] }`.
|
|
260
|
+
* @returns {string|undefined} The filter parameters for the URL, or undefined if no filters are available.
|
|
261
|
+
*/
|
|
262
|
+
const getFilterParamsForUrl = (filterPairs) => {
|
|
263
|
+
const keys = Object.keys(filterPairs).filter((key) => filterPairs[key]);
|
|
264
|
+
|
|
265
|
+
if (keys.length === 0) {
|
|
266
|
+
return undefined;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
const key = keys[0];
|
|
270
|
+
|
|
271
|
+
return `${key}/${filterPairs[key].map((pair) => pair.slug).join('/')}`;
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* Parse filter string into filters object.
|
|
276
|
+
*
|
|
277
|
+
* @param {string} filterStr - The filter string to parse.
|
|
278
|
+
* e.g. `category/a,b/tag/c`.
|
|
279
|
+
* @returns {Object} The parsed filters object.
|
|
280
|
+
* e.g. `{ category: [ a, b ], tag: [ c ] }`.
|
|
281
|
+
*/
|
|
282
|
+
const parseFilterStr = (filterStr) => {
|
|
283
|
+
/**
|
|
284
|
+
* Parse filter string recursively.
|
|
285
|
+
*
|
|
286
|
+
* @param {string} filterStr - The remaining filter string to parse.
|
|
287
|
+
* e.g. `category/a,b/tag/c`.
|
|
288
|
+
* @param {Object} filters - The accumulated filters object.
|
|
289
|
+
* e.g. `{ category: [ a, b ], tag: [ c ] }`.
|
|
290
|
+
* @param {string} filterKey - The current filter key.
|
|
291
|
+
* e.g. `category` or `tag`.
|
|
292
|
+
* @returns {Object} The parsed filters object.
|
|
293
|
+
*/
|
|
294
|
+
const parseStr = (filterStr, filters = {}, filterKey = undefined) => {
|
|
295
|
+
if (!filterStr) {
|
|
296
|
+
return filters;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
const [word, ...rest] = filterStr.split(/\/|,/);
|
|
300
|
+
|
|
301
|
+
const isKey = filterApiKeys.hasOwnProperty(word);
|
|
302
|
+
const key = isKey ? word : filterKey;
|
|
303
|
+
|
|
304
|
+
const newFilters = {
|
|
305
|
+
...filters,
|
|
306
|
+
[key]: [...(filters[key] || []), ...(isKey ? [] : [word])],
|
|
307
|
+
};
|
|
308
|
+
|
|
309
|
+
return parseStr(rest.join('/'), newFilters, key);
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
return parseStr(filterStr, {});
|
|
313
|
+
};
|
|
314
|
+
|
|
315
|
+
module.exports = {
|
|
316
|
+
apiSlug,
|
|
317
|
+
rootUrl,
|
|
318
|
+
|
|
319
|
+
bakeFilterSearchParams,
|
|
320
|
+
bakeFiltersWithPair,
|
|
321
|
+
bakeUrl,
|
|
322
|
+
fetchData,
|
|
323
|
+
getFilterNameForTitle,
|
|
324
|
+
getFilterParamsForUrl,
|
|
325
|
+
parseFilterStr,
|
|
326
|
+
};
|
package/lib/v2/github/topic.js
CHANGED
|
@@ -1,25 +1,41 @@
|
|
|
1
1
|
const cheerio = require('cheerio');
|
|
2
2
|
const got = require('@/utils/got');
|
|
3
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
3
4
|
|
|
4
5
|
module.exports = async (ctx) => {
|
|
5
|
-
const link = `https://github.com/topics/${ctx.params.name}
|
|
6
|
-
const { data } = await got(link
|
|
6
|
+
const link = `https://github.com/topics/${ctx.params.name}`;
|
|
7
|
+
const { data, url } = await got(link, {
|
|
8
|
+
searchParams: new URLSearchParams(ctx.params.qs),
|
|
9
|
+
});
|
|
7
10
|
const $ = cheerio.load(data);
|
|
8
11
|
|
|
9
12
|
ctx.state.data = {
|
|
10
13
|
title: $('title').text(),
|
|
11
|
-
|
|
14
|
+
description: $('.markdown-body').text().trim(),
|
|
15
|
+
link: url,
|
|
12
16
|
item: $('article.my-4')
|
|
13
|
-
.
|
|
17
|
+
.toArray()
|
|
18
|
+
.map((item) => {
|
|
14
19
|
item = $(item);
|
|
15
20
|
|
|
16
|
-
const title =
|
|
21
|
+
const title = item.find('h3').text().trim();
|
|
17
22
|
const author = title.split('/')[0];
|
|
18
|
-
const description = item.find('
|
|
19
|
-
const link = `https://github.com
|
|
23
|
+
const description = (item.find('a img').prop('outerHTML') ?? '') + item.find('div > div > p').text();
|
|
24
|
+
const link = `https://github.com${item.find('h3 a').last().attr('href')}`;
|
|
25
|
+
const category = item
|
|
26
|
+
.find('.topic-tag')
|
|
27
|
+
.toArray()
|
|
28
|
+
.map((item) => $(item).text().trim());
|
|
29
|
+
const pubDate = parseDate(item.find('relative-time').attr('datetime'));
|
|
20
30
|
|
|
21
|
-
return {
|
|
22
|
-
|
|
23
|
-
|
|
31
|
+
return {
|
|
32
|
+
title,
|
|
33
|
+
author,
|
|
34
|
+
description,
|
|
35
|
+
link,
|
|
36
|
+
category,
|
|
37
|
+
pubDate,
|
|
38
|
+
};
|
|
39
|
+
}),
|
|
24
40
|
};
|
|
25
41
|
};
|
package/lib/v2/gocn/jobs.js
CHANGED
|
@@ -1,23 +1,28 @@
|
|
|
1
1
|
const got = require('@/utils/got');
|
|
2
|
-
const
|
|
2
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
3
|
+
const { renderHTML } = require('./utils');
|
|
3
4
|
|
|
4
5
|
module.exports = async (ctx) => {
|
|
5
|
-
const
|
|
6
|
-
const
|
|
6
|
+
const api_url = 'https://gocn.vip/api/files?spaceGuid=Gd7OHl¤tPage=1&sort=1';
|
|
7
|
+
const base_url = 'https://gocn.vip/c/3lQ6GbD5ny/s/Gd7OHl';
|
|
8
|
+
const job_url = 'https://gocn.vip/c/3lQ6GbD5ny';
|
|
7
9
|
|
|
8
10
|
const response = await got({
|
|
9
11
|
url: api_url,
|
|
10
|
-
headers: {
|
|
11
|
-
Referer: base_url,
|
|
12
|
-
},
|
|
13
12
|
});
|
|
14
13
|
|
|
15
|
-
const
|
|
14
|
+
const items = response.data.data.list.map((item) => ({
|
|
15
|
+
title: item.name,
|
|
16
|
+
link: `${job_url}/s/${item.spaceGuid}/d/${item.guid}`,
|
|
17
|
+
description: renderHTML(JSON.parse(item.content)),
|
|
18
|
+
pubDate: parseDate(item.ctime, 'X'),
|
|
19
|
+
author: item.nickname,
|
|
20
|
+
}));
|
|
16
21
|
|
|
17
22
|
ctx.state.data = {
|
|
18
23
|
title: `GoCN社区-招聘`,
|
|
19
24
|
link: base_url,
|
|
20
|
-
description: `获取GoCN
|
|
21
|
-
item:
|
|
25
|
+
description: `获取GoCN站点招聘`,
|
|
26
|
+
item: items,
|
|
22
27
|
};
|
|
23
28
|
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
3
|
+
const { renderHTML } = require('./utils');
|
|
4
|
+
|
|
5
|
+
module.exports = async (ctx) => {
|
|
6
|
+
const base_url = 'https://gocn.vip/c/3lQ6GbD5ny/home';
|
|
7
|
+
const article_url = 'https://gocn.vip/c/3lQ6GbD5ny';
|
|
8
|
+
const api_url = 'https://gocn.vip/api/home/page';
|
|
9
|
+
|
|
10
|
+
const response = await got({
|
|
11
|
+
url: api_url,
|
|
12
|
+
headers: {
|
|
13
|
+
Referer: base_url,
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const items = response.data.data.articlePageList.list.map((item) => ({
|
|
18
|
+
title: item.name,
|
|
19
|
+
link: `${article_url}/s/${item.spaceGuid}/d/${item.guid}`,
|
|
20
|
+
description: renderHTML(JSON.parse(item.content)),
|
|
21
|
+
pubDate: parseDate(item.ctime, 'X'),
|
|
22
|
+
author: item.nickname,
|
|
23
|
+
}));
|
|
24
|
+
|
|
25
|
+
ctx.state.data = {
|
|
26
|
+
title: `GoCN社区-最新动态`,
|
|
27
|
+
link: base_url,
|
|
28
|
+
description: `获取GoCN站点最新动态`,
|
|
29
|
+
item: items,
|
|
30
|
+
};
|
|
31
|
+
};
|
package/lib/v2/gocn/radar.js
CHANGED
|
@@ -3,10 +3,16 @@ module.exports = {
|
|
|
3
3
|
_name: 'GoCN',
|
|
4
4
|
'.': [
|
|
5
5
|
{
|
|
6
|
-
title: '
|
|
6
|
+
title: '最新动态',
|
|
7
7
|
docs: 'https://docs.rsshub.app/routes/programming#GoCN',
|
|
8
8
|
source: ['/'],
|
|
9
|
-
target: '/gocn',
|
|
9
|
+
target: '/gocn/news',
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
title: '每日新闻',
|
|
13
|
+
docs: 'https://docs.rsshub.app/routes/programming#GoCN',
|
|
14
|
+
source: ['/'],
|
|
15
|
+
target: '/gocn/topics',
|
|
10
16
|
},
|
|
11
17
|
{
|
|
12
18
|
title: '招聘',
|
package/lib/v2/gocn/router.js
CHANGED
package/lib/v2/gocn/topics.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
const got = require('@/utils/got');
|
|
2
|
-
const
|
|
2
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
3
|
+
const { renderHTML } = require('./utils');
|
|
3
4
|
|
|
4
5
|
module.exports = async (ctx) => {
|
|
5
|
-
const base_url = 'https://gocn.vip/
|
|
6
|
-
const
|
|
6
|
+
const base_url = 'https://gocn.vip/c/3lQ6GbD5ny/home';
|
|
7
|
+
const article_url = 'https://gocn.vip/c/3lQ6GbD5ny';
|
|
8
|
+
const api_url = 'https://gocn.vip/api/files?spaceGuid=Gd7BTB¤tPage=1&sort=1';
|
|
7
9
|
|
|
8
10
|
const response = await got({
|
|
9
11
|
url: api_url,
|
|
@@ -12,12 +14,18 @@ module.exports = async (ctx) => {
|
|
|
12
14
|
},
|
|
13
15
|
});
|
|
14
16
|
|
|
15
|
-
const
|
|
17
|
+
const items = response.data.data.list.map((item) => ({
|
|
18
|
+
title: item.name,
|
|
19
|
+
link: `${article_url}/s/${item.spaceGuid}/d/${item.guid}`,
|
|
20
|
+
description: renderHTML(JSON.parse(item.content)),
|
|
21
|
+
pubDate: parseDate(item.ctime, 'X'),
|
|
22
|
+
author: item.nickname,
|
|
23
|
+
}));
|
|
16
24
|
|
|
17
25
|
ctx.state.data = {
|
|
18
|
-
title: `GoCN
|
|
26
|
+
title: `GoCN社区-每日新闻`,
|
|
19
27
|
link: base_url,
|
|
20
|
-
description: `获取GoCN
|
|
21
|
-
item:
|
|
28
|
+
description: `获取GoCN站点每日新闻`,
|
|
29
|
+
item: items,
|
|
22
30
|
};
|
|
23
31
|
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
const elementMap = {
|
|
2
|
+
code_block: (element) => `<pre><code class="${element.language}">${element.children[0].text}</code></pre>`,
|
|
3
|
+
a: (element) => `<a href="${element.url}">${renderHTML(element.children)}</a>`,
|
|
4
|
+
blockquote: (element) => `<blockquote>${renderHTML(element.children)}</blockquote>`,
|
|
5
|
+
br: () => '<br>',
|
|
6
|
+
h1: (element) => `<h1>${element.children[0].text}</h1>`,
|
|
7
|
+
h2: (element) => `<h2>${element.children[0].text}</h2>`,
|
|
8
|
+
h3: (element) => `<h3>${element.children[0].text}</h3>`,
|
|
9
|
+
h4: (element) => `<h4>${element.children[0].text}</h4>`,
|
|
10
|
+
h5: (element) => `<h5>${element.children[0].text}</h5>`,
|
|
11
|
+
h6: (element) => `<h6>${element.children[0].text}</h6>`,
|
|
12
|
+
img: (element) => `<img src="${element.url}">`,
|
|
13
|
+
p: (element) => `<p>${renderHTML(element.children)}</p>`,
|
|
14
|
+
strong: (element) => `<strong>${renderHTML(element.children)}</strong>`,
|
|
15
|
+
ol: (element) => `<ol>${renderHTML(element.children)}</ol>`,
|
|
16
|
+
ul: (element) => `<ul>${renderHTML(element.children)}</ul>`,
|
|
17
|
+
li: (element) => `<li>${renderHTML(element.children)}</li>`,
|
|
18
|
+
lic: (element) => element.children[0].text,
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
function renderHTML(json) {
|
|
22
|
+
return json
|
|
23
|
+
.map((element) => {
|
|
24
|
+
const handler = elementMap[element.type];
|
|
25
|
+
if (handler) {
|
|
26
|
+
return handler(element);
|
|
27
|
+
} else if (element.hasOwnProperty('text')) {
|
|
28
|
+
return element.text;
|
|
29
|
+
} else {
|
|
30
|
+
throw new Error(`Unknown handled type: ${element.type}, ${JSON.stringify(element)}`);
|
|
31
|
+
}
|
|
32
|
+
})
|
|
33
|
+
.join('');
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
module.exports = {
|
|
37
|
+
renderHTML,
|
|
38
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
|
|
4
|
+
module.exports = async (ctx) => {
|
|
5
|
+
const { keyword } = ctx.params;
|
|
6
|
+
|
|
7
|
+
const { data: response, url: link } = await got('https://www.google.com/alerts/preview', {
|
|
8
|
+
searchParams: {
|
|
9
|
+
params: `[null,[null,null,null,[null,"${keyword}","com",[null,"en","US"],null,null,null,0,0],null,3,[[null,1,"user@example.com",[null,null,20],2,"en-US",null,null,null,null,null,"0",null,null,"AB2Xq4hcilCERh73EFWJVHXx-io2lhh1EhC8UD8"]]],0]`,
|
|
10
|
+
},
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
const $ = cheerio.load(response, null, false);
|
|
14
|
+
|
|
15
|
+
const items = $('li.result')
|
|
16
|
+
.toArray()
|
|
17
|
+
.map((item) => {
|
|
18
|
+
item = $(item);
|
|
19
|
+
const title = item.find('.result_title a');
|
|
20
|
+
return {
|
|
21
|
+
title: title.text(),
|
|
22
|
+
link: new URL(title.attr('href')).searchParams.get('url'),
|
|
23
|
+
author: item.find('.result_source').text(),
|
|
24
|
+
description: item.find('.snippet').html(),
|
|
25
|
+
};
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
ctx.state.data = {
|
|
29
|
+
title: `Google Alerts - ${keyword}`,
|
|
30
|
+
link,
|
|
31
|
+
item: items,
|
|
32
|
+
};
|
|
33
|
+
};
|