rsshub 1.0.0-master.f7f8b7a → 1.0.0-master.f812e91
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 +6 -4
- package/lib/radar-rules.js +0 -93
- package/lib/router.js +5 -297
- package/lib/routes/199it/category.js +1 -1
- package/lib/routes/199it/tag.js +1 -1
- package/lib/routes/199it/utils.js +1 -1
- package/lib/v2/9to5/utils.js +1 -1
- package/lib/v2/aeon/utils.js +1 -1
- package/lib/v2/agirls/maintainer.js +0 -1
- package/lib/v2/agirls/radar.js +0 -6
- package/lib/v2/agirls/router.js +0 -1
- package/lib/v2/artstation/maintainer.js +3 -0
- package/lib/v2/artstation/radar.js +13 -0
- package/lib/v2/artstation/router.js +3 -0
- package/lib/v2/artstation/templates/description.art +17 -0
- package/lib/v2/artstation/user.js +98 -0
- package/lib/v2/bilibili/maintainer.js +0 -5
- package/lib/v2/bilibili/radar.js +0 -6
- package/lib/v2/bilibili/router.js +0 -5
- package/lib/v2/cctv/maintainer.js +0 -1
- package/lib/v2/cctv/radar.js +0 -6
- package/lib/v2/cctv/router.js +0 -1
- package/lib/v2/curius/templates/description.art +1 -1
- package/lib/v2/dahecube/index.js +1 -1
- package/lib/v2/deeplearning/maintainer.js +3 -0
- package/lib/v2/deeplearning/radar.js +13 -0
- package/lib/v2/deeplearning/router.js +3 -0
- package/lib/v2/deeplearning/thebatch.js +36 -0
- package/lib/v2/diandong/maintainer.js +0 -1
- package/lib/v2/diandong/radar.js +0 -6
- package/lib/v2/diandong/router.js +0 -1
- package/lib/v2/dx2025/radar.js +0 -6
- package/lib/v2/eastday/maintainer.js +0 -1
- package/lib/v2/eastday/radar.js +0 -6
- package/lib/v2/eastday/router.js +0 -1
- package/lib/v2/economist/maintainer.js +0 -2
- package/lib/v2/economist/radar.js +0 -8
- package/lib/v2/economist/router.js +0 -2
- package/lib/v2/ft/maintainer.js +0 -1
- package/lib/v2/ft/radar.js +0 -13
- package/lib/v2/ft/router.js +0 -1
- package/lib/v2/github/radar.js +12 -12
- package/lib/v2/gov/chinamine-safety/util.js +77 -0
- package/lib/v2/gov/chinamine-safety/xw.js +37 -0
- package/lib/v2/gov/chinamine-safety/zfxxgk.js +36 -0
- package/lib/v2/gov/maintainer.js +2 -0
- package/lib/v2/gov/radar.js +191 -0
- package/lib/v2/gov/router.js +2 -0
- package/lib/v2/hellobtc/maintainer.js +0 -1
- package/lib/v2/hellobtc/radar.js +0 -6
- package/lib/v2/hellobtc/router.js +0 -1
- package/lib/v2/instagram/radar.js +2 -2
- package/lib/v2/jianshu/maintainer.js +5 -0
- package/lib/v2/jianshu/radar.js +25 -0
- package/lib/v2/jianshu/router.js +5 -0
- package/lib/{routes → v2}/jianshu/utils.js +18 -26
- package/lib/v2/nhk/news.js +1 -1
- package/lib/v2/nytimes/radar.js +0 -6
- package/lib/v2/nytimes/router.js +0 -1
- package/lib/v2/qweather/3days.js +1 -1
- package/lib/v2/reuters/common.js +55 -48
- package/lib/v2/sehuatang/index.js +10 -12
- package/lib/v2/sehuatang/user.js +11 -12
- package/lib/v2/thenewslens/radar.js +0 -6
- package/lib/v2/thoughtco/index.js +1 -1
- package/lib/v2/threads/index.js +1 -1
- package/lib/v2/tophub/list.js +40 -0
- package/lib/v2/tophub/maintainer.js +1 -0
- package/lib/v2/tophub/radar.js +6 -0
- package/lib/v2/tophub/router.js +1 -0
- package/lib/v2/tophub/templates/rank.art +22 -0
- package/lib/v2/twreporter/maintainer.js +0 -2
- package/lib/v2/twreporter/radar.js +0 -12
- package/lib/v2/twreporter/router.js +0 -2
- package/lib/v2/worldjournal/index.js +1 -1
- package/lib/v2/woshipm/maintainer.js +0 -2
- package/lib/v2/woshipm/radar.js +0 -12
- package/lib/v2/woshipm/router.js +0 -2
- package/lib/v2/zhihu/maintainer.js +2 -0
- package/lib/v2/zhihu/radar.js +18 -0
- package/lib/v2/zhihu/router.js +2 -0
- package/lib/v2/zhihu/xhu/activities.js +112 -0
- package/lib/v2/zhihu/xhu/answers.js +31 -0
- package/lib/views/rss3-ums.js +1 -1
- package/package.json +3 -3
- package/lib/routes/8btc/author.js +0 -49
- package/lib/routes/8btc/news/flash.js +0 -41
- package/lib/routes/91ddcc/stage.js +0 -48
- package/lib/routes/91ddcc/user.js +0 -45
- package/lib/routes/93/index.js +0 -50
- package/lib/routes/allnow/column.js +0 -7
- package/lib/routes/allnow/index.js +0 -5
- package/lib/routes/allnow/tag.js +0 -7
- package/lib/routes/allnow/user.js +0 -7
- package/lib/routes/allnow/utils.js +0 -67
- package/lib/routes/andyt/index.js +0 -36
- package/lib/routes/asahi/area.js +0 -57
- package/lib/routes/baidu/daily.js +0 -55
- package/lib/routes/bell-labs/events-news.js +0 -70
- package/lib/routes/bihu/activaties.js +0 -76
- package/lib/routes/bioon/latest.js +0 -51
- package/lib/routes/bishijie/kuaixun.js +0 -21
- package/lib/routes/bjnews/epaper.js +0 -80
- package/lib/routes/bof/home.js +0 -42
- package/lib/routes/boston/index.js +0 -73
- package/lib/routes/buaq/index.js +0 -31
- package/lib/routes/cgtn/pick.js +0 -45
- package/lib/routes/cgtn/top.js +0 -45
- package/lib/routes/chinadialogue/column.js +0 -58
- package/lib/routes/chinadialogue/topics.js +0 -55
- package/lib/routes/chinalaborwatch/reports.js +0 -53
- package/lib/routes/chinatimes/index.js +0 -115
- package/lib/routes/cmes/news.js +0 -64
- package/lib/routes/commonapp/blog.js +0 -42
- package/lib/routes/cria/news.js +0 -57
- package/lib/routes/dayone/blog.js +0 -56
- package/lib/routes/deeplearningai/thebatch.js +0 -29
- package/lib/routes/dianping/user.js +0 -98
- package/lib/routes/donews/index.js +0 -59
- package/lib/routes/donews/utils.js +0 -19
- package/lib/routes/dsb/area.js +0 -33
- package/lib/routes/dxy/vaccine.js +0 -109
- package/lib/routes/esquirehk/tag.js +0 -71
- package/lib/routes/facebook/page.js +0 -128
- package/lib/routes/feixuew/index.js +0 -63
- package/lib/routes/fjnews/fznews.js +0 -55
- package/lib/routes/fjnews/jjnews.js +0 -43
- package/lib/routes/fulinian/index.js +0 -50
- package/lib/routes/gab/explore.js +0 -31
- package/lib/routes/gamegrape/index.js +0 -73
- package/lib/routes/gvm/index.js +0 -94
- package/lib/routes/hkcd/pdf.js +0 -30
- package/lib/routes/hkcnews/news.js +0 -63
- package/lib/routes/hkgolden/index.js +0 -110
- package/lib/routes/huawei/xinsheng/index.js +0 -61
- package/lib/routes/iea/index.js +0 -53
- package/lib/routes/iie/blog.js +0 -47
- package/lib/routes/imaijia/category.js +0 -63
- package/lib/routes/itjuzi/invest.js +0 -32
- package/lib/routes/itjuzi/merge.js +0 -32
- package/lib/routes/iyiou/index.js +0 -41
- package/lib/routes/jianshu/trending.js +0 -28
- package/lib/routes/jiazhen108/index.js +0 -47
- package/lib/routes/jinritoutiao/keyword.js +0 -27
- package/lib/routes/juesheng/index.js +0 -49
- package/lib/routes/krankenkassen/index.js +0 -54
- package/lib/routes/kzfeed/topic.js +0 -122
- package/lib/routes/lingyi/index.js +0 -64
- package/lib/routes/lowendtalk/discussion.js +0 -43
- package/lib/routes/makeuseof/index.js +0 -59
- package/lib/routes/matataki/site/posts/author.js +0 -17
- package/lib/routes/matataki/site/posts/favorite.js +0 -42
- package/lib/routes/matataki/site/posts/scoreranking.js +0 -15
- package/lib/routes/matataki/site/posts/tag.js +0 -16
- package/lib/routes/matataki/site/posts/timeranking.js +0 -15
- package/lib/routes/matataki/site/posts/token.js +0 -18
- package/lib/routes/matataki/utils/matataki-utils.js +0 -125
- package/lib/routes/mi/board.js +0 -36
- package/lib/routes/mitbbs/index.js +0 -54
- package/lib/routes/nba/app_news.js +0 -40
- package/lib/routes/newsmth/account.js +0 -39
- package/lib/routes/newsmth/section.js +0 -99
- package/lib/routes/northhouse/index.js +0 -54
- package/lib/routes/or/index.js +0 -54
- package/lib/routes/partnershiponai/resources.js +0 -49
- package/lib/routes/pintu360/index.js +0 -54
- package/lib/routes/plainlaw/archives.js +0 -42
- package/lib/routes/pmcaff/user.js +0 -56
- package/lib/routes/polar/blog.js +0 -47
- package/lib/routes/popiask/questions.js +0 -41
- package/lib/routes/popiask/tapechat_questions.js +0 -43
- package/lib/routes/popyard/index.js +0 -93
- package/lib/routes/qlwb/city.js +0 -54
- package/lib/routes/qlwb/news.js +0 -37
- package/lib/routes/sbs/chinese.js +0 -70
- package/lib/routes/sixthtone/news.js +0 -52
- package/lib/routes/socialbeta/hunt.js +0 -29
- package/lib/routes/soomal/topics.js +0 -130
- package/lib/routes/tam/forecast.js +0 -53
- package/lib/routes/tanwu/products.js +0 -27
- package/lib/routes/tencent/guyu/channel.js +0 -64
- package/lib/routes/thrillist/index.js +0 -67
- package/lib/routes/tianya/comments.js +0 -41
- package/lib/routes/tianya/index.js +0 -32
- package/lib/routes/tianya/user.js +0 -34
- package/lib/routes/tuicool/mags.js +0 -41
- package/lib/routes/voa/day-photos.js +0 -54
- package/lib/routes/vuevideo/user.js +0 -60
- package/lib/routes/weseepro/circle.js +0 -38
- package/lib/routes/weseepro/newest-direct.js +0 -69
- package/lib/routes/weseepro/newest.js +0 -69
- package/lib/routes/whalegogo/home.js +0 -43
- package/lib/routes/whalegogo/portal.js +0 -57
- package/lib/routes/wired/tag.js +0 -31
- package/lib/routes/wukong/user.js +0 -93
- package/lib/routes/xici/index.js +0 -33
- package/lib/routes/yicas/blog.js +0 -52
- package/lib/routes/yidoutang/index.js +0 -33
- package/lib/routes/zfrontier/board_postlist.js +0 -36
- package/lib/routes/zfrontier/postlist.js +0 -33
- package/lib/routes/zzz/index.js +0 -59
- package/lib/v2/2047/index.js +0 -55
- package/lib/v2/2047/maintainer.js +0 -3
- package/lib/v2/2047/radar.js +0 -13
- package/lib/v2/2047/router.js +0 -3
- package/lib/v2/agirls/topic.js +0 -44
- package/lib/v2/allrecode/index.js +0 -65
- package/lib/v2/allrecode/maintainer.js +0 -5
- package/lib/v2/allrecode/news.js +0 -35
- package/lib/v2/allrecode/radar.js +0 -25
- package/lib/v2/allrecode/router.js +0 -4
- package/lib/v2/appledaily/index.js +0 -65
- package/lib/v2/appledaily/maintainer.js +0 -3
- package/lib/v2/appledaily/radar.js +0 -157
- package/lib/v2/appledaily/router.js +0 -3
- package/lib/v2/audiobar/latest.js +0 -53
- package/lib/v2/audiobar/maintainer.js +0 -3
- package/lib/v2/audiobar/radar.js +0 -13
- package/lib/v2/audiobar/router.js +0 -3
- package/lib/v2/baijing/index.js +0 -54
- package/lib/v2/baijing/maintainer.js +0 -3
- package/lib/v2/baijing/radar.js +0 -22
- package/lib/v2/baijing/router.js +0 -3
- package/lib/v2/bilibili/blackboard.js +0 -31
- package/lib/v2/bilibili/channel.js +0 -31
- package/lib/v2/bilibili/online.js +0 -25
- package/lib/v2/bilibili/topic.js +0 -50
- package/lib/v2/bilibili/video-all.js +0 -74
- package/lib/v2/cctv/special.js +0 -110
- package/lib/v2/cntheory/maintainer.js +0 -3
- package/lib/v2/cntheory/paper.js +0 -89
- package/lib/v2/cntheory/radar.js +0 -13
- package/lib/v2/cntheory/router.js +0 -3
- package/lib/v2/cntheory/templates/description.art +0 -2
- package/lib/v2/diandong/ddh.js +0 -51
- package/lib/v2/disinformationindex/blog.js +0 -48
- package/lib/v2/disinformationindex/maintainer.js +0 -4
- package/lib/v2/disinformationindex/radar.js +0 -19
- package/lib/v2/disinformationindex/research.js +0 -45
- package/lib/v2/disinformationindex/router.js +0 -4
- package/lib/v2/disinformationindex/templates/description.art +0 -7
- package/lib/v2/eastday/find.js +0 -49
- package/lib/v2/economist/download.js +0 -30
- package/lib/v2/economist/gre-vocabulary.js +0 -19
- package/lib/v2/eet-china/maintainer.js +0 -4
- package/lib/v2/eet-china/mp/index.js +0 -10
- package/lib/v2/eet-china/mp/tags.js +0 -10
- package/lib/v2/eet-china/mp/util.js +0 -67
- package/lib/v2/eet-china/radar.js +0 -24
- package/lib/v2/eet-china/router.js +0 -4
- package/lib/v2/ezone/index.js +0 -70
- package/lib/v2/ezone/maintainer.js +0 -3
- package/lib/v2/ezone/radar.js +0 -13
- package/lib/v2/ezone/router.js +0 -3
- package/lib/v2/filmdeepfocus/index.js +0 -58
- package/lib/v2/filmdeepfocus/maintainer.js +0 -3
- package/lib/v2/filmdeepfocus/radar.js +0 -13
- package/lib/v2/filmdeepfocus/router.js +0 -3
- package/lib/v2/ft/myft.js +0 -51
- package/lib/v2/good/index.js +0 -53
- package/lib/v2/good/maintainer.js +0 -3
- package/lib/v2/good/radar.js +0 -13
- package/lib/v2/good/router.js +0 -3
- package/lib/v2/gq/maintainer.js +0 -3
- package/lib/v2/gq/radar.js +0 -13
- package/lib/v2/gq/router.js +0 -3
- package/lib/v2/gq/templates/embed-article.art +0 -1
- package/lib/v2/gq/templates/embed-product.art +0 -4
- package/lib/v2/gq/templates/img.art +0 -6
- package/lib/v2/gq/templates/tw.art +0 -3
- package/lib/v2/gq/templates/videoObject.art +0 -6
- package/lib/v2/gq/templates/youtube.art +0 -3
- package/lib/v2/gq/tw/index.js +0 -165
- package/lib/v2/guandian/index.js +0 -37
- package/lib/v2/guandian/maintainer.js +0 -3
- package/lib/v2/guandian/radar.js +0 -13
- package/lib/v2/guandian/router.js +0 -3
- package/lib/v2/gz-cmc/index.js +0 -137
- package/lib/v2/gz-cmc/maintainer.js +0 -3
- package/lib/v2/gz-cmc/radar.js +0 -12
- package/lib/v2/gz-cmc/router.js +0 -3
- package/lib/v2/gz-cmc/templates/description.art +0 -3
- package/lib/v2/gzh360/_README +0 -1
- package/lib/v2/gzh360/category.js +0 -8
- package/lib/v2/gzh360/gzh.js +0 -18
- package/lib/v2/gzh360/maintainer.js +0 -4
- package/lib/v2/gzh360/radar.js +0 -19
- package/lib/v2/gzh360/router.js +0 -4
- package/lib/v2/gzh360/universal.js +0 -53
- package/lib/v2/gzh360/utils.js +0 -62
- package/lib/v2/hellobtc/topic.js +0 -43
- package/lib/v2/hjedd/article.js +0 -27
- package/lib/v2/hjedd/hot.js +0 -14
- package/lib/v2/hjedd/latest.js +0 -14
- package/lib/v2/hjedd/maintainer.js +0 -10
- package/lib/v2/hjedd/news.js +0 -14
- package/lib/v2/hjedd/notice.js +0 -14
- package/lib/v2/hjedd/original.js +0 -14
- package/lib/v2/hjedd/radar.js +0 -55
- package/lib/v2/hjedd/router.js +0 -10
- package/lib/v2/hjedd/templates/attachment.art +0 -7
- package/lib/v2/hjedd/top.js +0 -14
- package/lib/v2/hjedd/utils.js +0 -111
- package/lib/v2/hket/index.js +0 -122
- package/lib/v2/hket/maintainer.js +0 -3
- package/lib/v2/hket/radar.js +0 -45
- package/lib/v2/hket/router.js +0 -3
- package/lib/v2/hket/templates/description.art +0 -1
- package/lib/v2/hket/templates/image.art +0 -1
- package/lib/v2/hotchina/index.js +0 -55
- package/lib/v2/hotchina/maintainer.js +0 -5
- package/lib/v2/hotchina/radar.js +0 -25
- package/lib/v2/hotchina/router.js +0 -3
- package/lib/v2/hyqss/index.js +0 -89
- package/lib/v2/hyqss/maintainer.js +0 -4
- package/lib/v2/hyqss/radar.js +0 -22
- package/lib/v2/hyqss/router.js +0 -3
- package/lib/v2/i-cable/category.js +0 -74
- package/lib/v2/i-cable/maintainer.js +0 -3
- package/lib/v2/i-cable/radar.js +0 -13
- package/lib/v2/i-cable/router.js +0 -3
- package/lib/v2/i-cable/templates/desc.art +0 -8
- package/lib/v2/islander/maintainer.js +0 -4
- package/lib/v2/islander/radar.js +0 -19
- package/lib/v2/islander/router.js +0 -4
- package/lib/v2/islander/search.js +0 -33
- package/lib/v2/islander/top30event.js +0 -28
- package/lib/v2/knowmedia/index.js +0 -38
- package/lib/v2/knowmedia/maintainer.js +0 -3
- package/lib/v2/knowmedia/radar.js +0 -31
- package/lib/v2/knowmedia/router.js +0 -3
- package/lib/v2/knowmedia/templates/desc.art +0 -3
- package/lib/v2/kuwaitlocal/index.js +0 -47
- package/lib/v2/kuwaitlocal/maintainer.js +0 -4
- package/lib/v2/kuwaitlocal/radar.js +0 -19
- package/lib/v2/kuwaitlocal/router.js +0 -3
- package/lib/v2/mclaren/index.js +0 -96
- package/lib/v2/mclaren/maintainer.js +0 -3
- package/lib/v2/mclaren/radar.js +0 -29
- package/lib/v2/mclaren/router.js +0 -3
- package/lib/v2/mclaren/templates/desc.art +0 -6
- package/lib/v2/mobilism/forums.js +0 -75
- package/lib/v2/mobilism/maintainer.js +0 -4
- package/lib/v2/mobilism/portal.js +0 -54
- package/lib/v2/mobilism/radar.js +0 -23
- package/lib/v2/mobilism/router.js +0 -4
- package/lib/v2/nmbxd1/forum.js +0 -58
- package/lib/v2/nmbxd1/maintainer.js +0 -3
- package/lib/v2/nmbxd1/radar.js +0 -13
- package/lib/v2/nmbxd1/router.js +0 -3
- package/lib/v2/nmbxd1/templates/description.art +0 -65
- package/lib/v2/nytimes/author.js +0 -43
- package/lib/v2/pmthinking/index.js +0 -61
- package/lib/v2/pmthinking/maintainer.js +0 -3
- package/lib/v2/pmthinking/radar.js +0 -13
- package/lib/v2/pmthinking/router.js +0 -3
- package/lib/v2/pmthinking/templates/description.art +0 -4
- package/lib/v2/qdaily/index.js +0 -87
- package/lib/v2/qdaily/maintainer.js +0 -3
- package/lib/v2/qdaily/radar.js +0 -25
- package/lib/v2/qdaily/router.js +0 -3
- package/lib/v2/qdaily/templates/article.art +0 -5
- package/lib/v2/qianp/maintainer.js +0 -3
- package/lib/v2/qianp/news.js +0 -48
- package/lib/v2/qianp/radar.js +0 -13
- package/lib/v2/qianp/router.js +0 -3
- package/lib/v2/radiofrance/geopolitique.js +0 -33
- package/lib/v2/radiofrance/maintainer.js +0 -3
- package/lib/v2/radiofrance/radar.js +0 -13
- package/lib/v2/radiofrance/router.js +0 -3
- package/lib/v2/radiofrance/templates/article.art +0 -6
- package/lib/v2/shuiguopai/index.js +0 -80
- package/lib/v2/shuiguopai/maintainer.js +0 -3
- package/lib/v2/shuiguopai/radar.js +0 -13
- package/lib/v2/shuiguopai/router.js +0 -3
- package/lib/v2/shuiguopai/templates/description.art +0 -8
- package/lib/v2/taiwannews/hot.js +0 -52
- package/lib/v2/taiwannews/maintainer.js +0 -3
- package/lib/v2/taiwannews/radar.js +0 -13
- package/lib/v2/taiwannews/router.js +0 -3
- package/lib/v2/twreporter/category.js +0 -40
- package/lib/v2/twreporter/photography.js +0 -46
- package/lib/v2/verse/articles.js +0 -42
- package/lib/v2/verse/maintainer.js +0 -3
- package/lib/v2/verse/radar.js +0 -13
- package/lib/v2/verse/router.js +0 -3
- package/lib/v2/watchout/index.js +0 -51
- package/lib/v2/watchout/maintainer.js +0 -3
- package/lib/v2/watchout/radar.js +0 -13
- package/lib/v2/watchout/router.js +0 -3
- package/lib/v2/woshipm/bookmarks.js +0 -34
- package/lib/v2/woshipm/latest.js +0 -27
- package/lib/v2/wp-china/maintainer.js +0 -3
- package/lib/v2/wp-china/news.js +0 -56
- package/lib/v2/wp-china/radar.js +0 -13
- package/lib/v2/wp-china/router.js +0 -3
- package/lib/v2/wxkol/maintainer.js +0 -3
- package/lib/v2/wxkol/radar.js +0 -13
- package/lib/v2/wxkol/router.js +0 -3
- package/lib/v2/wxkol/show.js +0 -81
- package/lib/v2/xwlb/index.js +0 -40
- package/lib/v2/xwlb/maintainer.js +0 -4
- package/lib/v2/xwlb/radar.js +0 -13
- package/lib/v2/xwlb/router.js +0 -4
- package/lib/v2/yaohuo/index.js +0 -30
- package/lib/v2/yaohuo/maintainer.js +0 -3
- package/lib/v2/yaohuo/radar.js +0 -13
- package/lib/v2/yaohuo/router.js +0 -3
- package/lib/v2/yunspe/maintainer.js +0 -3
- package/lib/v2/yunspe/newsflash.js +0 -42
- package/lib/v2/yunspe/radar.js +0 -13
- package/lib/v2/yunspe/router.js +0 -3
- package/lib/v2/zuzhirenshi/index.js +0 -87
- package/lib/v2/zuzhirenshi/maintainer.js +0 -3
- package/lib/v2/zuzhirenshi/radar.js +0 -13
- package/lib/v2/zuzhirenshi/router.js +0 -3
- /package/lib/{routes → v2}/jianshu/collection.js +0 -0
- /package/lib/{routes → v2}/jianshu/home.js +0 -0
- /package/lib/{routes → v2}/jianshu/user.js +0 -0
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
const got = require('@/utils/got');
|
|
2
|
-
const cheerio = require('cheerio');
|
|
3
|
-
|
|
4
|
-
const fetchPageHtml = (linkPath, cacheKey, cache) => {
|
|
5
|
-
const url = `https://mbasic.facebook.com${linkPath}`;
|
|
6
|
-
|
|
7
|
-
return cache.tryGet(cacheKey, async () => {
|
|
8
|
-
const { data: html } = await got.get(url);
|
|
9
|
-
return html;
|
|
10
|
-
});
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
const parseStoryPage = async (linkPath, cache) => {
|
|
14
|
-
const { searchParams: q } = new URL('https://mbasic.facebook.com' + linkPath);
|
|
15
|
-
const storyFbId = q.get('story_fbid');
|
|
16
|
-
const storyId = q.get('id');
|
|
17
|
-
const cacheKey = `story/${storyFbId}/${storyId}`;
|
|
18
|
-
|
|
19
|
-
const html = await fetchPageHtml(linkPath, cacheKey, cache);
|
|
20
|
-
const $ = cheerio.load(html);
|
|
21
|
-
|
|
22
|
-
const url = `https://www.facebook.com/story.php?story_fbid=${storyFbId}&id=${storyId}`;
|
|
23
|
-
const $story = $('#m_story_permalink_view').eq(0);
|
|
24
|
-
const $box = $story.find('div > div > div > div').eq(0);
|
|
25
|
-
const $header = $box.find('header').eq(0);
|
|
26
|
-
const $content = $box.find('div > div').eq(0);
|
|
27
|
-
$content.find('a[href^="https://lm.facebook.com/l.php"]').each((_, ele) => {
|
|
28
|
-
const link = $(ele);
|
|
29
|
-
const originalLink = new URL(link.attr('href')).searchParams.get('u');
|
|
30
|
-
if (originalLink) {
|
|
31
|
-
link.attr('href', decodeURIComponent(originalLink));
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
const $attach = $story.find('div > div > div > div:nth-child(3)').eq(0);
|
|
35
|
-
|
|
36
|
-
const attachLinkList = $attach
|
|
37
|
-
.find('a')
|
|
38
|
-
.toArray()
|
|
39
|
-
.map((a) => $(a).attr('href'));
|
|
40
|
-
const isAttachAreImageSet = attachLinkList.filter((link) => new RegExp('/photos/').test(link)).length === attachLinkList.length;
|
|
41
|
-
const title = $header.find('h3').text();
|
|
42
|
-
|
|
43
|
-
const content = $content.html();
|
|
44
|
-
|
|
45
|
-
let images = [];
|
|
46
|
-
if (isAttachAreImageSet) {
|
|
47
|
-
images = await Promise.all(attachLinkList.map((link) => parsePhotoPage(link, cache)));
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return {
|
|
51
|
-
url,
|
|
52
|
-
title,
|
|
53
|
-
content,
|
|
54
|
-
images,
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
const parsePhotoPage = async (linkPath, cache) => {
|
|
59
|
-
const { pathname } = new URL('https://mbasic.facebook.com' + linkPath);
|
|
60
|
-
const cacheKey = `photos${pathname}`;
|
|
61
|
-
|
|
62
|
-
const html = await fetchPageHtml(linkPath, cacheKey, cache);
|
|
63
|
-
const $ = cheerio.load(html);
|
|
64
|
-
|
|
65
|
-
const title = $('#MPhotoContent div.msg > a > strong').first().text();
|
|
66
|
-
const url = `https://www.facebook.com${pathname}`;
|
|
67
|
-
const $content = $('#MPhotoContent div.msg > div');
|
|
68
|
-
const content = $content.html();
|
|
69
|
-
const image = $('#MPhotoContent div.desc.attachment > span > div > span > a[target=_blank].sec').attr('href');
|
|
70
|
-
|
|
71
|
-
return {
|
|
72
|
-
title,
|
|
73
|
-
url,
|
|
74
|
-
content,
|
|
75
|
-
image,
|
|
76
|
-
};
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
module.exports = async (ctx) => {
|
|
80
|
-
const { id } = ctx.params;
|
|
81
|
-
const pageId = encodeURIComponent(id);
|
|
82
|
-
const linkPath = `/${pageId}`;
|
|
83
|
-
|
|
84
|
-
const html = await fetchPageHtml(linkPath, pageId, ctx.cache);
|
|
85
|
-
const $ = cheerio.load(html);
|
|
86
|
-
|
|
87
|
-
const itemLinks = $('footer > div:nth-child(2) > a:nth-child(1)')
|
|
88
|
-
.toArray()
|
|
89
|
-
.map((a) => $(a).attr('href'));
|
|
90
|
-
|
|
91
|
-
const items = await Promise.all(
|
|
92
|
-
itemLinks.map(async (itemLink) => {
|
|
93
|
-
if (new RegExp(`^/.+/photos/`).test(itemLink)) {
|
|
94
|
-
const data = await parsePhotoPage(itemLink, ctx.cache);
|
|
95
|
-
return {
|
|
96
|
-
title: data.title,
|
|
97
|
-
link: data.url,
|
|
98
|
-
description: `<img src="${data.image}"><br>${data.content}`,
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
if (new RegExp(`^/story.php`).test(itemLink)) {
|
|
102
|
-
const data = await parseStoryPage(itemLink, ctx.cache);
|
|
103
|
-
const isSingleImageStory = data.images.length === 1;
|
|
104
|
-
const isEmptyImageList = data.images.length === 0;
|
|
105
|
-
|
|
106
|
-
let desc = '';
|
|
107
|
-
desc += data.images.map((image) => `<img src="${image.image}"><br>${image.content}`).join('<br>');
|
|
108
|
-
if (!isSingleImageStory) {
|
|
109
|
-
!isEmptyImageList && (desc += '<br>');
|
|
110
|
-
desc += data.content;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
return {
|
|
114
|
-
title: data.title,
|
|
115
|
-
link: data.url,
|
|
116
|
-
description: desc,
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
})
|
|
120
|
-
);
|
|
121
|
-
|
|
122
|
-
ctx.state.data = {
|
|
123
|
-
title: $('#m-timeline-cover-section h1 span').text(),
|
|
124
|
-
link: `https://www.facebook.com/${pageId}`,
|
|
125
|
-
description: $('#sub_profile_pic_content>div>div:nth-child(3) div>span').find('br').replaceWith('\n').text(),
|
|
126
|
-
item: items.filter((item) => !!item),
|
|
127
|
-
};
|
|
128
|
-
};
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
const got = require('@/utils/got');
|
|
2
|
-
const cheerio = require('cheerio');
|
|
3
|
-
|
|
4
|
-
module.exports = async (ctx) => {
|
|
5
|
-
let currentUrl;
|
|
6
|
-
let query;
|
|
7
|
-
|
|
8
|
-
const rootUrl = 'https://www.feixuew.com';
|
|
9
|
-
|
|
10
|
-
ctx.params.id = ctx.params.id || 'latest';
|
|
11
|
-
|
|
12
|
-
if (ctx.params.id === 'latest') {
|
|
13
|
-
currentUrl = rootUrl;
|
|
14
|
-
} else {
|
|
15
|
-
currentUrl = `${rootUrl}/sort/${ctx.params.id}`;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const response = await got({
|
|
19
|
-
method: 'get',
|
|
20
|
-
url: currentUrl,
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
const $ = cheerio.load(response.data);
|
|
24
|
-
|
|
25
|
-
if (ctx.params.id === 'latest') {
|
|
26
|
-
query = $('ul.ul-new li a').slice(4, 10);
|
|
27
|
-
} else {
|
|
28
|
-
query = $('a.sjwu').slice(0, 10);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const list = query
|
|
32
|
-
.map((_, item) => {
|
|
33
|
-
item = $(item);
|
|
34
|
-
return {
|
|
35
|
-
title: item.attr('title'),
|
|
36
|
-
link: item.attr('href'),
|
|
37
|
-
};
|
|
38
|
-
})
|
|
39
|
-
.get();
|
|
40
|
-
|
|
41
|
-
const items = await Promise.all(
|
|
42
|
-
list.map((item) =>
|
|
43
|
-
ctx.cache.tryGet(item.link, async () => {
|
|
44
|
-
const detailResponse = await got({
|
|
45
|
-
method: 'get',
|
|
46
|
-
url: item.link,
|
|
47
|
-
});
|
|
48
|
-
const content = cheerio.load(detailResponse.data);
|
|
49
|
-
|
|
50
|
-
item.description = content('div.info-con').html();
|
|
51
|
-
item.pubDate = new Date(content('p.f-sgray span').eq(1).text().replace('发布时间:', '') + ' GMT+8').toUTCString();
|
|
52
|
-
|
|
53
|
-
return item;
|
|
54
|
-
})
|
|
55
|
-
)
|
|
56
|
-
);
|
|
57
|
-
|
|
58
|
-
ctx.state.data = {
|
|
59
|
-
title: `飞雪娱乐网 - ${$('title').text().split('-')[0]}`,
|
|
60
|
-
link: currentUrl,
|
|
61
|
-
item: items,
|
|
62
|
-
};
|
|
63
|
-
};
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
const got = require('@/utils/got');
|
|
2
|
-
const cheerio = require('cheerio');
|
|
3
|
-
const url = require('url');
|
|
4
|
-
|
|
5
|
-
let host = 'http://news.fznews.com.cn/fzxw/';
|
|
6
|
-
let citytitle = '福州新闻';
|
|
7
|
-
|
|
8
|
-
module.exports = async (ctx) => {
|
|
9
|
-
if (ctx.params.city === 'fj') {
|
|
10
|
-
host = 'http://news.fznews.com.cn/dsxw/';
|
|
11
|
-
citytitle = '福建新闻';
|
|
12
|
-
} else {
|
|
13
|
-
host = 'http://news.fznews.com.cn/fzxw/';
|
|
14
|
-
citytitle = '福州新闻';
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const response = await got.get(host);
|
|
18
|
-
const $ = cheerio.load(response.data);
|
|
19
|
-
const list = $('.li-h32f14 li:not(.clearfix)').slice(0, ctx.params.limit).get();
|
|
20
|
-
const out = await Promise.all(
|
|
21
|
-
list.map(async (item) => {
|
|
22
|
-
const $ = cheerio.load(item);
|
|
23
|
-
const title = $('a').text();
|
|
24
|
-
const itemUrl = url.resolve(host, $('a').attr('href'));
|
|
25
|
-
|
|
26
|
-
const cache = await ctx.cache.get(itemUrl);
|
|
27
|
-
if (cache) {
|
|
28
|
-
return Promise.resolve(JSON.parse(cache));
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const res = await got.get(itemUrl);
|
|
32
|
-
const capture = cheerio.load(res.data);
|
|
33
|
-
const contents = capture('.zhengwen').html();
|
|
34
|
-
const time = capture('div.laiyuan div.left').text().substring(0, 19);
|
|
35
|
-
const author = capture('.laiyuan').text().replace('分享到:', '');
|
|
36
|
-
|
|
37
|
-
const single = {
|
|
38
|
-
title,
|
|
39
|
-
link: itemUrl,
|
|
40
|
-
guid: itemUrl,
|
|
41
|
-
author,
|
|
42
|
-
description: contents,
|
|
43
|
-
pubDate: new Date(time).toUTCString(),
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
return Promise.resolve(single);
|
|
47
|
-
})
|
|
48
|
-
);
|
|
49
|
-
|
|
50
|
-
ctx.state.data = {
|
|
51
|
-
title: citytitle,
|
|
52
|
-
link: host,
|
|
53
|
-
item: out,
|
|
54
|
-
};
|
|
55
|
-
};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
const got = require('@/utils/got');
|
|
2
|
-
const cheerio = require('cheerio');
|
|
3
|
-
const url = require('url');
|
|
4
|
-
const host = 'http://tt.m.jxnews.com.cn/jjtop/';
|
|
5
|
-
|
|
6
|
-
module.exports = async (ctx) => {
|
|
7
|
-
const response = await got.get(host);
|
|
8
|
-
const $ = cheerio.load(response.data);
|
|
9
|
-
const list = $('li.col-xs-12').get();
|
|
10
|
-
const out = await Promise.all(
|
|
11
|
-
list.map(async (item) => {
|
|
12
|
-
const $ = cheerio.load(item);
|
|
13
|
-
const title = $('.list-text-style').text();
|
|
14
|
-
const itemUrl = url.resolve(host, $('a').attr('href'));
|
|
15
|
-
|
|
16
|
-
const cache = await ctx.cache.get(itemUrl);
|
|
17
|
-
if (cache) {
|
|
18
|
-
return Promise.resolve(JSON.parse(cache));
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const res = await got.get(itemUrl);
|
|
22
|
-
const capture = cheerio.load(res.data);
|
|
23
|
-
const contents = capture('content').html();
|
|
24
|
-
const time = capture('div.col-xs-8').text().substring(0, 19);
|
|
25
|
-
|
|
26
|
-
const single = {
|
|
27
|
-
title,
|
|
28
|
-
link: itemUrl,
|
|
29
|
-
guid: itemUrl,
|
|
30
|
-
description: contents,
|
|
31
|
-
pubDate: new Date(time).toUTCString(),
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
return Promise.resolve(single);
|
|
35
|
-
})
|
|
36
|
-
);
|
|
37
|
-
|
|
38
|
-
ctx.state.data = {
|
|
39
|
-
title: '九江新闻',
|
|
40
|
-
link: host,
|
|
41
|
-
item: out,
|
|
42
|
-
};
|
|
43
|
-
};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
const got = require('@/utils/got');
|
|
2
|
-
const cheerio = require('cheerio');
|
|
3
|
-
|
|
4
|
-
const rootUrl = 'https://www.fulinian.com/';
|
|
5
|
-
|
|
6
|
-
module.exports = async (ctx) => {
|
|
7
|
-
ctx.params.caty = ctx.params.caty || '';
|
|
8
|
-
|
|
9
|
-
const currentUrl = `${rootUrl}/${ctx.params.caty}`;
|
|
10
|
-
const response = await got({
|
|
11
|
-
method: 'get',
|
|
12
|
-
url: currentUrl,
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
const $ = cheerio.load(response.data);
|
|
16
|
-
const list = $('article.excerpt')
|
|
17
|
-
.slice(0, 10)
|
|
18
|
-
.map((_, item) => {
|
|
19
|
-
item = $(item);
|
|
20
|
-
const a = item.find('header h2 a');
|
|
21
|
-
return {
|
|
22
|
-
title: a.text(),
|
|
23
|
-
link: a.attr('href'),
|
|
24
|
-
};
|
|
25
|
-
})
|
|
26
|
-
.get();
|
|
27
|
-
|
|
28
|
-
const items = await Promise.all(
|
|
29
|
-
list.map((item) =>
|
|
30
|
-
ctx.cache.tryGet(item.link, async () => {
|
|
31
|
-
const detailResponse = await got({
|
|
32
|
-
method: 'get',
|
|
33
|
-
url: item.link,
|
|
34
|
-
});
|
|
35
|
-
const content = cheerio.load(detailResponse.data);
|
|
36
|
-
|
|
37
|
-
item.description = content('article.article-content').html();
|
|
38
|
-
item.pubDate = new Date(content('div.article-meta span.item').eq(0).text() + ' GMT+8').toUTCString();
|
|
39
|
-
|
|
40
|
-
return item;
|
|
41
|
-
})
|
|
42
|
-
)
|
|
43
|
-
);
|
|
44
|
-
|
|
45
|
-
ctx.state.data = {
|
|
46
|
-
title: `福利年 - ${$('h1').text()}`,
|
|
47
|
-
link: currentUrl,
|
|
48
|
-
item: items,
|
|
49
|
-
};
|
|
50
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
const cheerio = require('cheerio');
|
|
2
|
-
const got = require('@/utils/got');
|
|
3
|
-
|
|
4
|
-
module.exports = async (ctx) => {
|
|
5
|
-
const sort = ctx.params.sort || 'hot';
|
|
6
|
-
|
|
7
|
-
let baseURL = 'https://gab.com/api/v1/timelines/explore?page=1&sort_by=';
|
|
8
|
-
baseURL += sort === 'hot' ? 'hot' : 'top_today';
|
|
9
|
-
|
|
10
|
-
const response = await got.get(baseURL);
|
|
11
|
-
|
|
12
|
-
const result = await Promise.all(
|
|
13
|
-
response.data.map((item) => {
|
|
14
|
-
const media = item.media_attachments.map((item) => `<img src='${item.url}'>`).join('<br>');
|
|
15
|
-
const $ = cheerio.load(item.content);
|
|
16
|
-
|
|
17
|
-
return {
|
|
18
|
-
title: $.text() || 'Untitled',
|
|
19
|
-
description: item.content + (media && '<br>' + media),
|
|
20
|
-
link: item.url || baseURL,
|
|
21
|
-
pubDate: new Date(item.created_at).toISOString(),
|
|
22
|
-
};
|
|
23
|
-
})
|
|
24
|
-
);
|
|
25
|
-
|
|
26
|
-
ctx.state.data = {
|
|
27
|
-
title: `Gab - Popular posts`,
|
|
28
|
-
link: baseURL,
|
|
29
|
-
item: result,
|
|
30
|
-
};
|
|
31
|
-
};
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
const got = require('@/utils/got');
|
|
2
|
-
const cheerio = require('cheerio');
|
|
3
|
-
|
|
4
|
-
function getNum(str) {
|
|
5
|
-
const result = str.match(/(\d{1,2}).*/);
|
|
6
|
-
if (result) {
|
|
7
|
-
return parseInt(result[1]);
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
function resolveRelativeTime(relativeTime) {
|
|
11
|
-
const result = /\S* · (\d{1,2}天)?(\d{1,2}小时)?(\d{1,2}分钟)?/.exec(relativeTime);
|
|
12
|
-
let day, hour, min;
|
|
13
|
-
if (result[1]) {
|
|
14
|
-
day = getNum(result[1]);
|
|
15
|
-
}
|
|
16
|
-
if (result[2]) {
|
|
17
|
-
hour = getNum(result[2]);
|
|
18
|
-
}
|
|
19
|
-
if (result[3]) {
|
|
20
|
-
min = getNum(result[3]);
|
|
21
|
-
}
|
|
22
|
-
return (((day || 0) * 24 + (hour || 0)) * 60 + (min || 0)) * 60 * 1000;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
module.exports = async (ctx) => {
|
|
26
|
-
const id = ctx.params.id || '';
|
|
27
|
-
|
|
28
|
-
const rootUrl = 'http://youxiputao.com';
|
|
29
|
-
const currentUrl = `${rootUrl}/article${id ? `/index/id/${id}` : ''}`;
|
|
30
|
-
const response = await got({
|
|
31
|
-
method: 'get',
|
|
32
|
-
url: currentUrl,
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
const $ = cheerio.load(response.data);
|
|
36
|
-
|
|
37
|
-
const list = $('.news-info-box')
|
|
38
|
-
.slice(0, 15)
|
|
39
|
-
.map((_, item) => {
|
|
40
|
-
item = $(item);
|
|
41
|
-
const a = item.find('a[title]');
|
|
42
|
-
|
|
43
|
-
return {
|
|
44
|
-
title: a.text(),
|
|
45
|
-
link: `${rootUrl}${a.attr('href')}`,
|
|
46
|
-
pubDate: Date.now() - resolveRelativeTime(item.find('.pull-right').text()),
|
|
47
|
-
};
|
|
48
|
-
})
|
|
49
|
-
.get();
|
|
50
|
-
|
|
51
|
-
const items = await Promise.all(
|
|
52
|
-
list.map((item) =>
|
|
53
|
-
ctx.cache.tryGet(item.link, async () => {
|
|
54
|
-
const detailResponse = await got({
|
|
55
|
-
method: 'get',
|
|
56
|
-
url: item.link,
|
|
57
|
-
});
|
|
58
|
-
const content = cheerio.load(detailResponse.data);
|
|
59
|
-
|
|
60
|
-
item.description = content('.info').html();
|
|
61
|
-
item.author = content('.users-info h4').text();
|
|
62
|
-
|
|
63
|
-
return item;
|
|
64
|
-
})
|
|
65
|
-
)
|
|
66
|
-
);
|
|
67
|
-
|
|
68
|
-
ctx.state.data = {
|
|
69
|
-
title: $('title').text(),
|
|
70
|
-
link: currentUrl,
|
|
71
|
-
item: items,
|
|
72
|
-
};
|
|
73
|
-
};
|
package/lib/routes/gvm/index.js
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
const got = require('got');
|
|
2
|
-
const cheerio = require('cheerio');
|
|
3
|
-
|
|
4
|
-
module.exports = async (ctx) => {
|
|
5
|
-
const category = ctx.params.category || 'newest';
|
|
6
|
-
let suffix = '/newest';
|
|
7
|
-
|
|
8
|
-
const options = {
|
|
9
|
-
newest: '最新文章',
|
|
10
|
-
recommend: '你可能會喜歡',
|
|
11
|
-
opinion: '名家專欄',
|
|
12
|
-
topic: '專題',
|
|
13
|
-
news: '時事熱點',
|
|
14
|
-
politics: '政治',
|
|
15
|
-
society: '社會',
|
|
16
|
-
figure: '人物報導',
|
|
17
|
-
world: '國際',
|
|
18
|
-
world_focus: '全球焦點',
|
|
19
|
-
cross_strait_politics: '兩岸',
|
|
20
|
-
money: '金融理財',
|
|
21
|
-
investment: '投資理財',
|
|
22
|
-
insurance: '保險規劃',
|
|
23
|
-
retire: '退休理財',
|
|
24
|
-
fintech: '金融Fintech',
|
|
25
|
-
real_estate: '房地產',
|
|
26
|
-
economy: '總體經濟',
|
|
27
|
-
tech: '科技',
|
|
28
|
-
tech_trend: '科技趨勢',
|
|
29
|
-
energy: '能源',
|
|
30
|
-
business: '產經',
|
|
31
|
-
industry: '傳產',
|
|
32
|
-
service: '消費服務',
|
|
33
|
-
medical: '生技醫藥',
|
|
34
|
-
family_business_succession: '傳承轉型',
|
|
35
|
-
startup: '創業新創',
|
|
36
|
-
management: '管理',
|
|
37
|
-
agriculture: '農業',
|
|
38
|
-
education: '教育',
|
|
39
|
-
higher_education: '高教',
|
|
40
|
-
technological: '技職',
|
|
41
|
-
parent: '親子教育',
|
|
42
|
-
world_education: '國際文教',
|
|
43
|
-
sports: '體育',
|
|
44
|
-
life: '好享生活',
|
|
45
|
-
art: '時尚設計',
|
|
46
|
-
self_growth: '心靈成長',
|
|
47
|
-
film: '藝文影視',
|
|
48
|
-
travel: '旅遊',
|
|
49
|
-
environment: '環境生態',
|
|
50
|
-
health: '健康',
|
|
51
|
-
food: '美食',
|
|
52
|
-
career: '職場生涯',
|
|
53
|
-
survey: '調查',
|
|
54
|
-
county: '縣市',
|
|
55
|
-
csr: 'CSR',
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
if (category !== 'newest' && category !== 'recommend') {
|
|
59
|
-
suffix = `/category/${category}`;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
const response = await got({
|
|
63
|
-
method: 'get',
|
|
64
|
-
url: 'https://www.gvm.com.tw' + suffix,
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
const $ = cheerio.load(response.body);
|
|
68
|
-
|
|
69
|
-
const articles = $('#article_list .article-list-item .article-list-item__intro')
|
|
70
|
-
.map((index, ele) => ({
|
|
71
|
-
title: $('a', ele).text(),
|
|
72
|
-
link: $('a', ele).attr('href'),
|
|
73
|
-
pubDate: new Date($('.time', ele).text()),
|
|
74
|
-
author: $('.author', ele).text(),
|
|
75
|
-
}))
|
|
76
|
-
.get();
|
|
77
|
-
|
|
78
|
-
const item = await Promise.all(
|
|
79
|
-
articles.map((item) =>
|
|
80
|
-
ctx.cache.tryGet(item.link, async () => {
|
|
81
|
-
const res = await got.get(item.link);
|
|
82
|
-
const content = cheerio.load(res.body);
|
|
83
|
-
item.description = content('.article-content').html();
|
|
84
|
-
return item;
|
|
85
|
-
})
|
|
86
|
-
)
|
|
87
|
-
);
|
|
88
|
-
|
|
89
|
-
ctx.state.data = {
|
|
90
|
-
title: `遠見 - ${options[category]}`,
|
|
91
|
-
link: 'https://www.gvm.com.tw' + suffix,
|
|
92
|
-
item,
|
|
93
|
-
};
|
|
94
|
-
};
|
package/lib/routes/hkcd/pdf.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
const got = require('@/utils/got');
|
|
2
|
-
const cheerio = require('cheerio');
|
|
3
|
-
const iconv = require('iconv-lite');
|
|
4
|
-
|
|
5
|
-
module.exports = async (ctx) => {
|
|
6
|
-
const rootUrl = 'http://hk.hkcd.com';
|
|
7
|
-
const currentUrl = `${rootUrl}/pdf/index.htm`;
|
|
8
|
-
const response = await got({
|
|
9
|
-
method: 'get',
|
|
10
|
-
url: currentUrl,
|
|
11
|
-
responseType: 'buffer',
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
const data = iconv.decode(response.data, 'gb2312');
|
|
15
|
-
const date = data.match(/<td align="right"><font color="#FFFFFF">(.*)/)[1];
|
|
16
|
-
const $ = cheerio.load(data.replace('<table width="177" border="0" cellspacing="1" cellpadding="0"', '<table id="content" width="177" border="0" cellspacing="1" cellpadding="0"'));
|
|
17
|
-
|
|
18
|
-
ctx.state.data = {
|
|
19
|
-
title: '香港商报PDF版',
|
|
20
|
-
link: currentUrl,
|
|
21
|
-
item: [
|
|
22
|
-
{
|
|
23
|
-
title: date,
|
|
24
|
-
link: currentUrl,
|
|
25
|
-
description: $('#content').html(),
|
|
26
|
-
pubDate: new Date(date.replace(/年|月/g, '-').replace(/日/, '')).toUTCString(),
|
|
27
|
-
},
|
|
28
|
-
],
|
|
29
|
-
};
|
|
30
|
-
};
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
const got = require('@/utils/got');
|
|
2
|
-
const cheerio = require('cheerio');
|
|
3
|
-
|
|
4
|
-
const titles = {
|
|
5
|
-
'': '眾聞',
|
|
6
|
-
13: '經濟',
|
|
7
|
-
15: '社會',
|
|
8
|
-
14: '生活',
|
|
9
|
-
12: '政治',
|
|
10
|
-
16: '國際',
|
|
11
|
-
20: '台灣',
|
|
12
|
-
21: '人物',
|
|
13
|
-
19: '中國',
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
module.exports = async (ctx) => {
|
|
17
|
-
const category = ctx.params.category || '';
|
|
18
|
-
|
|
19
|
-
const rootUrl = 'https://www.hkcnews.com';
|
|
20
|
-
const apiUrl = `${rootUrl}/data/newsposts${category === '' ? '' : `/${category}`}?page=1`;
|
|
21
|
-
const response = await got({
|
|
22
|
-
method: 'get',
|
|
23
|
-
url: apiUrl,
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
const list = response.data.items.map((item) => {
|
|
27
|
-
const $ = cheerio.load(item);
|
|
28
|
-
const news = $('.article-block-body a');
|
|
29
|
-
const date = $('.line').eq(1).text().split('.').reverse().join('-');
|
|
30
|
-
|
|
31
|
-
return {
|
|
32
|
-
title: news.text(),
|
|
33
|
-
link: `${rootUrl}${news.attr('href')}`,
|
|
34
|
-
pubDate: new Date(date.length === 8 ? `${new Date().getFullYear().toString().slice(0, 2)}${date}` : date).toUTCString(),
|
|
35
|
-
};
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
const items = await Promise.all(
|
|
39
|
-
list.map((item) =>
|
|
40
|
-
ctx.cache.tryGet(item.link, async () => {
|
|
41
|
-
const detailResponse = await got({
|
|
42
|
-
method: 'get',
|
|
43
|
-
url: item.link,
|
|
44
|
-
});
|
|
45
|
-
const content = cheerio.load(detailResponse.data);
|
|
46
|
-
|
|
47
|
-
item.description = content('.article-content').html();
|
|
48
|
-
// substring 2 times
|
|
49
|
-
// from https://hkcnews.com/article/47878/loreal歐萊雅-薇婭-李佳琦-47884/薇婭、李佳琦幫loreal帶貨引價格爭議-loreal道歉
|
|
50
|
-
// to https://hkcnews.com/article/47878
|
|
51
|
-
item.guid = item.link.substring(0, item.link.lastIndexOf('/')).substring(0, item.link.substring(0, item.link.lastIndexOf('/')).lastIndexOf('/'));
|
|
52
|
-
|
|
53
|
-
return item;
|
|
54
|
-
})
|
|
55
|
-
)
|
|
56
|
-
);
|
|
57
|
-
|
|
58
|
-
ctx.state.data = {
|
|
59
|
-
title: `眾新聞 - ${titles[category]}`,
|
|
60
|
-
link: `${rootUrl}/news${category === '' ? '' : `/${category}/${titles[category]}`}`,
|
|
61
|
-
item: items,
|
|
62
|
-
};
|
|
63
|
-
};
|