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
package/lib/v2/google/router.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
module.exports = function (router) {
|
|
2
2
|
router.get('/album/:id', require('./album'));
|
|
3
|
+
router.get('/alerts/:keyword', require('./alerts'));
|
|
3
4
|
router.get('/citations/:id', require('./citations'));
|
|
4
5
|
router.get('/doodles/:language?', require('./doodles'));
|
|
5
6
|
router.get('/fonts/:sort?', require('./fonts'));
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
4
|
+
const { art } = require('@/utils/render');
|
|
5
|
+
const path = require('path');
|
|
6
|
+
|
|
7
|
+
module.exports = async (ctx) => {
|
|
8
|
+
const { category = 'gjlckjdjt' } = ctx.params;
|
|
9
|
+
const limit = ctx.query.limit ? parseInt(ctx.query.limit, 10) : 30;
|
|
10
|
+
|
|
11
|
+
const rootUrl = 'http://www.forestry.gov.cn';
|
|
12
|
+
const currentUrl = new URL(`${category}.jhtml`, rootUrl).href;
|
|
13
|
+
|
|
14
|
+
const { data: response } = await got(currentUrl);
|
|
15
|
+
|
|
16
|
+
const $ = cheerio.load(response);
|
|
17
|
+
|
|
18
|
+
let items = $('a.items')
|
|
19
|
+
.slice(0, limit)
|
|
20
|
+
.toArray()
|
|
21
|
+
.map((item) => {
|
|
22
|
+
item = $(item);
|
|
23
|
+
|
|
24
|
+
const title = item.find('p.name').text();
|
|
25
|
+
const link = new URL(item.prop('href'), rootUrl).href;
|
|
26
|
+
const pubDateMatches = link.match(/\/\d{8}\//);
|
|
27
|
+
|
|
28
|
+
return {
|
|
29
|
+
title,
|
|
30
|
+
link,
|
|
31
|
+
description: art(path.join(__dirname, 'templates/description.art'), {
|
|
32
|
+
image: {
|
|
33
|
+
src: item.find('img').prop('src'),
|
|
34
|
+
alt: title,
|
|
35
|
+
},
|
|
36
|
+
}),
|
|
37
|
+
pubDate: pubDateMatches ? parseDate(pubDateMatches[1]) : undefined,
|
|
38
|
+
};
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
items = await Promise.all(
|
|
42
|
+
items.map((item) =>
|
|
43
|
+
ctx.cache.tryGet(item.link, async () => {
|
|
44
|
+
const { data: detailResponse } = await got(item.link);
|
|
45
|
+
|
|
46
|
+
const content = cheerio.load(detailResponse);
|
|
47
|
+
|
|
48
|
+
content('p').each((_, e) => {
|
|
49
|
+
e = content(e);
|
|
50
|
+
if (e.find('img, video, embed.edui-faked-video').length === 0 && e.text().match(/^\s*$/)) {
|
|
51
|
+
e.remove();
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
content('video, embed.edui-faked-video').each((_, e) => {
|
|
56
|
+
e = content(e);
|
|
57
|
+
|
|
58
|
+
const src = e.prop('src');
|
|
59
|
+
item.enclosure_url = item.enclosure_url ?? src;
|
|
60
|
+
|
|
61
|
+
e.replaceWith(
|
|
62
|
+
art(path.join(__dirname, 'templates/description.art'), {
|
|
63
|
+
video: {
|
|
64
|
+
src,
|
|
65
|
+
},
|
|
66
|
+
})
|
|
67
|
+
);
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
const pubDateMatches = item.link.match(/\/\d{8}\//);
|
|
71
|
+
|
|
72
|
+
item.title = content('div.tit').text();
|
|
73
|
+
item.description += content('div.zhengwen').html();
|
|
74
|
+
item.pubDate = pubDateMatches ? parseDate(pubDateMatches[1]) : undefined;
|
|
75
|
+
item.enclosure_type = item.enclosure_url ? 'video/mp4' : undefined;
|
|
76
|
+
|
|
77
|
+
return item;
|
|
78
|
+
})
|
|
79
|
+
)
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
const icon = new URL('favicon.ico', rootUrl).href;
|
|
83
|
+
|
|
84
|
+
ctx.state.data = {
|
|
85
|
+
item: items,
|
|
86
|
+
title: $('title').text(),
|
|
87
|
+
link: currentUrl,
|
|
88
|
+
language: $('html').prop('lang'),
|
|
89
|
+
image: new URL('r/cms/www/default/zhuanti/2021djt/images/top.png', rootUrl).href,
|
|
90
|
+
icon,
|
|
91
|
+
logo: icon,
|
|
92
|
+
subtitle: $('div.weizhi').contents().last().text(),
|
|
93
|
+
author: '国家林业和草原局',
|
|
94
|
+
allowEmpty: true,
|
|
95
|
+
};
|
|
96
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{{ if image }}
|
|
2
|
+
<figure>
|
|
3
|
+
<img src="{{ image.src }}" alt="{{ image.alt }}">
|
|
4
|
+
</figure>
|
|
5
|
+
{{ /if }}
|
|
6
|
+
|
|
7
|
+
{{ if video }}
|
|
8
|
+
<video controls>
|
|
9
|
+
<source
|
|
10
|
+
src="{{ video.src }}">
|
|
11
|
+
<object data="{{ video.src }}">
|
|
12
|
+
<embed src="{{ video.src }}">
|
|
13
|
+
</object>
|
|
14
|
+
</video>
|
|
15
|
+
{{ /if }}
|
package/lib/v2/gov/maintainer.js
CHANGED
|
@@ -18,23 +18,29 @@ module.exports = {
|
|
|
18
18
|
'/csrc/news/:suffix*': ['chinobing', 'LogicJake'],
|
|
19
19
|
'/customs/list/:gchannel?': ['Jeason0228', 'TonyRL', 'he1q'],
|
|
20
20
|
'/fmprc/:category?': ['nicolaszf', 'nczitzk'],
|
|
21
|
+
'/forestry/gjlckjdjt/:category?': ['nczitzk'],
|
|
21
22
|
'/immiau/news': ['liu233w'],
|
|
22
23
|
'/jinan/healthcommission/medical_exam_notice': ['tzjyxb'],
|
|
23
|
-
'/mee/ywdt?': ['liuxsdev'],
|
|
24
|
+
'/mee/ywdt/:category?': ['liuxsdev'],
|
|
25
|
+
'/mem/gk/sgcc/:category?': ['nczitzk'],
|
|
24
26
|
'/mfa/wjdt/:category?': ['nczitzk'],
|
|
25
27
|
'/miit/wjfb/:ministry': ['Fatpandac'],
|
|
26
28
|
'/miit/yjzj': ['Fatpandac'],
|
|
27
29
|
'/miit/zcwj': ['Yoge-Code'],
|
|
28
30
|
'/miit/wjgs': ['Yoge-Code'],
|
|
29
31
|
'/miit/zcjd': ['Yoge-Code'],
|
|
32
|
+
'/moa/zdscxx/:channel?/:source?': ['MisteryMonster', 'nczitzk'],
|
|
33
|
+
'/moa/:suburl': ['Origami404'],
|
|
30
34
|
'/moe/:type': ['Crawler995'],
|
|
31
35
|
'/moe/s78/:column': ['TonyRL'],
|
|
32
36
|
'/mofcom/article/:suffix+': ['LogicJake'],
|
|
33
37
|
'/moj/aac/news/:type?': ['TonyRL'],
|
|
38
|
+
'/mot/:category?': ['nczitzk'],
|
|
34
39
|
'/news/:uid': ['EsuRt'],
|
|
35
|
-
'/nifdc/:path
|
|
40
|
+
'/nifdc/:path?': ['nczitzk'],
|
|
36
41
|
'/nmpa/:path+': ['TonyRL'],
|
|
37
42
|
'/nopss/:path+': ['nczitzk'],
|
|
43
|
+
'/npc/:caty': ['233yeee'],
|
|
38
44
|
'/nrta/news/:category?': ['yuxinliu-alex'],
|
|
39
45
|
'/nrta/dsj/:category?': ['nczitzk'],
|
|
40
46
|
'/nsfc/news/:type?': ['Derekmini', 'nczitzk'],
|
|
@@ -42,12 +48,14 @@ module.exports = {
|
|
|
42
48
|
'/pbc/gzlw': ['Fatpandac'],
|
|
43
49
|
'/pbc/tradeAnnouncement': ['nczitzk'],
|
|
44
50
|
'/pbc/zcyj': ['Fatpandac'],
|
|
51
|
+
'/samr/xgzlyhd/:category?/:department?': ['nczitzk'],
|
|
45
52
|
'/sasac/:path+': ['TonyRL'],
|
|
46
53
|
'/stats/:path+': ['bigfei', 'nczitzk'],
|
|
47
54
|
'/zhengce/govall/:advance?': ['ciaranchen'],
|
|
48
55
|
'/zhengce/wenjian/:pcodeJiguan?': ['ciaranchen'],
|
|
49
56
|
'/zhengce/zhengceku/:department': ['zxx-457'],
|
|
50
|
-
'/zhengce/zuixin': ['SettingDust'],
|
|
57
|
+
'/zhengce/zuixin': ['SettingDust', 'nczitzk'],
|
|
58
|
+
'/zhengce/:category?': ['nczitzk'],
|
|
51
59
|
// province
|
|
52
60
|
'/anhui/kjt/:path?': ['nczitzk'],
|
|
53
61
|
'/beijing/bphc/:channel': ['bigfei'],
|
|
@@ -86,4 +94,5 @@ module.exports = {
|
|
|
86
94
|
'/wuhan/sy/whyw': ['nczitzk'],
|
|
87
95
|
'/xinyi/:path+': ['ShuiHuo'],
|
|
88
96
|
'/xuzhou/hrss/:category?': ['nczitzk'],
|
|
97
|
+
'/zhejiang/gwy/:category?/:column?': ['nczitzk'],
|
|
89
98
|
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
4
|
+
|
|
5
|
+
module.exports = async (ctx) => {
|
|
6
|
+
const { category = 'sggpdbqk' } = ctx.params;
|
|
7
|
+
const limit = ctx.query.limit ? parseInt(ctx.query.limit, 10) : 30;
|
|
8
|
+
|
|
9
|
+
const rootUrl = 'https://www.mem.gov.cn';
|
|
10
|
+
const currentUrl = new URL(`gk/sgcc/${category}`, rootUrl).href;
|
|
11
|
+
|
|
12
|
+
const { data: response } = await got(currentUrl);
|
|
13
|
+
|
|
14
|
+
const $ = cheerio.load(response);
|
|
15
|
+
|
|
16
|
+
let items = $('table.center_main02')
|
|
17
|
+
.find('a[title]')
|
|
18
|
+
.slice(0, limit)
|
|
19
|
+
.toArray()
|
|
20
|
+
.map((item) => {
|
|
21
|
+
item = $(item);
|
|
22
|
+
|
|
23
|
+
const regExp = new RegExp(`\\/sgcc\\/${category}\\/\\.\\.\\.`);
|
|
24
|
+
const link = new URL(`${category}/${item.prop('href').replace(/\.\//, '')}`, currentUrl).href.replace(regExp, '');
|
|
25
|
+
|
|
26
|
+
return {
|
|
27
|
+
title: item.contents().first().text(),
|
|
28
|
+
link,
|
|
29
|
+
pubDate: parseDate(item.find('span').text()),
|
|
30
|
+
enclosure_url: link,
|
|
31
|
+
enclosure_type: `application/${link.split(/\./).pop()}`,
|
|
32
|
+
};
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
items = await Promise.all(
|
|
36
|
+
items.map((item) =>
|
|
37
|
+
ctx.cache.tryGet(item.link, async () => {
|
|
38
|
+
if (item.link.endsWith('html')) {
|
|
39
|
+
const { data: detailResponse } = await got(item.link);
|
|
40
|
+
|
|
41
|
+
const content = cheerio.load(detailResponse);
|
|
42
|
+
|
|
43
|
+
item.description = content('#content').html();
|
|
44
|
+
}
|
|
45
|
+
return item;
|
|
46
|
+
})
|
|
47
|
+
)
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
const icon = new URL($('link[rel="shortcut icon"]').prop('href'), rootUrl).href;
|
|
51
|
+
|
|
52
|
+
ctx.state.data = {
|
|
53
|
+
item: items,
|
|
54
|
+
title: $('title').text(),
|
|
55
|
+
link: currentUrl,
|
|
56
|
+
description: $('meta[name="ColumnDescription"]').prop('content'),
|
|
57
|
+
language: 'zh',
|
|
58
|
+
image: new URL($('#imag').prop('src'), rootUrl).href,
|
|
59
|
+
icon,
|
|
60
|
+
logo: icon,
|
|
61
|
+
subtitle: $('meta[name="ColumnName"]').prop('content'),
|
|
62
|
+
author: $('meta[name="SiteName"]').prop('content'),
|
|
63
|
+
};
|
|
64
|
+
};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
4
|
+
|
|
5
|
+
module.exports = async (ctx) => {
|
|
6
|
+
const { category } = ctx.params;
|
|
7
|
+
const limit = ctx.query.limit ? parseInt(ctx.query.limit, 10) : 5;
|
|
8
|
+
|
|
9
|
+
const domain = 'moa.gov.cn';
|
|
10
|
+
const rootFrameUrl = `http://www.${domain}`;
|
|
11
|
+
const rootUrl = `http://zdscxx.${domain}:8080`;
|
|
12
|
+
const apiUrl = new URL('nyb/getMessages', rootUrl).href;
|
|
13
|
+
const apiDetailUrl = new URL('nyb/getMessagesById', rootUrl).href;
|
|
14
|
+
const currentUrl = new URL('nyb/pc/messageList.jsp', rootUrl).href;
|
|
15
|
+
const frameUrl = new URL('iframe/top_sj/', rootFrameUrl).href;
|
|
16
|
+
|
|
17
|
+
let filterForm = {};
|
|
18
|
+
|
|
19
|
+
if (category) {
|
|
20
|
+
const apiFilterUrl = new URL('nyb/getMessageFilters', rootUrl).href;
|
|
21
|
+
|
|
22
|
+
const { data: filterResponse } = await got.post(apiFilterUrl, {
|
|
23
|
+
form: {
|
|
24
|
+
type: '',
|
|
25
|
+
isLatestMessage: false,
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const filters = filterResponse.result.reduce((filters, f) => {
|
|
30
|
+
filters[f.name] = f.data.map((d) => d.name);
|
|
31
|
+
return filters;
|
|
32
|
+
}, {});
|
|
33
|
+
|
|
34
|
+
filterForm = category.split(/\//).reduce((form, c) => {
|
|
35
|
+
Object.keys(filters)
|
|
36
|
+
.filter((key) => filters[key].includes(c))
|
|
37
|
+
.forEach((key) => {
|
|
38
|
+
form[key] = c;
|
|
39
|
+
});
|
|
40
|
+
return form;
|
|
41
|
+
}, {});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const { data: response } = await got.post(apiUrl, {
|
|
45
|
+
form: {
|
|
46
|
+
page: 1,
|
|
47
|
+
rows: limit,
|
|
48
|
+
type: '',
|
|
49
|
+
isLatestMessage: false,
|
|
50
|
+
...filterForm,
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
let items = response.result.table.slice(0, limit).map((item) => ({
|
|
55
|
+
title: item.title,
|
|
56
|
+
link: item.id,
|
|
57
|
+
guid: `moa-zdscxx-${item.id}`,
|
|
58
|
+
pubDate: parseDate(item.date),
|
|
59
|
+
}));
|
|
60
|
+
|
|
61
|
+
items = await Promise.all(
|
|
62
|
+
items.map((item) =>
|
|
63
|
+
ctx.cache.tryGet(item.guid, async () => {
|
|
64
|
+
const { data: detailResponse } = await got.post(apiDetailUrl, {
|
|
65
|
+
form: {
|
|
66
|
+
id: item.link,
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
const data = detailResponse.result;
|
|
71
|
+
|
|
72
|
+
item.title = data.title;
|
|
73
|
+
item.link = new URL(`nyb/pc/messageView.jsp?id=${item.link}`, rootUrl).href;
|
|
74
|
+
item.description = data.content;
|
|
75
|
+
item.author = data.source;
|
|
76
|
+
item.pubDate = parseDate(data.date);
|
|
77
|
+
|
|
78
|
+
return item;
|
|
79
|
+
})
|
|
80
|
+
)
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
const { data: frameResponse } = await got(frameUrl);
|
|
84
|
+
|
|
85
|
+
const $ = cheerio.load(frameResponse);
|
|
86
|
+
|
|
87
|
+
const title = $('title').text();
|
|
88
|
+
const description = '数据';
|
|
89
|
+
const icon = new URL('favicon.ico', rootUrl).href;
|
|
90
|
+
|
|
91
|
+
ctx.state.data = {
|
|
92
|
+
item: items,
|
|
93
|
+
title: `${title} - ${description} - ${category}`,
|
|
94
|
+
link: currentUrl,
|
|
95
|
+
description,
|
|
96
|
+
language: 'zh',
|
|
97
|
+
image: $('h1.logo a img').prop('src'),
|
|
98
|
+
icon,
|
|
99
|
+
logo: icon,
|
|
100
|
+
subtitle: category,
|
|
101
|
+
author: title,
|
|
102
|
+
allowEmpty: true,
|
|
103
|
+
};
|
|
104
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
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
|
+
|
|
6
|
+
module.exports = async (ctx) => {
|
|
7
|
+
const { category = 'tongjishuju/gonglu' } = ctx.params;
|
|
8
|
+
const limit = ctx.query.limit ? parseInt(ctx.query.limit, 10) : 30;
|
|
9
|
+
|
|
10
|
+
const rootUrl = 'https://www.mot.gov.cn';
|
|
11
|
+
const currentUrl = new URL(`${category}/`, rootUrl).href;
|
|
12
|
+
|
|
13
|
+
const { data: response } = await got(currentUrl);
|
|
14
|
+
|
|
15
|
+
const $ = cheerio.load(response);
|
|
16
|
+
|
|
17
|
+
let items = $('div.tab-pane a[title]')
|
|
18
|
+
.slice(0, limit)
|
|
19
|
+
.toArray()
|
|
20
|
+
.map((item) => {
|
|
21
|
+
item = $(item);
|
|
22
|
+
|
|
23
|
+
const link = item.prop('href');
|
|
24
|
+
|
|
25
|
+
return {
|
|
26
|
+
title: item.prop('title'),
|
|
27
|
+
link: link.startsWith('http') ? link : new URL(item.prop('href'), currentUrl).href,
|
|
28
|
+
pubDate: parseDate(item.find('span.badge').text()),
|
|
29
|
+
};
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
items = await Promise.all(
|
|
33
|
+
items.map((item) =>
|
|
34
|
+
ctx.cache.tryGet(item.link, async () => {
|
|
35
|
+
if (/\.gov\.cn/.test(item.link) && item.link.endsWith('.html')) {
|
|
36
|
+
const { data: detailResponse } = await got(item.link);
|
|
37
|
+
|
|
38
|
+
const content = cheerio.load(detailResponse);
|
|
39
|
+
|
|
40
|
+
item.title = content('meta[name="ArticleTitle"]').prop('content') || content('h1#ti').text();
|
|
41
|
+
item.description = content('div.TRS_UEDITOR').html();
|
|
42
|
+
item.author = [...new Set([content('meta[name="Author"]').prop('content'), content('meta[name="ContentSource"]').prop('content')])].filter((a) => a);
|
|
43
|
+
item.category = [
|
|
44
|
+
...new Set([content('meta[name="ColumnName"]').prop('content'), content('meta[name="ColumnType"]').prop('content'), ...(content('meta[name="Keywords"]').prop('content')?.split(/,|;/) ?? [])]),
|
|
45
|
+
].filter((c) => c);
|
|
46
|
+
item.pubDate = timezone(parseDate(content('meta[name="PubDate"]').prop('content')), +8);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return item;
|
|
50
|
+
})
|
|
51
|
+
)
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
const image = new URL($('a.navbar-brand img').prop('src'), rootUrl).href;
|
|
55
|
+
|
|
56
|
+
ctx.state.data = {
|
|
57
|
+
item: items,
|
|
58
|
+
title: $('title').text(),
|
|
59
|
+
link: currentUrl,
|
|
60
|
+
description: $('meta[name="ColumnDescription"]').prop('content'),
|
|
61
|
+
language: $('html').prop('lang'),
|
|
62
|
+
image,
|
|
63
|
+
subtitle: $('meta[name="ColumnName"]').prop('content'),
|
|
64
|
+
author: $('meta[name="SiteName"]').prop('content'),
|
|
65
|
+
};
|
|
66
|
+
};
|
|
@@ -4,58 +4,55 @@ const timezone = require('@/utils/timezone');
|
|
|
4
4
|
const { parseDate } = require('@/utils/parse-date');
|
|
5
5
|
|
|
6
6
|
module.exports = async (ctx) => {
|
|
7
|
-
const
|
|
7
|
+
const { path = 'bshff/ylqxbzhgl/qxggtzh' } = ctx.params;
|
|
8
|
+
const limit = ctx.query.limit ? parseInt(ctx.query.limit, 10) : 30;
|
|
8
9
|
|
|
9
10
|
const rootUrl = 'https://www.nifdc.org.cn';
|
|
10
|
-
const currentUrl =
|
|
11
|
+
const currentUrl = new URL(`nifdc/${path}/`, rootUrl).href;
|
|
11
12
|
|
|
12
|
-
const response = await got(
|
|
13
|
-
method: 'get',
|
|
14
|
-
url: currentUrl,
|
|
15
|
-
});
|
|
13
|
+
const { data: response } = await got(currentUrl);
|
|
16
14
|
|
|
17
|
-
const $ = cheerio.load(response
|
|
15
|
+
const $ = cheerio.load(response);
|
|
18
16
|
|
|
19
|
-
let items = $('.list ul li
|
|
20
|
-
.slice(0,
|
|
17
|
+
let items = $('div.list ul li')
|
|
18
|
+
.slice(0, limit)
|
|
21
19
|
.toArray()
|
|
22
20
|
.map((item) => {
|
|
23
21
|
item = $(item);
|
|
24
22
|
|
|
25
|
-
const
|
|
23
|
+
const a = item.find('a');
|
|
24
|
+
const link = a.prop('href');
|
|
26
25
|
|
|
27
26
|
return {
|
|
28
|
-
title:
|
|
29
|
-
link:
|
|
30
|
-
pubDate: parseDate(
|
|
31
|
-
item
|
|
32
|
-
.next()
|
|
33
|
-
.text()
|
|
34
|
-
.match(/\((.*)\)/)
|
|
35
|
-
),
|
|
27
|
+
title: a.prop('title') || a.text(),
|
|
28
|
+
link: link.startsWith('http') ? link : new URL(link, currentUrl).href,
|
|
29
|
+
pubDate: parseDate(item.find('span').text().replace(/\(|\)/g, '')),
|
|
36
30
|
};
|
|
37
31
|
});
|
|
38
32
|
|
|
39
33
|
items = await Promise.all(
|
|
40
34
|
items.map((item) =>
|
|
41
35
|
ctx.cache.tryGet(item.link, async () => {
|
|
42
|
-
|
|
43
|
-
const { data:
|
|
36
|
+
try {
|
|
37
|
+
const { data: detailResponse } = await got(item.link);
|
|
44
38
|
|
|
45
|
-
const content = cheerio.load(
|
|
39
|
+
const content = cheerio.load(detailResponse);
|
|
46
40
|
|
|
47
|
-
item.
|
|
48
|
-
item.
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
41
|
+
item.title = content('.title').text();
|
|
42
|
+
item.description = content('div.text').append(content('div.fujian')).html();
|
|
43
|
+
item.author = content('meta[name="ContentSource"]').prop('content');
|
|
44
|
+
item.category = [
|
|
45
|
+
...new Set([content('meta[name="ColumnName"]').prop('content'), content('meta[name="ColumnType"]').prop('content'), ...(content('meta[name="ColumnKeywords"]').prop('content').split(/,|;/) ?? [])]),
|
|
46
|
+
].filter((c) => c);
|
|
47
|
+
item.pubDate = timezone(parseDate(content('meta[name="PubDate"]').prop('content')), +8);
|
|
48
|
+
item.enclosure_url = content('a.fujianClass').first().prop('href');
|
|
54
49
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
50
|
+
if (item.enclosure_url) {
|
|
51
|
+
item.enclosure_url = new URL(item.enclosure_url, rootUrl).href;
|
|
52
|
+
item.enclosure_type = `application/${item.enclosure_url.split(/\./).pop()}`;
|
|
53
|
+
}
|
|
54
|
+
} catch (e) {
|
|
55
|
+
// no-empty
|
|
59
56
|
}
|
|
60
57
|
|
|
61
58
|
return item;
|
|
@@ -63,9 +60,19 @@ module.exports = async (ctx) => {
|
|
|
63
60
|
)
|
|
64
61
|
);
|
|
65
62
|
|
|
63
|
+
const image = new URL($('div.logo img').prop('src'), currentUrl).href;
|
|
64
|
+
const icon = new URL($('link[rel="shortcut icon"]').prop('href'), currentUrl).href;
|
|
65
|
+
|
|
66
66
|
ctx.state.data = {
|
|
67
|
+
item: items,
|
|
67
68
|
title: $('title').text().replace(/----/, ' - '),
|
|
68
69
|
link: currentUrl,
|
|
69
|
-
|
|
70
|
+
description: $('meta[name="ColumnDescription"]').prop('content'),
|
|
71
|
+
language: 'zh',
|
|
72
|
+
image,
|
|
73
|
+
icon,
|
|
74
|
+
logo: icon,
|
|
75
|
+
subtitle: $('meta[ name="ColumnName"]').prop('content'),
|
|
76
|
+
author: $('meta[name="SiteName"]').prop('content'),
|
|
70
77
|
};
|
|
71
78
|
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
4
|
+
const timezone = require('@/utils/timezone');
|
|
5
|
+
|
|
6
|
+
module.exports = async (ctx) => {
|
|
7
|
+
const { caty } = ctx.params;
|
|
8
|
+
// 主页
|
|
9
|
+
const baseurl = `http://www.npc.gov.cn/npc/c2/${caty}/`;
|
|
10
|
+
const response = await got(baseurl);
|
|
11
|
+
const data = response.data;
|
|
12
|
+
const $ = cheerio.load(data);
|
|
13
|
+
const title = $('title').text();
|
|
14
|
+
// 获取每条的链接
|
|
15
|
+
const links = $('.clist a')
|
|
16
|
+
.toArray()
|
|
17
|
+
.map((item) => new URL($(item).attr('href'), baseurl).href);
|
|
18
|
+
// 获取标题、日期、内容
|
|
19
|
+
const items = await Promise.all(
|
|
20
|
+
links.map((link) =>
|
|
21
|
+
ctx.cache.tryGet(link, async () => {
|
|
22
|
+
const response = await got(link);
|
|
23
|
+
const data = response.data;
|
|
24
|
+
const $ = cheerio.load(data);
|
|
25
|
+
const title = $('title').text().replace('_中国人大网', '');
|
|
26
|
+
const time = $('script:contains("fbrq")')
|
|
27
|
+
.text()
|
|
28
|
+
.match(/fbrq = "(.*?)"/)[1];
|
|
29
|
+
const description = $('#Zoom').html();
|
|
30
|
+
|
|
31
|
+
return {
|
|
32
|
+
title,
|
|
33
|
+
link,
|
|
34
|
+
description,
|
|
35
|
+
pubDate: timezone(parseDate(time, 'YYYY年MM月DD日 HH:mm'), +8),
|
|
36
|
+
};
|
|
37
|
+
})
|
|
38
|
+
)
|
|
39
|
+
);
|
|
40
|
+
// 整合
|
|
41
|
+
ctx.state.data = {
|
|
42
|
+
title,
|
|
43
|
+
link: baseurl,
|
|
44
|
+
description: title,
|
|
45
|
+
item: items,
|
|
46
|
+
};
|
|
47
|
+
};
|