From 442d68e1895e02f1b1580d9d7831a35a8a06e293 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Tue, 19 Dec 2023 00:49:24 +0800 Subject: [PATCH] feat: remove notOperational routes - new media --- assets/radar-rules.js | 20 - lib/radar-rules.js | 55 - lib/router.js | 205 +--- lib/routes/199it/category.js | 2 +- lib/routes/199it/tag.js | 2 +- lib/routes/199it/utils.js | 2 +- lib/routes/8btc/author.js | 49 - lib/routes/8btc/news/flash.js | 41 - lib/routes/93/index.js | 50 - lib/routes/allnow/column.js | 7 - lib/routes/allnow/index.js | 5 - lib/routes/allnow/tag.js | 7 - lib/routes/allnow/user.js | 7 - lib/routes/allnow/utils.js | 67 -- lib/routes/baidu/daily.js | 55 - lib/routes/bell-labs/events-news.js | 70 -- lib/routes/bioon/latest.js | 51 - lib/routes/bishijie/kuaixun.js | 21 - lib/routes/bof/home.js | 42 - lib/routes/buaq/index.js | 31 - lib/routes/cgtn/pick.js | 45 - lib/routes/cgtn/top.js | 45 - lib/routes/chinalaborwatch/reports.js | 53 - lib/routes/cmes/news.js | 64 - lib/routes/commonapp/blog.js | 42 - lib/routes/cria/news.js | 57 - lib/routes/dayone/blog.js | 56 - lib/routes/donews/index.js | 59 - lib/routes/donews/utils.js | 19 - lib/routes/dsb/area.js | 33 - lib/routes/dxy/vaccine.js | 109 -- lib/routes/esquirehk/tag.js | 71 -- lib/routes/feixuew/index.js | 63 - lib/routes/fulinian/index.js | 50 - lib/routes/gamegrape/index.js | 73 -- lib/routes/gvm/index.js | 94 -- lib/routes/hkcnews/news.js | 63 - lib/routes/hkgolden/index.js | 110 -- lib/routes/iea/index.js | 53 - lib/routes/iie/blog.js | 47 - lib/routes/imaijia/category.js | 63 - lib/routes/itjuzi/invest.js | 32 - lib/routes/itjuzi/merge.js | 32 - lib/routes/iyiou/index.js | 41 - lib/routes/jiazhen108/index.js | 47 - lib/routes/jinritoutiao/keyword.js | 27 - lib/routes/juesheng/index.js | 49 - lib/routes/krankenkassen/index.js | 54 - lib/routes/kzfeed/topic.js | 122 -- lib/routes/makeuseof/index.js | 59 - lib/routes/matataki/site/posts/author.js | 17 - lib/routes/matataki/site/posts/favorite.js | 42 - .../matataki/site/posts/scoreranking.js | 15 - lib/routes/matataki/site/posts/tag.js | 16 - lib/routes/matataki/site/posts/timeranking.js | 15 - lib/routes/matataki/site/posts/token.js | 18 - lib/routes/matataki/utils/matataki-utils.js | 125 -- lib/routes/mitbbs/index.js | 54 - lib/routes/nba/app_news.js | 40 - lib/routes/northhouse/index.js | 54 - lib/routes/or/index.js | 54 - lib/routes/partnershiponai/resources.js | 49 - lib/routes/pintu360/index.js | 54 - lib/routes/plainlaw/archives.js | 42 - lib/routes/pmcaff/user.js | 56 - lib/routes/polar/blog.js | 47 - lib/routes/popyard/index.js | 93 -- lib/routes/sixthtone/news.js | 52 - lib/routes/socialbeta/hunt.js | 29 - lib/routes/soomal/topics.js | 130 -- lib/routes/tam/forecast.js | 53 - lib/routes/tanwu/products.js | 27 - lib/routes/tencent/guyu/channel.js | 64 - lib/routes/thrillist/index.js | 67 -- lib/routes/tuicool/mags.js | 41 - lib/routes/voa/day-photos.js | 54 - lib/routes/whalegogo/home.js | 43 - lib/routes/whalegogo/portal.js | 57 - lib/routes/xici/index.js | 33 - lib/routes/yicas/blog.js | 52 - lib/routes/yidoutang/index.js | 33 - lib/routes/zfrontier/board_postlist.js | 36 - lib/routes/zfrontier/postlist.js | 33 - lib/routes/zzz/index.js | 59 - lib/v2/9to5/utils.js | 2 +- lib/v2/aeon/utils.js | 2 +- lib/v2/agirls/maintainer.js | 1 - lib/v2/agirls/radar.js | 6 - lib/v2/agirls/router.js | 1 - lib/v2/agirls/topic.js | 44 - lib/v2/allrecode/index.js | 65 - lib/v2/allrecode/maintainer.js | 5 - lib/v2/allrecode/news.js | 35 - lib/v2/allrecode/radar.js | 25 - lib/v2/allrecode/router.js | 4 - lib/v2/baijing/index.js | 54 - lib/v2/baijing/maintainer.js | 3 - lib/v2/baijing/radar.js | 22 - lib/v2/baijing/router.js | 3 - lib/v2/dahecube/index.js | 2 +- lib/v2/diandong/ddh.js | 51 - lib/v2/diandong/maintainer.js | 1 - lib/v2/diandong/radar.js | 6 - lib/v2/diandong/router.js | 1 - lib/v2/disinformationindex/blog.js | 48 - lib/v2/disinformationindex/maintainer.js | 4 - lib/v2/disinformationindex/radar.js | 19 - lib/v2/disinformationindex/research.js | 45 - lib/v2/disinformationindex/router.js | 4 - .../templates/description.art | 7 - lib/v2/dx2025/radar.js | 6 - lib/v2/eet-china/maintainer.js | 4 - lib/v2/eet-china/mp/index.js | 10 - lib/v2/eet-china/mp/tags.js | 10 - lib/v2/eet-china/mp/util.js | 67 -- lib/v2/eet-china/radar.js | 24 - lib/v2/eet-china/router.js | 4 - lib/v2/ezone/index.js | 70 -- lib/v2/ezone/maintainer.js | 3 - lib/v2/ezone/radar.js | 13 - lib/v2/ezone/router.js | 3 - lib/v2/filmdeepfocus/index.js | 58 - lib/v2/filmdeepfocus/maintainer.js | 3 - lib/v2/filmdeepfocus/radar.js | 13 - lib/v2/filmdeepfocus/router.js | 3 - lib/v2/good/index.js | 53 - lib/v2/good/maintainer.js | 3 - lib/v2/good/radar.js | 13 - lib/v2/good/router.js | 3 - lib/v2/gq/maintainer.js | 3 - lib/v2/gq/radar.js | 13 - lib/v2/gq/router.js | 3 - lib/v2/gq/templates/embed-article.art | 1 - lib/v2/gq/templates/embed-product.art | 4 - lib/v2/gq/templates/img.art | 6 - lib/v2/gq/templates/tw.art | 3 - lib/v2/gq/templates/videoObject.art | 6 - lib/v2/gq/templates/youtube.art | 3 - lib/v2/gq/tw/index.js | 165 --- lib/v2/guandian/index.js | 37 - lib/v2/guandian/maintainer.js | 3 - lib/v2/guandian/radar.js | 13 - lib/v2/guandian/router.js | 3 - lib/v2/gzh360/_README | 1 - lib/v2/gzh360/category.js | 8 - lib/v2/gzh360/gzh.js | 18 - lib/v2/gzh360/maintainer.js | 4 - lib/v2/gzh360/radar.js | 19 - lib/v2/gzh360/router.js | 4 - lib/v2/gzh360/universal.js | 53 - lib/v2/gzh360/utils.js | 62 - lib/v2/hellobtc/maintainer.js | 1 - lib/v2/hellobtc/radar.js | 6 - lib/v2/hellobtc/router.js | 1 - lib/v2/hellobtc/topic.js | 43 - lib/v2/hotchina/index.js | 55 - lib/v2/hotchina/maintainer.js | 5 - lib/v2/hotchina/radar.js | 25 - lib/v2/hotchina/router.js | 3 - lib/v2/islander/maintainer.js | 4 - lib/v2/islander/radar.js | 19 - lib/v2/islander/router.js | 4 - lib/v2/islander/search.js | 33 - lib/v2/islander/top30event.js | 28 - lib/v2/knowmedia/index.js | 38 - lib/v2/knowmedia/maintainer.js | 3 - lib/v2/knowmedia/radar.js | 31 - lib/v2/knowmedia/router.js | 3 - lib/v2/knowmedia/templates/desc.art | 3 - lib/v2/kuwaitlocal/index.js | 47 - lib/v2/kuwaitlocal/maintainer.js | 4 - lib/v2/kuwaitlocal/radar.js | 19 - lib/v2/kuwaitlocal/router.js | 3 - lib/v2/mclaren/index.js | 96 -- lib/v2/mclaren/maintainer.js | 3 - lib/v2/mclaren/radar.js | 29 - lib/v2/mclaren/router.js | 3 - lib/v2/mclaren/templates/desc.art | 6 - lib/v2/pmthinking/index.js | 61 - lib/v2/pmthinking/maintainer.js | 3 - lib/v2/pmthinking/radar.js | 13 - lib/v2/pmthinking/router.js | 3 - lib/v2/pmthinking/templates/description.art | 4 - lib/v2/qdaily/index.js | 87 -- lib/v2/qdaily/maintainer.js | 3 - lib/v2/qdaily/radar.js | 25 - lib/v2/qdaily/router.js | 3 - lib/v2/qdaily/templates/article.art | 5 - lib/v2/qianp/maintainer.js | 3 - lib/v2/qianp/news.js | 48 - lib/v2/qianp/radar.js | 13 - lib/v2/qianp/router.js | 3 - lib/v2/shuiguopai/index.js | 80 -- lib/v2/shuiguopai/maintainer.js | 3 - lib/v2/shuiguopai/radar.js | 13 - lib/v2/shuiguopai/router.js | 3 - lib/v2/shuiguopai/templates/description.art | 8 - lib/v2/thenewslens/radar.js | 6 - lib/v2/thoughtco/index.js | 2 +- lib/v2/twreporter/category.js | 40 - lib/v2/twreporter/maintainer.js | 2 - lib/v2/twreporter/photography.js | 46 - lib/v2/twreporter/radar.js | 12 - lib/v2/twreporter/router.js | 2 - lib/v2/verse/articles.js | 42 - lib/v2/verse/maintainer.js | 3 - lib/v2/verse/radar.js | 13 - lib/v2/verse/router.js | 3 - lib/v2/watchout/index.js | 51 - lib/v2/watchout/maintainer.js | 3 - lib/v2/watchout/radar.js | 13 - lib/v2/watchout/router.js | 3 - lib/v2/worldjournal/index.js | 2 +- lib/v2/woshipm/bookmarks.js | 34 - lib/v2/woshipm/latest.js | 27 - lib/v2/woshipm/maintainer.js | 2 - lib/v2/woshipm/radar.js | 12 - lib/v2/woshipm/router.js | 2 - lib/v2/wp-china/maintainer.js | 3 - lib/v2/wp-china/news.js | 56 - lib/v2/wp-china/radar.js | 13 - lib/v2/wp-china/router.js | 3 - lib/v2/wxkol/maintainer.js | 3 - lib/v2/wxkol/radar.js | 13 - lib/v2/wxkol/router.js | 3 - lib/v2/wxkol/show.js | 81 -- lib/v2/yaohuo/index.js | 30 - lib/v2/yaohuo/maintainer.js | 3 - lib/v2/yaohuo/radar.js | 13 - lib/v2/yaohuo/router.js | 3 - lib/v2/yunspe/maintainer.js | 3 - lib/v2/yunspe/newsflash.js | 42 - lib/v2/yunspe/radar.js | 13 - lib/v2/yunspe/router.js | 3 - website/docs/routes/new-media.mdx | 1050 +---------------- 235 files changed, 30 insertions(+), 7951 deletions(-) delete mode 100644 lib/routes/8btc/author.js delete mode 100644 lib/routes/8btc/news/flash.js delete mode 100644 lib/routes/93/index.js delete mode 100644 lib/routes/allnow/column.js delete mode 100644 lib/routes/allnow/index.js delete mode 100644 lib/routes/allnow/tag.js delete mode 100644 lib/routes/allnow/user.js delete mode 100644 lib/routes/allnow/utils.js delete mode 100644 lib/routes/baidu/daily.js delete mode 100644 lib/routes/bell-labs/events-news.js delete mode 100644 lib/routes/bioon/latest.js delete mode 100644 lib/routes/bishijie/kuaixun.js delete mode 100644 lib/routes/bof/home.js delete mode 100644 lib/routes/buaq/index.js delete mode 100644 lib/routes/cgtn/pick.js delete mode 100644 lib/routes/cgtn/top.js delete mode 100644 lib/routes/chinalaborwatch/reports.js delete mode 100644 lib/routes/cmes/news.js delete mode 100644 lib/routes/commonapp/blog.js delete mode 100644 lib/routes/cria/news.js delete mode 100644 lib/routes/dayone/blog.js delete mode 100644 lib/routes/donews/index.js delete mode 100644 lib/routes/donews/utils.js delete mode 100644 lib/routes/dsb/area.js delete mode 100644 lib/routes/dxy/vaccine.js delete mode 100644 lib/routes/esquirehk/tag.js delete mode 100644 lib/routes/feixuew/index.js delete mode 100644 lib/routes/fulinian/index.js delete mode 100644 lib/routes/gamegrape/index.js delete mode 100644 lib/routes/gvm/index.js delete mode 100644 lib/routes/hkcnews/news.js delete mode 100644 lib/routes/hkgolden/index.js delete mode 100644 lib/routes/iea/index.js delete mode 100644 lib/routes/iie/blog.js delete mode 100644 lib/routes/imaijia/category.js delete mode 100644 lib/routes/itjuzi/invest.js delete mode 100644 lib/routes/itjuzi/merge.js delete mode 100644 lib/routes/iyiou/index.js delete mode 100644 lib/routes/jiazhen108/index.js delete mode 100644 lib/routes/jinritoutiao/keyword.js delete mode 100644 lib/routes/juesheng/index.js delete mode 100644 lib/routes/krankenkassen/index.js delete mode 100644 lib/routes/kzfeed/topic.js delete mode 100644 lib/routes/makeuseof/index.js delete mode 100644 lib/routes/matataki/site/posts/author.js delete mode 100644 lib/routes/matataki/site/posts/favorite.js delete mode 100644 lib/routes/matataki/site/posts/scoreranking.js delete mode 100644 lib/routes/matataki/site/posts/tag.js delete mode 100644 lib/routes/matataki/site/posts/timeranking.js delete mode 100644 lib/routes/matataki/site/posts/token.js delete mode 100644 lib/routes/matataki/utils/matataki-utils.js delete mode 100644 lib/routes/mitbbs/index.js delete mode 100644 lib/routes/nba/app_news.js delete mode 100644 lib/routes/northhouse/index.js delete mode 100644 lib/routes/or/index.js delete mode 100644 lib/routes/partnershiponai/resources.js delete mode 100644 lib/routes/pintu360/index.js delete mode 100644 lib/routes/plainlaw/archives.js delete mode 100644 lib/routes/pmcaff/user.js delete mode 100644 lib/routes/polar/blog.js delete mode 100644 lib/routes/popyard/index.js delete mode 100644 lib/routes/sixthtone/news.js delete mode 100644 lib/routes/socialbeta/hunt.js delete mode 100644 lib/routes/soomal/topics.js delete mode 100644 lib/routes/tam/forecast.js delete mode 100644 lib/routes/tanwu/products.js delete mode 100644 lib/routes/tencent/guyu/channel.js delete mode 100644 lib/routes/thrillist/index.js delete mode 100644 lib/routes/tuicool/mags.js delete mode 100644 lib/routes/voa/day-photos.js delete mode 100644 lib/routes/whalegogo/home.js delete mode 100644 lib/routes/whalegogo/portal.js delete mode 100644 lib/routes/xici/index.js delete mode 100644 lib/routes/yicas/blog.js delete mode 100644 lib/routes/yidoutang/index.js delete mode 100644 lib/routes/zfrontier/board_postlist.js delete mode 100644 lib/routes/zfrontier/postlist.js delete mode 100644 lib/routes/zzz/index.js delete mode 100644 lib/v2/agirls/topic.js delete mode 100644 lib/v2/allrecode/index.js delete mode 100644 lib/v2/allrecode/maintainer.js delete mode 100644 lib/v2/allrecode/news.js delete mode 100644 lib/v2/allrecode/radar.js delete mode 100644 lib/v2/allrecode/router.js delete mode 100644 lib/v2/baijing/index.js delete mode 100644 lib/v2/baijing/maintainer.js delete mode 100644 lib/v2/baijing/radar.js delete mode 100644 lib/v2/baijing/router.js delete mode 100644 lib/v2/diandong/ddh.js delete mode 100644 lib/v2/disinformationindex/blog.js delete mode 100644 lib/v2/disinformationindex/maintainer.js delete mode 100644 lib/v2/disinformationindex/radar.js delete mode 100644 lib/v2/disinformationindex/research.js delete mode 100644 lib/v2/disinformationindex/router.js delete mode 100644 lib/v2/disinformationindex/templates/description.art delete mode 100644 lib/v2/eet-china/maintainer.js delete mode 100644 lib/v2/eet-china/mp/index.js delete mode 100644 lib/v2/eet-china/mp/tags.js delete mode 100644 lib/v2/eet-china/mp/util.js delete mode 100644 lib/v2/eet-china/radar.js delete mode 100644 lib/v2/eet-china/router.js delete mode 100644 lib/v2/ezone/index.js delete mode 100644 lib/v2/ezone/maintainer.js delete mode 100644 lib/v2/ezone/radar.js delete mode 100644 lib/v2/ezone/router.js delete mode 100644 lib/v2/filmdeepfocus/index.js delete mode 100644 lib/v2/filmdeepfocus/maintainer.js delete mode 100644 lib/v2/filmdeepfocus/radar.js delete mode 100644 lib/v2/filmdeepfocus/router.js delete mode 100644 lib/v2/good/index.js delete mode 100644 lib/v2/good/maintainer.js delete mode 100644 lib/v2/good/radar.js delete mode 100644 lib/v2/good/router.js delete mode 100644 lib/v2/gq/maintainer.js delete mode 100644 lib/v2/gq/radar.js delete mode 100644 lib/v2/gq/router.js delete mode 100644 lib/v2/gq/templates/embed-article.art delete mode 100644 lib/v2/gq/templates/embed-product.art delete mode 100644 lib/v2/gq/templates/img.art delete mode 100644 lib/v2/gq/templates/tw.art delete mode 100644 lib/v2/gq/templates/videoObject.art delete mode 100644 lib/v2/gq/templates/youtube.art delete mode 100644 lib/v2/gq/tw/index.js delete mode 100644 lib/v2/guandian/index.js delete mode 100644 lib/v2/guandian/maintainer.js delete mode 100644 lib/v2/guandian/radar.js delete mode 100644 lib/v2/guandian/router.js delete mode 100644 lib/v2/gzh360/_README delete mode 100644 lib/v2/gzh360/category.js delete mode 100644 lib/v2/gzh360/gzh.js delete mode 100644 lib/v2/gzh360/maintainer.js delete mode 100644 lib/v2/gzh360/radar.js delete mode 100644 lib/v2/gzh360/router.js delete mode 100644 lib/v2/gzh360/universal.js delete mode 100644 lib/v2/gzh360/utils.js delete mode 100644 lib/v2/hellobtc/topic.js delete mode 100644 lib/v2/hotchina/index.js delete mode 100644 lib/v2/hotchina/maintainer.js delete mode 100644 lib/v2/hotchina/radar.js delete mode 100644 lib/v2/hotchina/router.js delete mode 100644 lib/v2/islander/maintainer.js delete mode 100644 lib/v2/islander/radar.js delete mode 100644 lib/v2/islander/router.js delete mode 100644 lib/v2/islander/search.js delete mode 100644 lib/v2/islander/top30event.js delete mode 100644 lib/v2/knowmedia/index.js delete mode 100644 lib/v2/knowmedia/maintainer.js delete mode 100644 lib/v2/knowmedia/radar.js delete mode 100644 lib/v2/knowmedia/router.js delete mode 100644 lib/v2/knowmedia/templates/desc.art delete mode 100644 lib/v2/kuwaitlocal/index.js delete mode 100644 lib/v2/kuwaitlocal/maintainer.js delete mode 100644 lib/v2/kuwaitlocal/radar.js delete mode 100644 lib/v2/kuwaitlocal/router.js delete mode 100644 lib/v2/mclaren/index.js delete mode 100644 lib/v2/mclaren/maintainer.js delete mode 100644 lib/v2/mclaren/radar.js delete mode 100644 lib/v2/mclaren/router.js delete mode 100644 lib/v2/mclaren/templates/desc.art delete mode 100644 lib/v2/pmthinking/index.js delete mode 100644 lib/v2/pmthinking/maintainer.js delete mode 100644 lib/v2/pmthinking/radar.js delete mode 100644 lib/v2/pmthinking/router.js delete mode 100644 lib/v2/pmthinking/templates/description.art delete mode 100644 lib/v2/qdaily/index.js delete mode 100644 lib/v2/qdaily/maintainer.js delete mode 100644 lib/v2/qdaily/radar.js delete mode 100644 lib/v2/qdaily/router.js delete mode 100644 lib/v2/qdaily/templates/article.art delete mode 100644 lib/v2/qianp/maintainer.js delete mode 100644 lib/v2/qianp/news.js delete mode 100644 lib/v2/qianp/radar.js delete mode 100644 lib/v2/qianp/router.js delete mode 100644 lib/v2/shuiguopai/index.js delete mode 100644 lib/v2/shuiguopai/maintainer.js delete mode 100644 lib/v2/shuiguopai/radar.js delete mode 100644 lib/v2/shuiguopai/router.js delete mode 100644 lib/v2/shuiguopai/templates/description.art delete mode 100644 lib/v2/twreporter/category.js delete mode 100644 lib/v2/twreporter/photography.js delete mode 100644 lib/v2/verse/articles.js delete mode 100644 lib/v2/verse/maintainer.js delete mode 100644 lib/v2/verse/radar.js delete mode 100644 lib/v2/verse/router.js delete mode 100644 lib/v2/watchout/index.js delete mode 100644 lib/v2/watchout/maintainer.js delete mode 100644 lib/v2/watchout/radar.js delete mode 100644 lib/v2/watchout/router.js delete mode 100644 lib/v2/woshipm/bookmarks.js delete mode 100644 lib/v2/woshipm/latest.js delete mode 100644 lib/v2/wp-china/maintainer.js delete mode 100644 lib/v2/wp-china/news.js delete mode 100644 lib/v2/wp-china/radar.js delete mode 100644 lib/v2/wp-china/router.js delete mode 100644 lib/v2/wxkol/maintainer.js delete mode 100644 lib/v2/wxkol/radar.js delete mode 100644 lib/v2/wxkol/router.js delete mode 100644 lib/v2/wxkol/show.js delete mode 100644 lib/v2/yaohuo/index.js delete mode 100644 lib/v2/yaohuo/maintainer.js delete mode 100644 lib/v2/yaohuo/radar.js delete mode 100644 lib/v2/yaohuo/router.js delete mode 100644 lib/v2/yunspe/maintainer.js delete mode 100644 lib/v2/yunspe/newsflash.js delete mode 100644 lib/v2/yunspe/radar.js delete mode 100644 lib/v2/yunspe/router.js diff --git a/assets/radar-rules.js b/assets/radar-rules.js index 3efaa733017636..b25731c043a9ae 100644 --- a/assets/radar-rules.js +++ b/assets/radar-rules.js @@ -346,27 +346,7 @@ }, ], }, - 'buaq.net': { _name: '不安全资讯', '.': [{ title: '不安全资讯', docs: 'http://docs.rsshub.app/routes/new-media#bu-an-quan', source: '/', target: '/buaq' }] }, 'jian-ning.com': { _name: '建宁闲谈', '.': [{ title: '文章', docs: 'https://docs.rsshub.app/routes/blog#jian-ning-xian-tan', source: '/*', target: '/blogs/jianning' }] }, - 'matataki.io': { - _name: 'matataki', - www: [ - { title: '最热作品', docs: 'https://docs.rsshub.app/routes/new-media#matataki', source: '/article/', target: '/matataki/posts/hot' }, - { title: '最新作品', docs: 'https://docs.rsshub.app/routes/new-media#matataki', source: '/article/latest', target: '/matataki/posts/latest' }, - { title: '作者创作', docs: 'https://docs.rsshub.app/routes/new-media#matataki', source: '/user/:uid', target: (params) => `/matataki/users/${params.uid}/posts` }, - { title: 'Fan票关联作品', docs: 'https://docs.rsshub.app/routes/new-media#matataki', source: ['/token/:tokenId', '/token/:tokenId/circle'], target: (params) => `/matataki/tokens/${params.tokenId}/posts` }, - { - title: '标签关联作品', - docs: 'https://docs.rsshub.app/routes/new-media#matataki', - source: ['/tag/:tagId'], - target: (params, url) => { - const tagName = new URL(url).searchParams.get('name'); - return `/matataki/tags/${params.tagId}/${tagName}/posts`; - }, - }, - { title: '收藏夹', docs: 'https://docs.rsshub.app/routes/new-media#matataki', source: '/user/:uid/favlist/:fid', target: (params) => `/matataki/users/${params.uid}/favorites/${params.fid}/posts` }, - ], - }, 'eventernote.com': { _name: 'Eventernote', www: [{ title: '声优活动及演唱会', docs: 'https://docs.rsshub.app/routes/anime#eventernote', source: '/actors/:name/:id/events', target: '/eventernote/actors/:name/:id' }] }, 'huya.com': { _name: '虎牙直播', '.': [{ title: '直播间开播', docs: 'https://docs.rsshub.app/routes/live#hu-ya-zhi-bo-zhi-bo-jian-kai-bo', source: '/:id', target: '/huya/live/:id' }] }, 'craigslist.org': { _name: 'Craigslist', '.': [{ title: '商品搜索列表', docs: 'https://docs.rsshub.app/routes/shopping#craigslist' }] }, diff --git a/lib/radar-rules.js b/lib/radar-rules.js index 4a54c681eae28a..bb6356062e3d26 100644 --- a/lib/radar-rules.js +++ b/lib/radar-rules.js @@ -925,17 +925,6 @@ module.exports = { }, ], }, - 'buaq.net': { - _name: '不安全资讯', - '.': [ - { - title: '不安全资讯', - docs: 'http://docs.rsshub.app/routes/new-media#bu-an-quan', - source: '/', - target: '/buaq', - }, - ], - }, 'jian-ning.com': { _name: '建宁闲谈', '.': [ @@ -947,50 +936,6 @@ module.exports = { }, ], }, - 'matataki.io': { - _name: 'matataki', - www: [ - { - title: '最热作品', - docs: 'https://docs.rsshub.app/routes/new-media#matataki', - source: '/article/', - target: '/matataki/posts/hot', - }, - { - title: '最新作品', - docs: 'https://docs.rsshub.app/routes/new-media#matataki', - source: '/article/latest', - target: '/matataki/posts/latest', - }, - { - title: '作者创作', - docs: 'https://docs.rsshub.app/routes/new-media#matataki', - source: '/user/:uid', - target: (params) => `/matataki/users/${params.uid}/posts`, - }, - { - title: 'Fan票关联作品', - docs: 'https://docs.rsshub.app/routes/new-media#matataki', - source: ['/token/:tokenId', '/token/:tokenId/circle'], - target: (params) => `/matataki/tokens/${params.tokenId}/posts`, - }, - { - title: '标签关联作品', - docs: 'https://docs.rsshub.app/routes/new-media#matataki', - source: ['/tag/:tagId'], - target: (params, url) => { - const tagName = new URL(url).searchParams.get('name'); - return `/matataki/tags/${params.tagId}/${tagName}/posts`; - }, - }, - { - title: '收藏夹', - docs: 'https://docs.rsshub.app/routes/new-media#matataki', - source: '/user/:uid/favlist/:fid', - target: (params) => `/matataki/users/${params.uid}/favorites/${params.fid}/posts`, - }, - ], - }, 'huya.com': { _name: '虎牙直播', '.': [ diff --git a/lib/router.js b/lib/router.js index 0443025b3b253a..fcb036837fc866 100644 --- a/lib/router.js +++ b/lib/router.js @@ -40,9 +40,6 @@ router.get('/mzitu/tag/:tag', lazyloadRouteHandler('./routes/mzitu/tag')); // pixiv-fanbox router.get('/fanbox/:user?', lazyloadRouteHandler('./routes/fanbox/main')); -// 法律白話文運動 -router.get('/plainlaw/archives', lazyloadRouteHandler('./routes/plainlaw/archives.js')); - // Dockone router.get('/dockone/weekly', lazyloadRouteHandler('./routes/dockone/weekly')); @@ -51,9 +48,6 @@ router.get('/zcfy', lazyloadRouteHandler('./routes/zcfy/index')); router.get('/zcfy/index', lazyloadRouteHandler('./routes/zcfy/index')); // 废弃 router.get('/zcfy/hot', lazyloadRouteHandler('./routes/zcfy/hot')); -// 今日头条 -router.get('/jinritoutiao/keyword/:keyword', lazyloadRouteHandler('./routes/jinritoutiao/keyword')); - // Disqus router.get('/disqus/posts/:forum', lazyloadRouteHandler('./routes/disqus/posts')); @@ -131,9 +125,6 @@ router.get('/one', lazyloadRouteHandler('./routes/one/index')); // Thunderbird router.get('/thunderbird/release', lazyloadRouteHandler('./routes/thunderbird/release')); -// tuicool -router.get('/tuicool/mags/:type', lazyloadRouteHandler('./routes/tuicool/mags')); - // Hexo router.get('/hexo/next/:url', lazyloadRouteHandler('./routes/hexo/next')); router.get('/hexo/yilia/:url', lazyloadRouteHandler('./routes/hexo/yilia')); @@ -169,9 +160,6 @@ router.get('/wikipedia/mainland', lazyloadRouteHandler('./routes/wikipedia/mainl // 联合国 United Nations router.get('/un/scveto', lazyloadRouteHandler('./routes/un/scveto')); -// e 公司 -// router.get('/egsea/flash', lazyloadRouteHandler('./routes/egsea/flash')); - // 选股宝 router.get('/xuangubao/subject/:subject_id', lazyloadRouteHandler('./routes/xuangubao/subject')); @@ -493,7 +481,6 @@ router.get('/geekpark/breakingnews', lazyloadRouteHandler('./routes/geekpark/bre // 百度 router.get('/baidu/doodles', lazyloadRouteHandler('./routes/baidu/doodles')); // router.get('/baidu/topwords/:boardId?', lazyloadRouteHandler('./routes/baidu/topwords')); -router.get('/baidu/daily', lazyloadRouteHandler('./routes/baidu/daily')); // 搜狗 router.get('/sogou/doodles', lazyloadRouteHandler('./routes/sogou/doodles')); @@ -513,13 +500,6 @@ router.get('/gnn/gnn', lazyloadRouteHandler('./routes/gnn/gnn')); // a9vg游戏新闻 router.get('/a9vg/a9vg', lazyloadRouteHandler('./routes/a9vg/a9vg')); -// IT桔子 -router.get('/itjuzi/invest', lazyloadRouteHandler('./routes/itjuzi/invest')); -router.get('/itjuzi/merge', lazyloadRouteHandler('./routes/itjuzi/merge')); - -// 探物 -router.get('/tanwu/products', lazyloadRouteHandler('./routes/tanwu/products')); - // GitChat router.get('/gitchat/newest/:category?/:selected?', lazyloadRouteHandler('./routes/gitchat/newest')); @@ -607,7 +587,6 @@ router.get('/tingdiantz/95598/:province/:city/:district?', lazyloadRouteHandler( // PMCAFF router.get('/pmcaff/list/:typeid', lazyloadRouteHandler('./routes/pmcaff/list')); router.get('/pmcaff/feed/:typeid', lazyloadRouteHandler('./routes/pmcaff/feed')); -router.get('/pmcaff/user/:userid', lazyloadRouteHandler('./routes/pmcaff/user')); // icourse163 router.get('/icourse163/newest', lazyloadRouteHandler('./routes/icourse163/newest')); @@ -706,10 +685,6 @@ router.get('/duozhi', lazyloadRouteHandler('./routes/duozhi')); // 高清电台 router.get('/gaoqing/latest', lazyloadRouteHandler('./routes/gaoqing/latest')); -// 鲸跃汽车 -router.get('/whalegogo/home', lazyloadRouteHandler('./routes/whalegogo/home')); -router.get('/whalegogo/portal/:type_id/:tagid?', lazyloadRouteHandler('./routes/whalegogo/portal')); - // LeetCode // router.get('/leetcode/articles', lazyloadRouteHandler('./routes/leetcode/articles')); router.get('/leetcode/submission/us/:user', lazyloadRouteHandler('./routes/leetcode/check-us')); @@ -725,9 +700,6 @@ router.get('/sketch/updates', lazyloadRouteHandler('./routes/sketch/updates')); // 每日安全 router.get('/security/pulses', lazyloadRouteHandler('./routes/security/pulses')); -// DoNews -router.get('/donews/:column?', lazyloadRouteHandler('./routes/donews/index')); - // WeGene router.get('/wegene/column/:type/:category', lazyloadRouteHandler('./routes/wegene/column')); router.get('/wegene/newest', lazyloadRouteHandler('./routes/wegene/newest')); @@ -739,9 +711,6 @@ router.get('/instapaper/person/:name', lazyloadRouteHandler('./routes/instapaper router.get('/ui-cn/article', lazyloadRouteHandler('./routes/ui-cn/article')); router.get('/ui-cn/user/:id', lazyloadRouteHandler('./routes/ui-cn/user')); -// 决胜网 -router.get('/juesheng', lazyloadRouteHandler('./routes/juesheng')); - // 一些博客 // 敬维-以认真的态度做完美的事情: https://jingwei.link/ router.get('/blogs/jingwei.link', lazyloadRouteHandler('./routes/blogs/jingwei_link')); @@ -755,9 +724,6 @@ router.get('/blogs/wang54/:id?', lazyloadRouteHandler('./routes/blogs/wang54')); // WordPress router.get('/blogs/wordpress/:domain/:https?', lazyloadRouteHandler('./routes/blogs/wordpress')); -// 西祠胡同 -router.get('/xici/:id?', lazyloadRouteHandler('./routes/xici')); - // 今日热榜 migrated to v2 // router.get('/tophub/:id', lazyloadRouteHandler('./routes/tophub')); @@ -819,15 +785,9 @@ router.get('/matters/author/:uid', lazyloadRouteHandler('./routes/matters/author // MobData router.get('/mobdata/report', lazyloadRouteHandler('./routes/mobdata/report')); -// 谷雨 -router.get('/tencent/guyu/channel/:name', lazyloadRouteHandler('./routes/tencent/guyu/channel')); - // 古诗文网 router.get('/gushiwen/recommend/:annotation?', lazyloadRouteHandler('./routes/gushiwen/recommend')); -// 电商在线 -router.get('/imaijia/category/:category', lazyloadRouteHandler('./routes/imaijia/category')); - // 21财经 router.get('/21caijing/channel/:name', lazyloadRouteHandler('./routes/21caijing/channel')); @@ -898,10 +858,6 @@ router.get('/paidai/news', lazyloadRouteHandler('./routes/paidai/news')); // 漫画db router.get('/manhuadb/comics/:id', lazyloadRouteHandler('./routes/manhuadb/comics')); -// 装备前线 -router.get('/zfrontier/postlist/:type', lazyloadRouteHandler('./routes/zfrontier/postlist')); -router.get('/zfrontier/board/:boardId', lazyloadRouteHandler('./routes/zfrontier/board_postlist')); - // Hpoi 手办维基 router.get('/hpoi/info/:type?', lazyloadRouteHandler('./routes/hpoi/info')); router.get('/hpoi/:category/:words', lazyloadRouteHandler('./routes/hpoi')); @@ -925,7 +881,7 @@ router.get('/enclavebooks/collection/:uid', lazyloadRouteHandler('./routes/encla router.get('/digitaling/index', lazyloadRouteHandler('./routes/digitaling/index')); // 数英网文章专题 -router.get('/digitaling/articles/:category/:subcate', lazyloadRouteHandler('./routes/digitaling/article')); +router.get('/digitaling/articles/:category/:subcate?', lazyloadRouteHandler('./routes/digitaling/article')); // 数英网项目专题 router.get('/digitaling/projects/:category', lazyloadRouteHandler('./routes/digitaling/project')); @@ -939,9 +895,6 @@ router.get('/maxnews/dota2', lazyloadRouteHandler('./routes/maxnews/dota2')); // 柠檬 - 私房歌 router.get('/ningmeng/song', lazyloadRouteHandler('./routes/ningmeng/song')); -// 紫竹张先生 -router.get('/zzz/:category?/:language?', lazyloadRouteHandler('./routes/zzz')); - // AlgoCasts router.get('/algocasts', lazyloadRouteHandler('./routes/algocasts/all')); @@ -982,19 +935,12 @@ router.get('/dekudeals/:type', lazyloadRouteHandler('./routes/dekudeals')); // 快科技(原驱动之家) // router.get('/kkj/news', lazyloadRouteHandler('./routes/kkj/news')); -// sixthtone -router.get('/sixthtone/news', lazyloadRouteHandler('./routes/sixthtone/news')); - // AI研习社 router.get('/aiyanxishe/:id/:sort?', lazyloadRouteHandler('./routes/aiyanxishe/home')); // 活动行 router.get('/huodongxing/explore', lazyloadRouteHandler('./routes/hdx/explore')); -// 巴比特作者专栏 -router.get('/8btc/:authorid', lazyloadRouteHandler('./routes/8btc/author')); -router.get('/8btc/news/flash', lazyloadRouteHandler('./routes/8btc/news/flash')); - // LWN.net Alerts router.get('/lwn/alerts/:distributor', lazyloadRouteHandler('./routes/lwn/alerts')); @@ -1008,9 +954,6 @@ router.get('/lolapp/article/:uuid', lazyloadRouteHandler('./routes/lolapp/articl // 左岸读书 router.get('/zreading', lazyloadRouteHandler('./routes/zreading/home')); -// NBA -router.get('/nba/app_news', lazyloadRouteHandler('./routes/nba/app_news')); - // 天津产权交易中心 router.get('/tprtc/cqzr', lazyloadRouteHandler('./routes/tprtc/cqzr')); router.get('/tprtc/qyzc', lazyloadRouteHandler('./routes/tprtc/qyzc')); @@ -1049,9 +992,6 @@ router.get('/meituan/tech/home', lazyloadRouteHandler('./routes//meituan/tech/ho router.get('/codeceo/home', lazyloadRouteHandler('./routes/codeceo/home')); router.get('/codeceo/:type/:category?', lazyloadRouteHandler('./routes/codeceo/category')); -// BOF -router.get('/bof/home', lazyloadRouteHandler('./routes/bof/home')); - // 爱发电 router.get('/afdian/explore/:type?/:category?', lazyloadRouteHandler('./routes/afdian/explore')); router.get('/afdian/dynamic/:uid', lazyloadRouteHandler('./routes/afdian/dynamic')); @@ -1079,7 +1019,6 @@ router.get('/wikihow/category/:category/:type', lazyloadRouteHandler('./routes/w router.get('/10000link/news/:category?', lazyloadRouteHandler('./routes/10000link/news')); // 一兜糖 -router.get('/yidoutang/index', lazyloadRouteHandler('./routes/yidoutang/index.js')); router.get('/yidoutang/guide', lazyloadRouteHandler('./routes/yidoutang/guide.js')); router.get('/yidoutang/mtest', lazyloadRouteHandler('./routes/yidoutang/mtest.js')); router.get('/yidoutang/case/:type', lazyloadRouteHandler('./routes/yidoutang/case.js')); @@ -1158,9 +1097,6 @@ router.get('/weidian/goods/:id', lazyloadRouteHandler('./routes/weidian/goods')) // 有赞 router.get('/youzan/goods/:id', lazyloadRouteHandler('./routes/youzan/goods')); -// 币世界快讯 -router.get('/bishijie/kuaixun', lazyloadRouteHandler('./routes/bishijie/kuaixun')); - // 顺丰丰桥 router.get('/sf/sffq-announce', lazyloadRouteHandler('./routes/sf/sffq-announce')); @@ -1205,12 +1141,6 @@ router.get('/nfmovies/:id?', lazyloadRouteHandler('./routes/nfmovies/index')); // 书友社区 router.get('/andyt/:view?', lazyloadRouteHandler('./routes/andyt/index')); -// 品途商业评论 -router.get('/pintu360/:type?', lazyloadRouteHandler('./routes/pintu360/index')); - -// engadget中国版 -router.get('/engadget-cn', lazyloadRouteHandler('./routes/engadget/home')); - // engadget router.get('/engadget/:lang?', lazyloadRouteHandler('./routes/engadget/home')); @@ -1247,9 +1177,6 @@ router.get('/zhanqi/room/:id', lazyloadRouteHandler('./routes/zhanqi/room')); // 酒云网 router.get('/wineyun/:category', lazyloadRouteHandler('./routes/wineyun')); -// 快知 -router.get('/kzfeed/topic/:id', lazyloadRouteHandler('./routes/kzfeed/topic')); - // X-MOL化学资讯平台 // router.get('/x-mol/news/:tag?', lazyloadRouteHandler('./routes/x-mol/news.js')); // router.get('/x-mol/paper/:type/:magazine', lazyloadRouteHandler('./routes/x-mol/paper')); @@ -1535,9 +1462,6 @@ router.get('/lagou/jobs/:position/:city', lazyloadRouteHandler('./routes/lagou/j router.get('/yzu/home/:type', lazyloadRouteHandler('./routes/universities/yzu/home')); router.get('/yzu/yjszs/:type', lazyloadRouteHandler('./routes/universities/yzu/yjszs')); -// 德国新闻社卫健新闻 -router.get('/krankenkassen', lazyloadRouteHandler('./routes/krankenkassen')); - // 桂林航天工业学院 router.get('/guat/news/:type?', lazyloadRouteHandler('./routes/guat/news')); @@ -1821,9 +1745,6 @@ router.get('/missevan/drama/:id', lazyloadRouteHandler('./routes/missevan/drama' // AMD router.get('/amd/graphicsdrivers/:id/:rid?', lazyloadRouteHandler('./routes/amd/graphicsdrivers')); -// 电商报 -router.get('/dsb/area/:area', lazyloadRouteHandler('./routes/dsb/area')); - // 靠谱新闻 router.get('/kaopunews/:language?', lazyloadRouteHandler('./routes/kaopunews')); @@ -1857,7 +1778,6 @@ router.get('/kuaibao', lazyloadRouteHandler('./routes/kuaibao/index')); // SocialBeta router.get('/socialbeta/home', lazyloadRouteHandler('./routes/socialbeta/home')); -router.get('/socialbeta/hunt', lazyloadRouteHandler('./routes/socialbeta/hunt')); // 东方我乐多丛志 router.get('/touhougarakuta/:language/:type', lazyloadRouteHandler('./routes/touhougarakuta')); @@ -1896,12 +1816,6 @@ router.get('/tencent/bigdata', lazyloadRouteHandler('./routes/tencent/bigdata/in // 搜韵网 router.get('/souyun/today', lazyloadRouteHandler('./routes/souyun/today')); -// 生物谷 -router.get('/bioon/latest', lazyloadRouteHandler('./routes/bioon/latest')); - -// soomal -router.get('/soomal/topics/:category/:language?', lazyloadRouteHandler('./routes/soomal/topics')); - // JustRun router.get('/justrun', lazyloadRouteHandler('./routes/justrun/index')); @@ -1943,9 +1857,6 @@ router.get('/wenxuecity/bbs/:cat/:elite?', lazyloadRouteHandler('./routes/wenxue router.get('/wenxuecity/hot/:cid', lazyloadRouteHandler('./routes/wenxuecity/hot')); router.get('/wenxuecity/news', lazyloadRouteHandler('./routes/wenxuecity/news')); -// 不安全 -router.get('/buaq', lazyloadRouteHandler('./routes/buaq/index')); - // 快出海 router.get('/kchuhai', lazyloadRouteHandler('./routes/kchuhai/index')); @@ -1970,9 +1881,6 @@ router.get('/blogs/jianning', lazyloadRouteHandler('./routes/blogs/jianning')); // 互动吧 router.get('/hudongba/:city/:id', lazyloadRouteHandler('./routes/hudongba/index')); -// 飞雪娱乐网 -router.get('/feixuew/:id?', lazyloadRouteHandler('./routes/feixuew/index')); - // 1X router.get('/1x/:category?', lazyloadRouteHandler('./routes/1x/index')); @@ -1982,15 +1890,8 @@ router.get('/jx3/:caty?', lazyloadRouteHandler('./routes/jx3/news')); // 泉州市跨境电子商务协会 router.get('/qzcea/:caty?', lazyloadRouteHandler('./routes/qzcea/index')); -// 福利年 -router.get('/fulinian/:caty?', lazyloadRouteHandler('./routes/fulinian/index')); - // CGTN -router.get('/cgtn/top', lazyloadRouteHandler('./routes/cgtn/top')); router.get('/cgtn/most/:type?/:time?', lazyloadRouteHandler('./routes/cgtn/most')); - -router.get('/cgtn/pick', lazyloadRouteHandler('./routes/cgtn/pick')); - router.get('/cgtn/opinions', lazyloadRouteHandler('./routes/cgtn/opinions')); // AppSales @@ -2042,9 +1943,6 @@ router.get('/gov/taiwan/mnd', lazyloadRouteHandler('./routes/gov/taiwan/mnd')); // 高科技行业门户 router.get('/ofweek/news', lazyloadRouteHandler('./routes/ofweek/news')); -// 八阕 -router.get('/popyard/:caty?', lazyloadRouteHandler('./routes/popyard/index')); - // World Trade Organization router.get('/wto/dispute-settlement/:year?', lazyloadRouteHandler('./routes/wto/dispute-settlement')); @@ -2054,12 +1952,6 @@ router.get('/forum4399/:mtag', lazyloadRouteHandler('./routes/game4399/forum')); // 国防科技大学 router.get('/nudt/yjszs/:id?', lazyloadRouteHandler('./routes/universities/nudt/yjszs')); -// 全现在 -router.get('/allnow/column/:id', lazyloadRouteHandler('./routes/allnow/column')); -router.get('/allnow/tag/:id', lazyloadRouteHandler('./routes/allnow/tag')); -router.get('/allnow/user/:id', lazyloadRouteHandler('./routes/allnow/user')); -router.get('/allnow', lazyloadRouteHandler('./routes/allnow/index')); - // dev.to router.get('/dev.to/top/:period', lazyloadRouteHandler('./routes/dev.to/top')); @@ -2110,12 +2002,6 @@ router.get('/nwpu/:column', lazyloadRouteHandler('./routes/nwpu/index')); // 美国联邦最高法院 router.get('/us/supremecourt/argument_audio/:year?', lazyloadRouteHandler('./routes/us/supremecourt/argument_audio')); -// 未名新闻 -router.get('/mitbbs/:caty?', lazyloadRouteHandler('./routes/mitbbs/index')); - -// 贾真的电商108将 -router.get('/jiazhen108', lazyloadRouteHandler('./routes/jiazhen108/index')); - // 优设网 router.get('/uisdc/talk/:sort?', lazyloadRouteHandler('./routes/uisdc/talk')); router.get('/uisdc/hangye/:caty?', lazyloadRouteHandler('./routes/uisdc/hangye')); @@ -2123,9 +2009,6 @@ router.get('/uisdc/news', lazyloadRouteHandler('./routes/uisdc/news')); router.get('/uisdc/zt/:title?', lazyloadRouteHandler('./routes/uisdc/zt')); router.get('/uisdc/topic/:title?/:sort?', lazyloadRouteHandler('./routes/uisdc/topic')); -// 中国劳工观察 -router.get('/chinalaborwatch/reports/:lang?/:industry?', lazyloadRouteHandler('./routes/chinalaborwatch/reports')); - // 美国中央情报局 router.get('/cia/foia-annual-report', lazyloadRouteHandler('./routes/us/cia/foia-annual-report')); @@ -2135,15 +2018,9 @@ router.get('/everything/changes', lazyloadRouteHandler('./routes/everything/chan // 中国劳工通讯 router.get('/clb/commentary/:lang?', lazyloadRouteHandler('./routes/clb/commentary')); -// 国际教育研究所 -router.get('/iie/blog', lazyloadRouteHandler('./routes/iie/blog')); - // 超理论坛 router.get('/chaoli/:channel?', lazyloadRouteHandler('./routes/chaoli/index')); -// Polar -router.get('/polar/blog', lazyloadRouteHandler('./routes/polar/blog')); - // XYplorer router.get('/xyplorer/whatsnew', lazyloadRouteHandler('./routes/xyplorer/whatsnew')); @@ -2166,23 +2043,6 @@ router.get('/qstheory/:category?', lazyloadRouteHandler('./routes/qstheory/index // 生命时报 router.get('/lifetimes/:category?', lazyloadRouteHandler('./routes/lifetimes/index')); -// MakeUseOf -router.get('/makeuseof/:category?', lazyloadRouteHandler('./routes/makeuseof/index')); - -// 瞬Matataki -// 热门作品 -router.get('/matataki/posts/hot/:ipfsFlag?', lazyloadRouteHandler('./routes/matataki/site/posts/scoreranking')); -// 最新作品 -router.get('/matataki/posts/latest/:ipfsFlag?', lazyloadRouteHandler('./routes/matataki/site/posts/timeranking')); -// 作者创作 -router.get('/matataki/users/:authorId/posts/:ipfsFlag?', lazyloadRouteHandler('./routes/matataki/site/posts/author')); -// Fan票关联作品 -router.get('/matataki/tokens/:id/posts/:filterCode/:ipfsFlag?', lazyloadRouteHandler('./routes/matataki/site/posts/token')); -// 标签关联作品 -router.get('/matataki/tags/:tagId/:tagName/posts/:ipfsFlag?', lazyloadRouteHandler('./routes/matataki/site/posts/tag')); -// 收藏夹 -router.get('/matataki/users/:userId/favorites/:favoriteListId/posts/:ipfsFlag?', lazyloadRouteHandler('./routes/matataki/site/posts/favorite')); - // Zhimap 知识导图社区 router.get('/zhimap/:categoryUuid?/:recommend?', lazyloadRouteHandler('./routes/zhimap/index')); @@ -2203,9 +2063,6 @@ router.get('/mind42/:caty?', lazyloadRouteHandler('./routes/mind42/index')); // 幕布网 router.get('/mubu/explore/:category?/:title?', lazyloadRouteHandler('./routes/mubu/explore')); -// Esquirehk -router.get('/esquirehk/tag/:id', lazyloadRouteHandler('./routes/esquirehk/tag')); - // 国家普通话测试 杭州市 router.get('/putonghua', lazyloadRouteHandler('./routes/putonghua/hangzhou')); @@ -2220,9 +2077,6 @@ router.get('/yinxiang/card/:id', lazyloadRouteHandler('./routes/yinxiang/card')) router.get('/yinxiang/personal/:id', lazyloadRouteHandler('./routes/yinxiang/personal')); router.get('/yinxiang/category/:id', lazyloadRouteHandler('./routes/yinxiang/category')); -// 遠見 gvm.com.tw -router.get('/gvm/index/:category?', lazyloadRouteHandler('./routes/gvm/index')); - // 触乐 router.get('/chuapp/index/:category?', lazyloadRouteHandler('./routes/chuapp/index')); @@ -2247,9 +2101,6 @@ router.get('/ustr/press-releases/:year?/:month?', lazyloadRouteHandler('./routes // 游戏动力 router.get('/vgn/:platform?', lazyloadRouteHandler('./routes/vgn/index')); -// 国际能源署 -router.get('/iea/:category?', lazyloadRouteHandler('./routes/iea/index')); - // The Brain router.get('/thebrain/:category?', lazyloadRouteHandler('./routes/thebrain/blog')); @@ -2265,9 +2116,6 @@ router.get('/marginnote/tag/:id?', lazyloadRouteHandler('./routes/marginnote/tag // ASML router.get('/asml/press-releases', lazyloadRouteHandler('./routes/asml/press-releases')); -// 中国机械工程学会 -router.get('/cmes/news/:category?', lazyloadRouteHandler('./routes/cmes/news')); - // Craigslist router.get('/craigslist/:location/:type', lazyloadRouteHandler('./routes/craigslist/search')); @@ -2282,12 +2130,6 @@ router.get('/mathunion/fields-medal', lazyloadRouteHandler('./routes/mathunion/f // ACM router.get('/acm/amturingaward', lazyloadRouteHandler('./routes/acm/amturingaward')); -// 網路天文館 -router.get('/tam/forecast', lazyloadRouteHandler('./routes/tam/forecast')); - -// Day One -router.get('/dayone/blog', lazyloadRouteHandler('./routes/dayone/blog')); - // 滴答清单 router.get('/dida365/habit/checkins', lazyloadRouteHandler('./routes/dida365/habit-checkins')); @@ -2297,24 +2139,12 @@ router.get('/ditto/changes/:type?', lazyloadRouteHandler('./routes/ditto/changes // iDaily 每日环球视野 router.get('/idaily/today', lazyloadRouteHandler('./routes/idaily/index')); -// 北屋 -router.get('/northhouse/:category?', lazyloadRouteHandler('./routes/northhouse/index')); - // Oak Ridge National Laboratory router.get('/ornl/news', lazyloadRouteHandler('./routes/ornl/news')); // 信阳师范学院 自考办 router.get('/xynu/zkb/:category', lazyloadRouteHandler('./routes/universities/xynu/zkb')); -// Bell Labs -router.get('/bell-labs/events-news/:category?', lazyloadRouteHandler('./routes/bell-labs/events-news.js')); - -// 中国科学院青年创新促进会 -router.get('/yicas/blog', lazyloadRouteHandler('./routes/yicas/blog')); - -// 九三学社 -router.get('/93/:category?', lazyloadRouteHandler('./routes/93/index')); - // DailyArt router.get('/dailyart/:language?', lazyloadRouteHandler('./routes/dailyart/index')); @@ -2333,21 +2163,12 @@ router.get('/nace/blog/:sort?', lazyloadRouteHandler('./routes/nace/blog')); // Semiconductor Industry Association router.get('/semiconductors/latest-news', lazyloadRouteHandler('./routes/semiconductors/latest-news')); -// VOA News -router.get('/voa/day-photos', lazyloadRouteHandler('./routes/voa/day-photos')); - // Voice of America router.get('/voa/:language/:channel?', lazyloadRouteHandler('./routes/voa/index')); -// 游戏葡萄 -router.get('/gamegrape/:id?', lazyloadRouteHandler('./routes/gamegrape/index')); - // 阳光高考 router.get('/chsi/zszcgd/:category?', lazyloadRouteHandler('./routes/chsi/zszcgd')); -// 眾新聞 -router.get('/hkcnews/news/:category?', lazyloadRouteHandler('./routes/hkcnews/news')); - // AnyTXT router.get('/anytxt/release-notes', lazyloadRouteHandler('./routes/anytxt/release-notes')); @@ -2390,12 +2211,6 @@ router.get('/cqut/libnews', lazyloadRouteHandler('./routes/universities/cqut/cqu // 城农 Growin' City router.get('/growincity/news/:id?', lazyloadRouteHandler('./routes/growincity/news')); -// Thrillist -router.get('/thrillist/:tag?', lazyloadRouteHandler('./routes/thrillist/index')); - -// 丁香园 -router.get('/dxy/vaccine/:province?/:city?/:location?', lazyloadRouteHandler('./routes/dxy/vaccine')); - // 中国庭审公开网 router.get('/tingshen', lazyloadRouteHandler('./routes/tingshen/tingshen')); @@ -2463,9 +2278,6 @@ router.get('/furaffinity/favorites/:username/:nsfw?', lazyloadRouteHandler('./ro router.get('/furaffinity/submission_comments/:id', lazyloadRouteHandler('./routes/furaffinity/submission_comments')); router.get('/furaffinity/journal_comments/:id', lazyloadRouteHandler('./routes/furaffinity/journal_comments')); -// 亿欧网 -router.get('/iyiou', lazyloadRouteHandler('./routes/iyiou')); - // 香港商报 router.get('/hkcd/pdf', lazyloadRouteHandler('./routes/hkcd/pdf')); @@ -2483,9 +2295,6 @@ router.get('/trakt/collection/:username/:type?', lazyloadRouteHandler('./routes/ // 全球化智库 router.get('/ccg/:category?', lazyloadRouteHandler('./routes/ccg/index')); -// 中国橡胶网 -router.get('/cria/news/:id?', lazyloadRouteHandler('./routes/cria/news')); - // 灵异网 router.get('/lingyi/:category', lazyloadRouteHandler('./routes/lingyi/index')); @@ -2526,9 +2335,6 @@ router.get('/hugo/releases', lazyloadRouteHandler('./routes/hugo/releases')); // 东立出版 router.get('/tongli/news/:type', lazyloadRouteHandler('./routes/tongli/news')); -// OR -router.get('/or/:id?', lazyloadRouteHandler('./routes/or')); - // 字型故事 router.get('/fontstory', lazyloadRouteHandler('./routes/fontstory/tw')); @@ -2571,12 +2377,6 @@ router.get('/tanchinese/:category?', lazyloadRouteHandler('./routes/tanchinese') // yuzu emulator router.get('/yuzu-emu/entry', lazyloadRouteHandler('./routes/yuzu-emu/entry')); -// Resources - The Partnership on AI -router.get('/partnershiponai/resources', lazyloadRouteHandler('./routes/partnershiponai/resources')); - -// Common App -router.get('/commonapp/blog', lazyloadRouteHandler('./routes/commonapp/blog')); - // Europa Press router.get('/europapress/:category?', lazyloadRouteHandler('./routes/europapress')); @@ -2609,9 +2409,6 @@ router.get('/x410/news', lazyloadRouteHandler('./routes/x410/news')); router.get('/micmicidol', lazyloadRouteHandler('./routes/micmicidol/latest')); router.get('/micmicidol/search/:label', lazyloadRouteHandler('./routes/micmicidol/search')); -// 香港高登 -router.get('/hkgolden/:id?/:limit?/:sort?', lazyloadRouteHandler('./routes/hkgolden')); - // 香港討論區 router.get('/discuss/:fid', lazyloadRouteHandler('./routes/discuss')); diff --git a/lib/routes/199it/category.js b/lib/routes/199it/category.js index 489505265a2ffb..ae8455c96b8183 100644 --- a/lib/routes/199it/category.js +++ b/lib/routes/199it/category.js @@ -1,6 +1,6 @@ const utils = require('./utils'); -const rootUrl = 'http://www.199it.com/archives/category/'; +const rootUrl = 'https://www.199it.com/archives/category'; module.exports = async (ctx) => { const keyword = ctx.params.caty.split('|').join('/'); diff --git a/lib/routes/199it/tag.js b/lib/routes/199it/tag.js index 7bee423df5fc16..d158e8118836bd 100644 --- a/lib/routes/199it/tag.js +++ b/lib/routes/199it/tag.js @@ -1,6 +1,6 @@ const utils = require('./utils'); -const rootUrl = 'http://www.199it.com/archives/tag/'; +const rootUrl = 'https://www.199it.com/archives/tag'; module.exports = async (ctx) => { const keyword = ctx.params.tag.split('|').join('/'); diff --git a/lib/routes/199it/utils.js b/lib/routes/199it/utils.js index bbbf926541dcfc..2cc478daf7f99d 100644 --- a/lib/routes/199it/utils.js +++ b/lib/routes/199it/utils.js @@ -25,7 +25,7 @@ module.exports = async (ctx, keyword, currentUrl) => { ctx.cache.tryGet(item.link, async () => { const detailResponse = await got({ method: 'get', - url: item.link, + url: `https:${item.link}`, }); const content = cheerio.load(detailResponse.data); diff --git a/lib/routes/8btc/author.js b/lib/routes/8btc/author.js deleted file mode 100644 index 2f04fb41e0d8b8..00000000000000 --- a/lib/routes/8btc/author.js +++ /dev/null @@ -1,49 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const authorid = ctx.params.authorid; - const response = await got.get(`https://webapi.8btc.com/bbt_api/comments/list?author_id=${authorid}&fetch_num=20`); - - const ProcessFeed = (data) => { - const $ = cheerio.load(data); - - // 提取内容 - return $('.bbt-html').html(); - }; - - const items = await Promise.all( - response.data.data.list.map(async (item) => { - const link = `https://www.8btc.com/article/${item.post_id}`; - - const cache = await ctx.cache.get(link); - if (cache) { - return Promise.resolve(JSON.parse(cache)); - } - - const response = await got({ - method: 'get', - url: link, - }); - - const description = ProcessFeed(response.data); - - const single = { - title: item.post.title, - description, - pubDate: item.date_gmt, - link, - author: item.reviewer.name, - }; - ctx.cache.set(link, JSON.stringify(single)); - return Promise.resolve(single); - }) - ); - - ctx.state.data = { - title: '巴比特作者专栏', - link: `https://www.8btc.com/author/${authorid}`, - description: '巴比特作者专栏', - item: items, - }; -}; diff --git a/lib/routes/8btc/news/flash.js b/lib/routes/8btc/news/flash.js deleted file mode 100644 index b3403fa5de378f..00000000000000 --- a/lib/routes/8btc/news/flash.js +++ /dev/null @@ -1,41 +0,0 @@ -const got = require('@/utils/got'); - -module.exports = async (ctx) => { - const response = await got({ - method: 'get', - url: `https://app.blockmeta.com/w1/news/list?num=30&cat_id=4481&page=1`, - headers: { - from: 'web', - Referer: `https://www.8btc.com/flash`, - }, - }); - - const newsflashes = response.data.list; - - let newsflashesList = []; - for (let i = 0; i < newsflashes.length; i++) { - newsflashesList = newsflashesList.concat(newsflashes[i]); - } - - const out = newsflashesList.map((item) => { - const pubDate = item.post_date_format; - const link = item.source.link; - const title = item.title; - const description = item.content; - - const single = { - title, - link, - pubDate, - description, - }; - - return single; - }); - - ctx.state.data = { - title: `快讯 - 巴比特`, - link: `https://www.8btc.com/flash`, - item: out, - }; -}; diff --git a/lib/routes/93/index.js b/lib/routes/93/index.js deleted file mode 100644 index f5468f1ded4b78..00000000000000 --- a/lib/routes/93/index.js +++ /dev/null @@ -1,50 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const category = ctx.params.category || 'lxzn-yzjy'; - - const rootUrl = 'http://www.93.gov.cn'; - const currentUrl = `${rootUrl}/${category}`; - const response = await got({ - method: 'get', - url: currentUrl, - }); - - const $ = cheerio.load(response.data); - - const list = $('li.clearfix a') - .slice(0, 15) - .map((_, item) => { - item = $(item); - return { - title: item.text(), - link: `${rootUrl}${item.attr('href')}`, - pubDate: new Date(item.next().text()).toUTCString(), - }; - }) - .get(); - - const items = await Promise.all( - list.map((item) => - ctx.cache.tryGet(item.link, async () => { - const detailResponse = await got({ - method: 'get', - url: item.link, - }); - const content = cheerio.load(detailResponse.data); - - item.description = content('.pageContent').html(); - item.author = content('.pageTitle ul li').eq(1).text().replace('来源:', ''); - - return item; - }) - ) - ); - - ctx.state.data = { - title: $('title').text(), - link: currentUrl, - item: items, - }; -}; diff --git a/lib/routes/allnow/column.js b/lib/routes/allnow/column.js deleted file mode 100644 index afb29d127860f1..00000000000000 --- a/lib/routes/allnow/column.js +++ /dev/null @@ -1,7 +0,0 @@ -const utils = require('./utils'); - -module.exports = async (ctx) => { - const id = ctx.params.id; - - ctx.state.data = await utils.processItems(ctx, `${utils.rootUrl}/column/${id}`); -}; diff --git a/lib/routes/allnow/index.js b/lib/routes/allnow/index.js deleted file mode 100644 index 16d1f8f0e927c3..00000000000000 --- a/lib/routes/allnow/index.js +++ /dev/null @@ -1,5 +0,0 @@ -const utils = require('./utils'); - -module.exports = async (ctx) => { - ctx.state.data = await utils.processItems(ctx, utils.rootUrl); -}; diff --git a/lib/routes/allnow/tag.js b/lib/routes/allnow/tag.js deleted file mode 100644 index f27a72c28b0d68..00000000000000 --- a/lib/routes/allnow/tag.js +++ /dev/null @@ -1,7 +0,0 @@ -const utils = require('./utils'); - -module.exports = async (ctx) => { - const id = ctx.params.id; - - ctx.state.data = await utils.processItems(ctx, `${utils.rootUrl}/tag/${id}`); -}; diff --git a/lib/routes/allnow/user.js b/lib/routes/allnow/user.js deleted file mode 100644 index 8b4b80eb8f47d5..00000000000000 --- a/lib/routes/allnow/user.js +++ /dev/null @@ -1,7 +0,0 @@ -const utils = require('./utils'); - -module.exports = async (ctx) => { - const id = ctx.params.id; - - ctx.state.data = await utils.processItems(ctx, `${utils.rootUrl}/user/${id}`); -}; diff --git a/lib/routes/allnow/utils.js b/lib/routes/allnow/utils.js deleted file mode 100644 index 5311c4a104422a..00000000000000 --- a/lib/routes/allnow/utils.js +++ /dev/null @@ -1,67 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); -const timezone = require('@/utils/timezone'); -const { parseDate } = require('@/utils/parse-date'); - -const rootUrl = 'https://www.allnow.com'; - -module.exports = { - rootUrl, - - processItems: async (ctx, currentUrl) => { - const response = await got({ - method: 'get', - url: currentUrl, - }); - - const $ = cheerio.load(response.data); - - const list = $('.post-list .post') - .slice(0, ctx.params.limit ? parseInt(ctx.params.limit) : 15) - .map((_, item) => { - item = $(item); - - return { - link: `${rootUrl}${item.attr('href')}`, - }; - }) - .get(); - - const items = await Promise.all( - list.map((item) => - ctx.cache.tryGet(item.link, async () => { - const detailResponse = await got({ - method: 'get', - url: item.link, - }); - - const content = cheerio.load(detailResponse.data); - - item.author = detailResponse.data.match(/authorName:"(.*?)",avatar/)[1]; - item.title = content('title') - .text() - .replace(/-全现在官方网站/, ''); - item.pubDate = timezone(parseDate(detailResponse.data.match(/time:"(.*)",type/)[1]), +8); - item.category = detailResponse.data - .match(/tags:\[(.*)\],columns/)[1] - .split('},') - .map((category) => category.match(/title:"(.*)"/)[1]); - item.description = content('#article-content').html() ?? content('.summary').html() ?? ''; - - content('video').each(function () { - item.description += ``; - }); - - return item; - }) - ) - ); - - return { - title: $('title').text(), - link: currentUrl, - item: items, - description: $('.desc').eq(0).text(), - }; - }, -}; diff --git a/lib/routes/baidu/daily.js b/lib/routes/baidu/daily.js deleted file mode 100644 index 5d4ec6d8f6df90..00000000000000 --- a/lib/routes/baidu/daily.js +++ /dev/null @@ -1,55 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); -const iconv = require('iconv-lite'); - -module.exports = async (ctx) => { - const host = `https://zhidao.baidu.com/daily?fr=daohang`; - - const response = await got.get(host, { - responseType: 'buffer', - }); - - response.data = iconv.decode(response.data, 'gbk'); - const $ = cheerio.load(response.data); - - const list = $("li[class=' clearfix']").get(); - - const items = list.map((item) => { - item = $(item); - - return { - title: item.find('div.daily-cont-top > h2 > a').text(), - description: item.find('div.daily-cont-top > div > a').text(), - link: `https://zhidao.baidu.com/${item.find('div.daily-cont-top > h2 > a').attr('href')}`, - }; - }); - - const result = await Promise.all( - items.map(async (item) => { - const link = item.link; - - const cache = await ctx.cache.get(link); - if (cache) { - return Promise.resolve(JSON.parse(cache)); - } - - const itemReponse = await got.get(link, { - responseType: 'buffer', - }); - const data = iconv.decode(itemReponse.data, 'gbk'); - const itemElement = cheerio.load(data); - - item.description = itemElement('.detail-wp').html(); - - ctx.cache.set(link, JSON.stringify(item)); - return item; - }) - ); - - ctx.state.data = { - title: `知道日报`, - link: host, - description: `每天都知道一点`, - item: result, - }; -}; diff --git a/lib/routes/bell-labs/events-news.js b/lib/routes/bell-labs/events-news.js deleted file mode 100644 index 1130619d20a245..00000000000000 --- a/lib/routes/bell-labs/events-news.js +++ /dev/null @@ -1,70 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -const config = { - events: '.tout-text a', - 'industry-recognition': '.n-block-section .n-block .rich-text p b', - 'press-releases': 'h5 a', -}; - -module.exports = async (ctx) => { - const category = ctx.params.category || 'press-releases'; - - const rootUrl = 'http://www.bell-labs.com'; - const currentUrl = `${rootUrl}/events-news/${category}`; - const response = await got({ - method: 'get', - url: currentUrl, - }); - - const $ = cheerio.load(response.data); - - let items = (category === 'industry-recognition' ? $(config[category]).closest('.rich-text') : $(config[category])) - .slice(0, 15) - .map((_, i) => { - let item = $(i); - - if (category === 'industry-recognition') { - item = item.children('.n-link-list').length > 0 ? item.children('.n-link-list') : item.children('p').eq(1); - } - if (item.children('a').attr('href')) { - item = item.children('a'); - } - - return { - title: item.text(), - link: item.attr('href') || currentUrl, - pubDate: new Date(category === 'events' ? item.text().split(':')[0].split(' - ')[0] : category === 'industry-recognition' ? $(i).children('p').eq(0).text() : '').toUTCString(), - - description: category === 'events' ? item.closest('.n-block').next().find('.rich-text').html() : category === 'industry-recognition' ? `

${$(i).find('p').last().text()}

` : '', - }; - }) - .get(); - - if (category === 'press-releases') { - items = await Promise.all( - items.map((item) => - ctx.cache.tryGet(item.link, async () => { - const detailResponse = await got({ - method: 'get', - url: item.link, - }); - const content = cheerio.load(detailResponse.data); - - content('.social-media-sharing').remove(); - - item.description = content('.layout-content').html(); - item.pubDate = new Date(content('meta[name="search-updated"]').attr('content')).toUTCString(); - - return item; - }) - ) - ); - } - - ctx.state.data = { - title: $('title').eq(0).text(), - link: currentUrl, - item: items, - }; -}; diff --git a/lib/routes/bioon/latest.js b/lib/routes/bioon/latest.js deleted file mode 100644 index f2d47df92aca0c..00000000000000 --- a/lib/routes/bioon/latest.js +++ /dev/null @@ -1,51 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const currentUrl = 'http://www.bioon.com'; - const response = await got({ - method: 'get', - url: currentUrl, - }); - - const $ = cheerio.load(response.data); - const list = $('#cms_list li[data-i]') - .slice(0, 10) - .map((_, item) => { - item = $(item); - const a = item.find('a'); - - return { - title: a.text(), - link: a.attr('href'), - }; - }) - .get(); - - const items = await Promise.all( - list.map((item) => - ctx.cache.tryGet(item.link, async () => { - const detailResponse = await got({ - method: 'get', - url: item.link, - }); - - const content = cheerio.load(detailResponse.data); - - const subtitle = content('div.title5 p').text().split(' '); - const pubDate = `${subtitle.slice(-2)[0]} ${subtitle.slice(-1)}`; - - item.pubDate = new Date(pubDate + ' GMT+8').toUTCString(); - item.description = content('div.text3').html(); - - return item; - }) - ) - ); - - ctx.state.data = { - title: '生物谷 - 最新资讯', - link: currentUrl, - item: items, - }; -}; diff --git a/lib/routes/bishijie/kuaixun.js b/lib/routes/bishijie/kuaixun.js deleted file mode 100644 index 4a582dcb3b8bb0..00000000000000 --- a/lib/routes/bishijie/kuaixun.js +++ /dev/null @@ -1,21 +0,0 @@ -const buildData = require('@/utils/common-config'); - -module.exports = async (ctx) => { - const link = `https://www.bishijie.com/kuaixun/`; - const host = `https://www.bishijie.com`; - ctx.state.data = await buildData({ - link, - url: link, - title: `%title%`, - params: { - title: '币世界快讯列表', - host, - }, - item: { - item: 'ul.newscontainer > li', - title: `$('div.content a h3').text()`, - link: `$('div.content a').attr('href')`, - description: `$('div.content div.news-content div').html()`, - }, - }); -}; diff --git a/lib/routes/bof/home.js b/lib/routes/bof/home.js deleted file mode 100644 index b5d29df319e6a8..00000000000000 --- a/lib/routes/bof/home.js +++ /dev/null @@ -1,42 +0,0 @@ -const got = require('@/utils/got'); - -module.exports = async (ctx) => { - const response = await got({ - method: 'POST', - url: 'https://www.businessoffashion.com/graphql/v1', - headers: { - 'Content-Type': 'application/json', - }, - data: JSON.stringify({ - operationName: 'GetArticlesGQL', - variables: { - first: 5, - lastCursor: null, - height: 440, - width: 670, - }, - query: 'query GetArticlesGQL($articleSlug: String, $category: String, $authorSlug: String, $height: Int, $lastCursor: ID, $width: Int!, $first: Int) {\n articles(first: $first, after: $lastCursor, filter: {language__eq: chinese, articleSlug__eq: $articleSlug, categorySlug__eq: $category, authorSlug__eq: $authorSlug}) {\n edges {\n cursor\n node {\n __typename\n ... on ArticleInterface {\n title\n summary\n content\n url\n featuredAsset {\n ... on AssetInterface {\n caption\n __typename\n }\n ... on ManagedImage {\n transform(transform: {width: $width, height: $height, crop: FOCALPOINT, fit: CROP})\n __typename\n }\n ... on ManagedVideo {\n url\n __typename\n }\n __typename\n }\n isExclusive\n isSponsored\n published {\n value\n __typename\n }\n __typename\n }\n ... on InternalArticleInterface {\n authors {\n displayName\n slug\n __typename\n }\n __typename\n }\n ... on ExternalArticleInterface {\n source\n __typename\n }\n ... on CuratedArticleLink {\n _id\n title\n published {\n value\n __typename\n }\n url\n __typename\n }\n ... on SyndicatedArticle {\n _id\n topics {\n _id\n label\n __typename\n }\n categories {\n _id\n label\n __typename\n }\n __typename\n }\n ... on OriginalArticle {\n _id\n topics {\n _id\n label\n __typename\n }\n categories {\n _id\n label\n slug\n __typename\n }\n __typename\n }\n ... on FashionWeekReview {\n _id\n topics {\n _id\n label\n __typename\n }\n categories {\n _id\n label\n __typename\n }\n __typename\n }\n }\n __typename\n }\n __typename\n }\n}\n', - }), - }); - - const items = response.data.data.articles.edges.map((item) => { - const url = new URL(item.node.url); - url.host = 'cn.businessoffashion.com'; - const single = { - title: item.node.title, - description: `${item.node.summary}
${item.node.content}`, - pubDate: new Date(item.node.published.value).toUTCString(), - link: url.href, - author: item.node.authors[0].displayName, - }; - - return single; - }); - - ctx.state.data = { - title: `BoF时装商业评论 | 时刻为全球时尚产业提供最新的新闻、分析与情报 | BoF`, - link: `https://cn.businessoffashion.com/`, - description: 'BoF时装商业评论 | 时刻为全球时尚产业提供最新的新闻、分析与情报 | BoF', - item: items, - }; -}; diff --git a/lib/routes/buaq/index.js b/lib/routes/buaq/index.js deleted file mode 100644 index b8371352c3cea5..00000000000000 --- a/lib/routes/buaq/index.js +++ /dev/null @@ -1,31 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const baseUrl = 'https://buaq.net'; - - const response = await got({ - method: 'get', - url: baseUrl, - }); - const $ = cheerio.load(response.data); // 使用 cheerio 加载返回的 HTML - const list = $('tr[class]'); - - ctx.state.data = { - title: `不安全文章 ~ 资讯`, - link: `https://buaq.net/`, - description: '不安全文章 ~ 资讯', - item: - list && - list - .map((index, item) => { - item = $(item); - return { - title: $('font[size="4"]', item).children('a').text(), - pubDate: new Date($('font[size="1"]', item).children().first().text()).toUTCString(), - link: baseUrl + $('font[size="4"]', item).children('a').attr('href'), - }; - }) - .get(), - }; -}; diff --git a/lib/routes/cgtn/pick.js b/lib/routes/cgtn/pick.js deleted file mode 100644 index f70192cf66d4d2..00000000000000 --- a/lib/routes/cgtn/pick.js +++ /dev/null @@ -1,45 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const rootUrl = 'https://www.cgtn.com/'; - const response = await got({ - method: 'get', - url: rootUrl, - }); - - const $ = cheerio.load(response.data); - const list = $('.titleArea') - .map((_, item) => { - item = $(item); - const a = item.find('a'); - return { - title: a.text(), - link: a.attr('href'), - pubDate: new Date(parseInt(a.attr('data-time'))).toUTCString(), - }; - }) - .get(); - - const items = await Promise.all( - list.map((item) => - ctx.cache.tryGet(item.link, async () => { - const detailResponse = await got({ - method: 'get', - url: item.link, - }); - const content = cheerio.load(detailResponse.data); - - item.description = content('#cmsMainContent').html(); - - return item; - }) - ) - ); - - ctx.state.data = { - title: "CGTN - Editors' Pick", - link: rootUrl, - item: items, - }; -}; diff --git a/lib/routes/cgtn/top.js b/lib/routes/cgtn/top.js deleted file mode 100644 index 4c5c93a4791404..00000000000000 --- a/lib/routes/cgtn/top.js +++ /dev/null @@ -1,45 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const rootUrl = 'https://www.cgtn.com/'; - const response = await got({ - method: 'get', - url: rootUrl, - }); - - const $ = cheerio.load(response.data); - const list = $('div.topNews-item') - .map((_, item) => { - item = $(item); - const a = item.find('div.topNews-item-content-title a'); - return { - title: a.text(), - link: a.attr('href'), - pubDate: new Date(parseInt(a.attr('data-time'))).toUTCString(), - }; - }) - .get(); - - const items = await Promise.all( - list.map((item) => - ctx.cache.tryGet(item.link, async () => { - const detailResponse = await got({ - method: 'get', - url: item.link, - }); - const content = cheerio.load(detailResponse.data); - - item.description = content('#cmsMainContent').html(); - - return item; - }) - ) - ); - - ctx.state.data = { - title: 'CGTN - Top News', - link: rootUrl, - item: items, - }; -}; diff --git a/lib/routes/chinalaborwatch/reports.js b/lib/routes/chinalaborwatch/reports.js deleted file mode 100644 index d2a44980393124..00000000000000 --- a/lib/routes/chinalaborwatch/reports.js +++ /dev/null @@ -1,53 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const lang = ctx.params.lang || ''; - const industry = ctx.params.industry || ''; - - const rootUrl = 'http://www.chinalaborwatch.org'; - const currentUrl = `${rootUrl}/${lang === '' ? '' : 'cn/'}reports${industry === '' ? '' : `/industry/${industry}`}`; - - const response = await got({ - method: 'get', - url: currentUrl, - }); - const $ = cheerio.load(response.data); - - const list = $('.Alt1 a, .Alt2 a') - .slice(0, 10) - .map((_, item) => { - item = $(item); - return { - title: item.text(), - link: `${rootUrl}${item.attr('href')}`, - }; - }) - .get(); - - const items = await Promise.all( - list.map((item) => - ctx.cache.tryGet(item.link, async () => { - const detailResponse = await got({ - method: 'get', - url: item.link, - }); - const content = cheerio.load(detailResponse.data); - - item.pubDate = new Date(content('#ContentPlaceHolder1_LabelDate').text().replace(/年|月/g, '-').replace('日', '')).toUTCString(); - - content('h1, #ContentPlaceHolder1_LabelDate').remove(); - - item.description = content('.mainContent').html(); - - return item; - }) - ) - ); - - ctx.state.data = { - title: `${$('title').text()} - ${lang === '' ? 'China Labour Watch' : '中国劳工观察'}`, - link: currentUrl, - item: items, - }; -}; diff --git a/lib/routes/cmes/news.js b/lib/routes/cmes/news.js deleted file mode 100644 index c2015474d8cf6b..00000000000000 --- a/lib/routes/cmes/news.js +++ /dev/null @@ -1,64 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const category = ctx.params.category || 'Information'; - - const rootUrl = 'https://www.cmes.org'; - const currentUrl = `${rootUrl}/News/${category}/index.html`; - const response = await got({ - method: 'get', - url: currentUrl, - }); - - const $ = cheerio.load(response.data); - - const list = $('.r_ct') - .find('a') - .slice(0, 10) - .map((_, item) => { - item = $(item); - - const link = item.attr('href'); - - let date = '00000000'; - if (link.split('/')[2] !== 'mkc.ckcest.cn') { - date = link.split('/')[5]; - } - - return { - link, - title: item.text(), - pubDate: new Date(`${date.substr(0, 4)}-${date.substr(5, 2)}-${date.substr(7, 2)}`).toDateString(), - }; - }) - .get(); - - const items = await Promise.all( - list.map((item) => - ctx.cache.tryGet(item.link, async () => { - const detailResponse = await got({ - method: 'get', - url: item.link, - }); - const content = cheerio.load(detailResponse.data); - - content('h3, script, .bshare-custom').remove(); - - item.description = content('.xhjj').html() || content('.detail-page').html(); - - if (content('#articleTime').html()) { - item.pubDate = new Date(content('#articleTime').text()).toUTCString(); - } - - return item; - }) - ) - ); - - ctx.state.data = { - title: $('title').text(), - link: currentUrl, - item: items, - }; -}; diff --git a/lib/routes/commonapp/blog.js b/lib/routes/commonapp/blog.js deleted file mode 100644 index a3ee56c9cc960e..00000000000000 --- a/lib/routes/commonapp/blog.js +++ /dev/null @@ -1,42 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); -const { parseDate } = require('@/utils/parse-date'); - -module.exports = async (ctx) => { - const rootUrl = 'https://www.commonapp.org'; - const jsonUrl = `${rootUrl}/page-data/sq/d/4283793559.json`; - const response = await got({ - method: 'get', - url: jsonUrl, - }); - - const list = response.data.data.allNodeBlogPost.edges.map((item) => ({ - title: item.node.title, - author: item.node.field_blog_author, - pubDate: parseDate(item.node.created), - link: `${rootUrl}${item.node.path.alias}`, - })); - - const items = await Promise.all( - list.map((item) => - ctx.cache.tryGet(item.link, async () => { - const detailResponse = await got({ - method: 'get', - url: item.link, - }); - - const content = cheerio.load(detailResponse.data); - - item.description = content('.inner-page').html(); - - return item; - }) - ) - ); - - ctx.state.data = { - title: 'Blog - Common App', - link: `${rootUrl}/blog`, - item: items, - }; -}; diff --git a/lib/routes/cria/news.js b/lib/routes/cria/news.js deleted file mode 100644 index 51c2277678b4cf..00000000000000 --- a/lib/routes/cria/news.js +++ /dev/null @@ -1,57 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const id = ctx.params.id || ''; - - const rootUrl = 'http://www.cria.org.cn'; - const currentUrl = `${rootUrl}/${id ? `newslist/${id}.html` : 'news'}`; - const response = await got({ - method: 'get', - url: currentUrl, - }); - - const $ = cheerio.load(response.data); - - const list = $('.ch_news,.enterprise_news_c') - .find('ul li') - .map((_, item) => { - item = $(item); - const a = item.find('a'); - - return { - link: `${rootUrl}${a.attr('href')}`, - }; - }) - .get(); - - const items = await Promise.all( - list.map((item) => - ctx.cache.tryGet(item.link, async () => { - try { - const detailResponse = await got({ - method: 'get', - url: item.link, - }); - const content = cheerio.load(detailResponse.data); - - item.title = content('title').text(); - item.description = content('.news_details_c').html(); - item.pubDate = new Date(detailResponse.data.match(/发布时间:(.*)<\/span>来源:/)[1]).toUTCString(); - - return item; - } catch (e) { - return Promise.resolve(''); - } - }) - ) - ); - - const title = id ? response.data.match(/

当前位置:中国橡胶网 > (.*)<\/span><\/h3>/)[1] : '新闻资讯'; - - ctx.state.data = { - title: `${title} - 中国橡胶网`, - link: currentUrl, - item: items, - }; -}; diff --git a/lib/routes/dayone/blog.js b/lib/routes/dayone/blog.js deleted file mode 100644 index 7e27b27a87f7b6..00000000000000 --- a/lib/routes/dayone/blog.js +++ /dev/null @@ -1,56 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const rootUrl = 'https://dayoneapp.com'; - const currentUrl = `${rootUrl}/blog`; - const response = await got({ - method: 'get', - url: currentUrl, - }); - - const $ = cheerio.load(response.data); - - const list = $('h3 a') - .slice(0, 20) - .map((_, item) => { - item = $(item); - const info = item.parent().next().text().split(' by '); - - return { - author: info[1], - title: item.text(), - link: `${rootUrl}${item.attr('href')}`, - pubDate: new Date(info[0]).toUTCString(), - }; - }) - .get(); - - const items = await Promise.all( - list.map((item) => - ctx.cache.tryGet(item.link, async () => { - const detailResponse = await got({ - method: 'get', - url: item.link, - }); - const content = cheerio.load(detailResponse.data); - - const description = content('.blog-layout'); - - description.children().last().remove(); - content('h1').next().remove(); - content('h1').remove(); - - item.description = description.html(); - - return item; - }) - ) - ); - - ctx.state.data = { - title: $('title').text(), - link: currentUrl, - item: items, - }; -}; diff --git a/lib/routes/donews/index.js b/lib/routes/donews/index.js deleted file mode 100644 index d1c97e9b72f83b..00000000000000 --- a/lib/routes/donews/index.js +++ /dev/null @@ -1,59 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -const util = require('./utils'); - -module.exports = async (ctx) => { - const { column = '' } = ctx.params; - - let host = `http://www.donews.com/${column}`; - - if (column !== '' && column !== 'idonews') { - host += '/index'; - } - - const response = await got.get(host); - - const $ = cheerio.load(response.data); - - let list, - title = 'DoNews - '; - - if (column === '') { - title += '首页'; - } else { - title += $('.breadCrumb > a:nth-child(2)').text(); - } - - switch (column) { - case '': - // 首页轮播 - list = $('a.news-item').get(); - - break; - case 'ent': - case 'idonews': - // 首页轮播 - list = $('ul.zl-top > li > a').get(); - list = list.concat($('.fl.w840 > .block > dl > dd > h3 > a').slice(0, 5).get()); - - break; - default: - list = $('.fl.w840 > .block > dl > dd > h3 > a').slice(0, 10).get(); - break; - } - - const items = await Promise.all( - list.map((e) => { - const link = $(e).attr('href'); - return ctx.cache.tryGet(link, () => util.ProcessFeed(link)); - }) - ); - - ctx.state.data = { - title, - link: host, - description: '中国最早的web2.0网站,专业科技媒体、互联网行业门户网站。提供互联网新闻IT资讯,关注科技创新,覆盖移动互联网创业、游戏、风险投资等热点,是中国互联网行业的风向标。', - item: items, - }; -}; diff --git a/lib/routes/donews/utils.js b/lib/routes/donews/utils.js deleted file mode 100644 index 73769b83754060..00000000000000 --- a/lib/routes/donews/utils.js +++ /dev/null @@ -1,19 +0,0 @@ -const cheerio = require('cheerio'); -const got = require('@/utils/got'); - -const ProcessFeed = async (link) => { - const response = await got.get(link); - const $ = cheerio.load(response.data); - - return { - title: $('.detail-con h1').text() || $('.detail-con h2').text().replace('{{news.title}}', ''), - author: $('.tag > .fl > span:nth-child(2)').text().replace('{{news.author}}', ''), - description: $('.article-con').html(), - pubDate: new Date($('.tag > .fl > span:nth-child(1)').text().replace('{{news.timeFormat}}', '')), - link, - }; -}; - -module.exports = { - ProcessFeed, -}; diff --git a/lib/routes/dsb/area.js b/lib/routes/dsb/area.js deleted file mode 100644 index ccdead6eed23b4..00000000000000 --- a/lib/routes/dsb/area.js +++ /dev/null @@ -1,33 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const area = ctx.params.area; - const host = 'www.dsb.cn'; - const areaUrl = `http://${host}/${area}`; - const areaResp = await got(areaUrl); - const $ = cheerio.load(areaResp.data); - const areaName = $('.new-list-title').text(); - const newsUrls = $('ul.new-list-cons > li > a') - .map((i, e) => $(e).attr('href')) - .get(); - - ctx.state.data = { - title: `电商报 - ${areaName}`, - link: areaUrl, - item: await Promise.all( - newsUrls.map((url) => - ctx.cache.tryGet(url, async () => { - const newsResp = await got(url); - const $ = cheerio.load(newsResp.data); - return { - title: $('.new-content > h2').text(), - link: url, - pubDate: $('.new-content-info > span:nth-child(3)').text(), - description: $('div.new-content-con').html(), - }; - }) - ) - ), - }; -}; diff --git a/lib/routes/dxy/vaccine.js b/lib/routes/dxy/vaccine.js deleted file mode 100644 index 74c90cbbcbae63..00000000000000 --- a/lib/routes/dxy/vaccine.js +++ /dev/null @@ -1,109 +0,0 @@ -const got = require('@/utils/got'); - -module.exports = async (ctx) => { - const province = ctx.params.province || ''; - const city = ctx.params.city || ''; - const location = ctx.params.location || ''; - let fullLocation = ''; - if (province) { - fullLocation += `/${province}`; - if (city) { - fullLocation += `/${city}`; - if (location) { - fullLocation += `/${location}`; - } - } - } - - const rootUrl = 'https://mama.dxy.com'; - const currentUrl = `${rootUrl}/client/vaccine/new-crown-vaccine`; - const apiUrl = `${rootUrl}/api/vaccine/client/vaccination-point/all`; - - const apiResponse = await got({ - method: 'get', - url: apiUrl, - }); - - const response = await got({ - method: 'get', - url: apiResponse.data.results.fileUrl, - }); - - const allPoints = [], - allLocations = {}, - allLocationIds = {}, - pointDataArray = response.data.results.pointData; - - for (const data of pointDataArray) { - allLocations[data.locationName] = data.locationId; - allLocationIds[data.locationId] = data.locationName; - if (data.points) { - allPoints.push(...data.points); - } else { - pointDataArray.push(...data.pointData); - } - } - - const list = allPoints.map((item) => { - const locationId = item.locationId; - const province = locationId - (locationId % 10000); - const city = locationId - (locationId % 100); - - return { - title: `${allLocationIds[province]}/${allLocationIds.hasOwnProperty(city) ? `${allLocationIds[city]}/` : `${allLocationIds[province]}/`}${allLocationIds[locationId]}`, - link: item.contentUrl, - pubDate: new Date(item.modifyDate).toUTCString(), - }; - }); - - const items = await Promise.all( - list - .filter((item) => { - if (fullLocation !== '') { - const locationSplit = item.title.split('/'); - const fullLocationSplit = fullLocation.split('/'); - - for (let index = 0; index < fullLocationSplit.length; index++) { - if (locationSplit[index] !== fullLocationSplit[index]) { - return false; - } - } - } - return true; - }) - .map((item) => - ctx.cache.tryGet(item.link, async () => { - const detailResponse = await got({ - method: 'get', - url: item.link, - }); - const result = detailResponse.data.results; - - const description = - `

${result.point.pointName}

` + - '
    ' + - `
  • 户籍限制:${result.point.registerLimit}
  • ` + - `
  • 服务限制:${result.point.serviceTag}
  • ` + - `
  • 服务时间:${result.detail.serviceTime}
  • ` + - `
  • 地址:${result.point.address}
  • ` + - `
  • 电话:${result.point.phoneNo}
  • ` + - `
  • 接种人群:${result.detail.targetPeople}
  • ` + - `
  • 接种所需材料:${result.detail.materials}
  • ` + - `
  • 预约步骤:${result.detail.reserveSteps}
  • ` + - '
'; - - item.description = description; - item.title = `${result.point.pointName}(${item.title})`; - item.link = `${rootUrl}/client/vaccine/vaccination-point?pointId=${result.point.id}`; - - return item; - }) - ) - ); - - ctx.state.data = { - title: `新冠疫苗接种点查询${fullLocation ? `(${fullLocation})` : ''} - 丁香园`, - link: currentUrl, - item: items, - }; -}; diff --git a/lib/routes/esquirehk/tag.js b/lib/routes/esquirehk/tag.js deleted file mode 100644 index e53db81757aefc..00000000000000 --- a/lib/routes/esquirehk/tag.js +++ /dev/null @@ -1,71 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - let id = ctx.params.id || 'Fashion'; - - id = id.toLowerCase(); - - const rootUrl = 'https://www.esquirehk.com'; - const topics = ['style', 'watch', 'money-investment', 'lifestyle', 'culture', 'mens-talk', 'gear', 'people']; - - let currentUrl = `${rootUrl}/tag/${id}`; - if (topics.indexOf(id) > -1) { - currentUrl = `${rootUrl}/${id}`; - } - - const response = await got({ - method: 'get', - url: currentUrl, - }); - - const $ = cheerio.load(response.data); - const list = $('.FeedStory') - .slice(0, 10) - .map((_, item) => { - item = $(item); - return { - author: item.find('.author').text(), - link: `${rootUrl}${item.find('a.Anchor').eq(0).attr('href')}`, - }; - }) - .get(); - - const items = await Promise.all( - list.map((item) => - ctx.cache.tryGet(item.link, async () => { - const detailResponse = await got({ - method: 'get', - url: item.link, - }); - const content = cheerio.load(detailResponse.data); - - content('.RelatedBlock').remove(); - content('.TagContainer').remove(); - content('.YouMayLikeContainer').remove(); - content('.SubscriptionContainer').remove(); - - content('img').each(function () { - const srcset = content(this).attr('srcset'); - if (srcset) { - content(this).removeAttr('srcset'); - content(this).removeAttr('data-src'); - content(this).attr('src', `${rootUrl}${srcset.split(',')[1].replace('1032w', '')}`); - } - }); - - item.title = content('.CommonTitle').text(); - item.description = content('.ArticlePage').html(); - item.pubDate = new Date(content('.ArticleFeeds-info time').eq(0).attr('data-timestamp') * 1000).toUTCString(); - - return item; - }) - ) - ); - - ctx.state.data = { - title: `${$('title').text()} - Esquirehk`, - link: currentUrl, - item: items, - }; -}; diff --git a/lib/routes/feixuew/index.js b/lib/routes/feixuew/index.js deleted file mode 100644 index 6c6e1162f8a8c6..00000000000000 --- a/lib/routes/feixuew/index.js +++ /dev/null @@ -1,63 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - let currentUrl; - let query; - - const rootUrl = 'https://www.feixuew.com'; - - ctx.params.id = ctx.params.id || 'latest'; - - if (ctx.params.id === 'latest') { - currentUrl = rootUrl; - } else { - currentUrl = `${rootUrl}/sort/${ctx.params.id}`; - } - - const response = await got({ - method: 'get', - url: currentUrl, - }); - - const $ = cheerio.load(response.data); - - if (ctx.params.id === 'latest') { - query = $('ul.ul-new li a').slice(4, 10); - } else { - query = $('a.sjwu').slice(0, 10); - } - - const list = query - .map((_, item) => { - item = $(item); - return { - title: item.attr('title'), - link: item.attr('href'), - }; - }) - .get(); - - const items = await Promise.all( - list.map((item) => - ctx.cache.tryGet(item.link, async () => { - const detailResponse = await got({ - method: 'get', - url: item.link, - }); - const content = cheerio.load(detailResponse.data); - - item.description = content('div.info-con').html(); - item.pubDate = new Date(content('p.f-sgray span').eq(1).text().replace('发布时间:', '') + ' GMT+8').toUTCString(); - - return item; - }) - ) - ); - - ctx.state.data = { - title: `飞雪娱乐网 - ${$('title').text().split('-')[0]}`, - link: currentUrl, - item: items, - }; -}; diff --git a/lib/routes/fulinian/index.js b/lib/routes/fulinian/index.js deleted file mode 100644 index e4548660d9fb56..00000000000000 --- a/lib/routes/fulinian/index.js +++ /dev/null @@ -1,50 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -const rootUrl = 'https://www.fulinian.com/'; - -module.exports = async (ctx) => { - ctx.params.caty = ctx.params.caty || ''; - - const currentUrl = `${rootUrl}/${ctx.params.caty}`; - const response = await got({ - method: 'get', - url: currentUrl, - }); - - const $ = cheerio.load(response.data); - const list = $('article.excerpt') - .slice(0, 10) - .map((_, item) => { - item = $(item); - const a = item.find('header h2 a'); - return { - title: a.text(), - link: a.attr('href'), - }; - }) - .get(); - - const items = await Promise.all( - list.map((item) => - ctx.cache.tryGet(item.link, async () => { - const detailResponse = await got({ - method: 'get', - url: item.link, - }); - const content = cheerio.load(detailResponse.data); - - item.description = content('article.article-content').html(); - item.pubDate = new Date(content('div.article-meta span.item').eq(0).text() + ' GMT+8').toUTCString(); - - return item; - }) - ) - ); - - ctx.state.data = { - title: `福利年 - ${$('h1').text()}`, - link: currentUrl, - item: items, - }; -}; diff --git a/lib/routes/gamegrape/index.js b/lib/routes/gamegrape/index.js deleted file mode 100644 index 280a75e099ce6b..00000000000000 --- a/lib/routes/gamegrape/index.js +++ /dev/null @@ -1,73 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -function getNum(str) { - const result = str.match(/(\d{1,2}).*/); - if (result) { - return parseInt(result[1]); - } -} -function resolveRelativeTime(relativeTime) { - const result = /\S* · (\d{1,2}天)?(\d{1,2}小时)?(\d{1,2}分钟)?/.exec(relativeTime); - let day, hour, min; - if (result[1]) { - day = getNum(result[1]); - } - if (result[2]) { - hour = getNum(result[2]); - } - if (result[3]) { - min = getNum(result[3]); - } - return (((day || 0) * 24 + (hour || 0)) * 60 + (min || 0)) * 60 * 1000; -} - -module.exports = async (ctx) => { - const id = ctx.params.id || ''; - - const rootUrl = 'http://youxiputao.com'; - const currentUrl = `${rootUrl}/article${id ? `/index/id/${id}` : ''}`; - const response = await got({ - method: 'get', - url: currentUrl, - }); - - const $ = cheerio.load(response.data); - - const list = $('.news-info-box') - .slice(0, 15) - .map((_, item) => { - item = $(item); - const a = item.find('a[title]'); - - return { - title: a.text(), - link: `${rootUrl}${a.attr('href')}`, - pubDate: Date.now() - resolveRelativeTime(item.find('.pull-right').text()), - }; - }) - .get(); - - const items = await Promise.all( - list.map((item) => - ctx.cache.tryGet(item.link, async () => { - const detailResponse = await got({ - method: 'get', - url: item.link, - }); - const content = cheerio.load(detailResponse.data); - - item.description = content('.info').html(); - item.author = content('.users-info h4').text(); - - return item; - }) - ) - ); - - ctx.state.data = { - title: $('title').text(), - link: currentUrl, - item: items, - }; -}; diff --git a/lib/routes/gvm/index.js b/lib/routes/gvm/index.js deleted file mode 100644 index 68896d42900c08..00000000000000 --- a/lib/routes/gvm/index.js +++ /dev/null @@ -1,94 +0,0 @@ -const got = require('got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const category = ctx.params.category || 'newest'; - let suffix = '/newest'; - - const options = { - newest: '最新文章', - recommend: '你可能會喜歡', - opinion: '名家專欄', - topic: '專題', - news: '時事熱點', - politics: '政治', - society: '社會', - figure: '人物報導', - world: '國際', - world_focus: '全球焦點', - cross_strait_politics: '兩岸', - money: '金融理財', - investment: '投資理財', - insurance: '保險規劃', - retire: '退休理財', - fintech: '金融Fintech', - real_estate: '房地產', - economy: '總體經濟', - tech: '科技', - tech_trend: '科技趨勢', - energy: '能源', - business: '產經', - industry: '傳產', - service: '消費服務', - medical: '生技醫藥', - family_business_succession: '傳承轉型', - startup: '創業新創', - management: '管理', - agriculture: '農業', - education: '教育', - higher_education: '高教', - technological: '技職', - parent: '親子教育', - world_education: '國際文教', - sports: '體育', - life: '好享生活', - art: '時尚設計', - self_growth: '心靈成長', - film: '藝文影視', - travel: '旅遊', - environment: '環境生態', - health: '健康', - food: '美食', - career: '職場生涯', - survey: '調查', - county: '縣市', - csr: 'CSR', - }; - - if (category !== 'newest' && category !== 'recommend') { - suffix = `/category/${category}`; - } - - const response = await got({ - method: 'get', - url: 'https://www.gvm.com.tw' + suffix, - }); - - const $ = cheerio.load(response.body); - - const articles = $('#article_list .article-list-item .article-list-item__intro') - .map((index, ele) => ({ - title: $('a', ele).text(), - link: $('a', ele).attr('href'), - pubDate: new Date($('.time', ele).text()), - author: $('.author', ele).text(), - })) - .get(); - - const item = await Promise.all( - articles.map((item) => - ctx.cache.tryGet(item.link, async () => { - const res = await got.get(item.link); - const content = cheerio.load(res.body); - item.description = content('.article-content').html(); - return item; - }) - ) - ); - - ctx.state.data = { - title: `遠見 - ${options[category]}`, - link: 'https://www.gvm.com.tw' + suffix, - item, - }; -}; diff --git a/lib/routes/hkcnews/news.js b/lib/routes/hkcnews/news.js deleted file mode 100644 index 476f4c52847443..00000000000000 --- a/lib/routes/hkcnews/news.js +++ /dev/null @@ -1,63 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -const titles = { - '': '眾聞', - 13: '經濟', - 15: '社會', - 14: '生活', - 12: '政治', - 16: '國際', - 20: '台灣', - 21: '人物', - 19: '中國', -}; - -module.exports = async (ctx) => { - const category = ctx.params.category || ''; - - const rootUrl = 'https://www.hkcnews.com'; - const apiUrl = `${rootUrl}/data/newsposts${category === '' ? '' : `/${category}`}?page=1`; - const response = await got({ - method: 'get', - url: apiUrl, - }); - - const list = response.data.items.map((item) => { - const $ = cheerio.load(item); - const news = $('.article-block-body a'); - const date = $('.line').eq(1).text().split('.').reverse().join('-'); - - return { - title: news.text(), - link: `${rootUrl}${news.attr('href')}`, - pubDate: new Date(date.length === 8 ? `${new Date().getFullYear().toString().slice(0, 2)}${date}` : date).toUTCString(), - }; - }); - - const items = await Promise.all( - list.map((item) => - ctx.cache.tryGet(item.link, async () => { - const detailResponse = await got({ - method: 'get', - url: item.link, - }); - const content = cheerio.load(detailResponse.data); - - item.description = content('.article-content').html(); - // substring 2 times - // from https://hkcnews.com/article/47878/loreal歐萊雅-薇婭-李佳琦-47884/薇婭、李佳琦幫loreal帶貨引價格爭議-loreal道歉 - // to https://hkcnews.com/article/47878 - item.guid = item.link.substring(0, item.link.lastIndexOf('/')).substring(0, item.link.substring(0, item.link.lastIndexOf('/')).lastIndexOf('/')); - - return item; - }) - ) - ); - - ctx.state.data = { - title: `眾新聞 - ${titles[category]}`, - link: `${rootUrl}/news${category === '' ? '' : `/${category}/${titles[category]}`}`, - item: items, - }; -}; diff --git a/lib/routes/hkgolden/index.js b/lib/routes/hkgolden/index.js deleted file mode 100644 index a56b2d4bac61fb..00000000000000 --- a/lib/routes/hkgolden/index.js +++ /dev/null @@ -1,110 +0,0 @@ -const got = require('@/utils/got'); -const { parseDate } = require('@/utils/parse-date'); -const dayjs = require('dayjs'); - -const channels = { - BW: '吹水台', - HT: '高登熱', - NW: '最 新', - CA: '時事台', - ET: '娛樂台', - SP: '體育台', - FN: '財經台', - ST: '學術台', - SY: '講故台', - EP: '創意台', - HW: '硬件台', - IN: '電訊台', - SW: '軟件台', - MP: '手機台', - AP: 'Apps台', - GM: '遊戲台', - ED: '飲食台', - TR: '旅遊台', - CO: '潮流台', - AN: '動漫台', - TO: '玩具台', - MU: '音樂台', - VI: '影視台', - DC: '攝影台', - TS: '汽車台', - WK: '上班台', - LV: '感情台', - SC: '校園台', - BB: '親子台', - PT: '寵物台', - MB: '站務台', - RA: '電 台', - AC: '活動台', - BS: '買賣台', - JT: '直播台', - AU: '成人台', - OP: '考古台', -}; - -const limits = { - '-1': '全部', - 1: '正式', - 0: '公海', -}; - -const sorts = { - 0: '最後回應時間', - 1: '發表時間', - 2: '熱門', -}; - -module.exports = async (ctx) => { - const id = ctx.params.id || 'BW'; - const sort = ctx.params.sort || '0'; - const limit = ctx.params.limit || '-1'; - - const rootUrl = 'https://forum.hkgolden.com'; - const apiRootUrl = 'https://api.hkgolden.com'; - const apiUrl = `${apiRootUrl}/v1/topics/HT/1?sort=${sort}&limit=${limit}`; - - const response = await got({ - method: 'get', - url: apiUrl, - }); - - const list = response.data.data.list.slice(0, ctx.query.limit ? parseInt(ctx.query.limit) : 30).map((item) => ({ - link: item.id, - title: item.title, - author: item.authorName, - pubDate: parseDate(item.orderDate), - })); - - const items = await Promise.all( - list.map((item) => - ctx.cache.tryGet(item.link, async () => { - const detailResponse = await got({ - method: 'get', - url: `${apiRootUrl}/v1/view/${item.link}`, - }); - - const data = detailResponse.data.data; - - item.link = `${rootUrl}/thread/${item.id}`; - item.description = - `` + - ``; - - for (const reply of data.replies) { - item.description += - `` + ``; - } - - item.description += '
${data.authorName} (${dayjs(data.messageDate).format('YYYY-MM-DD hh:mm:ss')})
${data.content.replace(/src="\/faces/g, 'src="https://assets.hkgolden.com/faces')}
${reply.authorName} (${dayjs(reply.replyDate).format('YYYY-MM-DD hh:mm:ss')})
${reply.content.replace(/src="\/faces/g, 'src="https://assets.hkgolden.com/faces')}
'; - - return item; - }) - ) - ); - - ctx.state.data = { - title: `${channels[id]} (${sorts[sort]}|${limits[limit]}) - 香港高登`, - link: `${rootUrl}/channel/${id}`, - item: items, - }; -}; diff --git a/lib/routes/iea/index.js b/lib/routes/iea/index.js deleted file mode 100644 index 9206146ddf3c11..00000000000000 --- a/lib/routes/iea/index.js +++ /dev/null @@ -1,53 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const category = ctx.params.category || 'news-and-events'; - - const rootUrl = 'https://www.iea.org'; - const currentUrl = `${rootUrl}/${category}`; - const response = await got({ - method: 'get', - url: currentUrl, - }); - - const $ = cheerio.load(response.data); - - const list = $('.m-news-listing__hover') - .slice(0, 15) - .map((_, item) => { - item = $(item); - - const title = $(item).text(); - item = item.parent().get(0).tagName === 'a' ? $(item).parent() : $(item).parent().parent(); - - return { - title, - link: `${rootUrl}${item.attr('href')}`, - }; - }) - .get(); - - const items = await Promise.all( - list.map((item) => - ctx.cache.tryGet(item.link, async () => { - const detailResponse = await got({ - method: 'get', - url: item.link, - }); - const content = cheerio.load(detailResponse.data); - - item.description = content('.m-block__content').html(); - item.pubDate = new Date(content('.o-hero-freepage__meta').text()).toUTCString(); - - return item; - }) - ) - ); - - ctx.state.data = { - title: $('title').eq(0).text(), - link: currentUrl, - item: items, - }; -}; diff --git a/lib/routes/iie/blog.js b/lib/routes/iie/blog.js deleted file mode 100644 index 7f653054720604..00000000000000 --- a/lib/routes/iie/blog.js +++ /dev/null @@ -1,47 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const rootUrl = 'https://www.iie.org'; - const currentUrl = `${rootUrl}/Learn/Blog`; - const response = await got({ - method: 'get', - url: currentUrl, - }); - - const $ = cheerio.load(response.data); - - const list = $('.events__title a') - .slice(0, 10) - .map((_, item) => { - item = $(item); - return { - title: item.text(), - link: `${rootUrl}${item.attr('href')}`, - pubDate: new Date(item.parent().parent().find('time').attr('datetime')).toUTCString(), - }; - }) - .get(); - - const items = await Promise.all( - list.map((item) => - ctx.cache.tryGet(item.link, async () => { - const detailResponse = await got({ - method: 'get', - url: item.link, - }); - const content = cheerio.load(detailResponse.data); - - item.description = content('.wysiwyg').html(); - - return item; - }) - ) - ); - - ctx.state.data = { - title: $('title').text(), - link: currentUrl, - item: items, - }; -}; diff --git a/lib/routes/imaijia/category.js b/lib/routes/imaijia/category.js deleted file mode 100644 index 79ba232c551ba5..00000000000000 --- a/lib/routes/imaijia/category.js +++ /dev/null @@ -1,63 +0,0 @@ -const got = require('@/utils/got'); - -module.exports = async (ctx) => { - const category = ctx.params.category; - - const api_url = `http://www.imaijia.com/xstb/front/authorArticleController.do?indexArticles&pageSize=20`; - const url = `http://www.imaijia.com/#/information.htm?catid=${category}`; - - const response = await got({ - method: 'post', - headers: { - Referer: url, - }, - url: api_url, - form: { - pageNo: 1, - catid: category, - }, - }); - - const data = response.data; - const description = data.description; - const name = data.catName; - const list = data.resList; - - const out = await Promise.all( - list.map(async (info) => { - const title = info.title; - const cat_path = info.catPath; - const id = info.id; - const itemUrl = `http://www.imaijia.com/#/atricleDetails.htm?atricleId=${id}&catPath=${cat_path}`; - const api_url = `http://www.imaijia.com/data/details/${cat_path}${id}.json`; - const pubDate = info.created; - const author = info.author; - - const cache = await ctx.cache.get(itemUrl); - if (cache) { - return Promise.resolve(JSON.parse(cache)); - } - - const response = await got.get(api_url); - - const description = response.data.resList.articleDataF.content.replace(/src="/g, 'src="http://www.imaijia.com'); - - const single = { - title, - link: itemUrl, - author, - description, - pubDate: new Date(pubDate).toUTCString(), - }; - ctx.cache.set(itemUrl, JSON.stringify(single)); - return Promise.resolve(single); - }) - ); - - ctx.state.data = { - title: `电商在线-${name}`, - description, - link: url, - item: out, - }; -}; diff --git a/lib/routes/itjuzi/invest.js b/lib/routes/itjuzi/invest.js deleted file mode 100644 index 55a02c5344104d..00000000000000 --- a/lib/routes/itjuzi/invest.js +++ /dev/null @@ -1,32 +0,0 @@ -const got = require('@/utils/got'); - -module.exports = async (ctx) => { - const response = await got({ - method: 'get', - url: 'https://www.itjuzi.com/api/index/invse', - }); - - const data = response.data; - - ctx.state.data = { - title: 'IT桔子-投融资事件', - link: 'https://www.itjuzi.com/', - item: data.map((item) => { - const invest = item.invst.map((item) => item.name).join('、'); - - return { - title: `${item.name} / ${item.round} / ${item.money}`, - link: `https://www.itjuzi.com/company/${item.invse_com_id}`, - description: ` -

- ${item.name}
- ${item.slogan}
- ${item.round} / ${item.money} / ${item.time}
- 投资方: ${invest} - `, - pubDate: new Date(item.time).toUTCString(), - guid: item.id, - }; - }), - }; -}; diff --git a/lib/routes/itjuzi/merge.js b/lib/routes/itjuzi/merge.js deleted file mode 100644 index 13cb3498c14ccf..00000000000000 --- a/lib/routes/itjuzi/merge.js +++ /dev/null @@ -1,32 +0,0 @@ -const got = require('@/utils/got'); - -module.exports = async (ctx) => { - const response = await got({ - method: 'get', - url: 'https://www.itjuzi.com/api/index/merge', - }); - - const data = response.data.data; - - ctx.state.data = { - title: 'IT桔子-并购事件', - link: 'https://www.itjuzi.com/', - item: data.map((item) => { - const party = item.party.map((item) => item.name || item.invst_name).join('、'); - - return { - title: `${item.name}-${item.slogan}`, - link: `https://www.itjuzi.com/merger/${item.id}`, - description: ` -

- ${item.name}
- ${item.slogan}
- 股权占比: ${item.ratio} / 金额: ${item.money} / ${item.time}
- 并购方: ${party} - `, - pubDate: new Date(item.time).toUTCString(), - guid: item.id, - }; - }), - }; -}; diff --git a/lib/routes/iyiou/index.js b/lib/routes/iyiou/index.js deleted file mode 100644 index 1cc04996fdb8a9..00000000000000 --- a/lib/routes/iyiou/index.js +++ /dev/null @@ -1,41 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); -const formatPubDate = require('@/utils/date.js'); - -module.exports = async (ctx) => { - const response = await got({ - method: 'get', - url: `https://www.iyiou.com/news`, - }); - const $ = cheerio.load(response.data); - const postList = $('.list-container').find('.eo-article-column').get(); - const result = await Promise.all( - postList.map(async (item) => { - const title = $(item).find('.eo-hover-child').find('.content').find('a').find('.title').text(); - const link = 'https://www.iyiou.com' + $(item).find('.eo-hover-child').find('a').attr('href'); - const guid = link; - const pubDate = formatPubDate($(item).find('.eo-hover-child').find('.content').find('.eo-post-date').text().replace(' ', '')); - - const single = { - title, - link, - guid, - pubDate, - description: '', - }; - - const description_key = 'iyiou' + guid; - const description_value = await ctx.cache.get(description_key); - - if (description_value) { - single.description = description_value; - } else { - const temp = await got(link); - single.description = $(temp.data).find('.post-body').html(); - ctx.cache.set(description_key, single.description); - } - return Promise.resolve(single); - }) - ); - ctx.state.data = { title: '亿欧网', link: 'https://www.iyiou.com/', item: result }; -}; diff --git a/lib/routes/jiazhen108/index.js b/lib/routes/jiazhen108/index.js deleted file mode 100644 index 1eabfcd4bd3eb1..00000000000000 --- a/lib/routes/jiazhen108/index.js +++ /dev/null @@ -1,47 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const rootUrl = 'http://www.jiazhen108.com/news/'; - const response = await got({ - method: 'get', - url: rootUrl, - }); - - const $ = cheerio.load(response.data); - - const list = $('div.met-news-list ul li') - .slice(0, 10) - .map((_, item) => { - item = $(item); - const a = item.find('a'); - return { - title: a.text(), - link: a.attr('href'), - }; - }) - .get(); - - const items = await Promise.all( - list.map((item) => - ctx.cache.tryGet(item.link, async () => { - const detailResponse = await got({ - method: 'get', - url: item.link, - }); - const content = cheerio.load(detailResponse.data); - - item.description = content('section.met-editor').html(); - item.pubDate = new Date(content('div.info span').eq(0).text() + ' GMT+8').toUTCString(); - - return item; - }) - ) - ); - - ctx.state.data = { - title: `「108将」实战分享`, - link: rootUrl, - item: items, - }; -}; diff --git a/lib/routes/jinritoutiao/keyword.js b/lib/routes/jinritoutiao/keyword.js deleted file mode 100644 index e757e88baba29c..00000000000000 --- a/lib/routes/jinritoutiao/keyword.js +++ /dev/null @@ -1,27 +0,0 @@ -const got = require('../../utils/got'); - -module.exports = async (ctx) => { - const keyword = ctx.params.keyword; - - const response = await got({ - method: 'get', - url: `https://www.toutiao.com/api/search/content/?offset=0&format=json&keyword=${encodeURIComponent(keyword)}&autoload=true&count=20&cur_tab=1&from=search_tab`, - headers: { - Referer: `https://www.toutiao.com/search/?keyword=${encodeURIComponent(keyword)}`, - }, - }); - let data = response.data.data; - data = data.filter((item) => !item.cell_type); - - ctx.state.data = { - title: `今日头条: ${keyword}`, - link: `https://www.toutiao.com/search/?keyword=${keyword}`, - description: keyword, - item: data.map((item) => ({ - title: `${item.media_name}: ${item.title}`, - description: item.abstract, - pubDate: new Date(parseInt(item.create_time) * 1000), - link: item.article_url, - })), - }; -}; diff --git a/lib/routes/juesheng/index.js b/lib/routes/juesheng/index.js deleted file mode 100644 index ee33d9ea1a3328..00000000000000 --- a/lib/routes/juesheng/index.js +++ /dev/null @@ -1,49 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const response = await got('http://www.juesheng.com/'); - const $ = cheerio.load(response.data); - const postList = $('.sec-box #informationBox li').get(); - const result = await Promise.all( - postList.map(async (item) => { - const title = $(item).find('.news-item-title').find('a').text(); - const link = $(item).find('.news-item-title').find('a').attr('href'); - const guid = link; - - const single = { - title, - link, - guid, - pubDate: '', - description: '', - }; - - const description_key = 'juesheng_description_' + guid; - const description_value = await ctx.cache.get(description_key); - - const pubDate_key = 'juesheng_pubDate_' + guid; - const pubDate_value = await ctx.cache.get(pubDate_key); - - if (description_value && pubDate_value) { - single.description = description_value; - single.pubDate = pubDate_value; - } else { - const temp = await got(link); - single.description = $(temp.data).find('.content-box').html(); - single.pubDate = new Date($(temp.data).find('.part-time').text()).toUTCString(); - - ctx.cache.set(description_key, single.description); - ctx.cache.set(pubDate_key, single.pubDate); - } - - return Promise.resolve(single); - }) - ); - ctx.state.data = { - title: '决胜网', - link: 'http://www.juesheng.com/', - description: '决胜网是教育产业门户网站提供:教育门户新闻资讯、互联网+教育、在线教育、兴趣教育、在线职业教育、教育创业、教育信息化、教育创业报道等,找教育就上决胜网教育门户网站。', - item: result, - }; -}; diff --git a/lib/routes/krankenkassen/index.js b/lib/routes/krankenkassen/index.js deleted file mode 100644 index 827073796624df..00000000000000 --- a/lib/routes/krankenkassen/index.js +++ /dev/null @@ -1,54 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const response = await got({ - method: 'get', - url: 'https://www.krankenkassen.de/dpa/', - }); - - const data = response.data; - - const $ = cheerio.load(data); - const list = $('.news td a'); - - const getContent = async (subLink) => { - const cacheKey = `krankenkassen_${subLink}`; - const cache = await ctx.cache.get(cacheKey); - if (cache) { - return JSON.parse(cache); - } - - const articlePageRes = await got(subLink); - const articleHtml = articlePageRes.data; - const $ = cheerio.load(articleHtml); - const pubDate = $('.untertitel').text(); - const description = $('#content p').text(); - const result = { - pubDate, - description, - title: $('.titel').text(), - link: subLink, - }; - ctx.cache.set(cacheKey, JSON.stringify(result)); - return result; - }; - - const item = await Promise.all( - list - .slice(0, 30) - .map((index, dom) => { - dom = $(dom); - const link = `https://www.krankenkassen.de/dpa/${dom.attr('href')}`; - return getContent(link); - }) - .get() - ); - - ctx.state.data = { - title: $('title').text(), - link: 'https://www.krankenkassen.de/dpa/', - description: '德国新闻社卫健新闻', - item, - }; -}; diff --git a/lib/routes/kzfeed/topic.js b/lib/routes/kzfeed/topic.js deleted file mode 100644 index 833cfabfc4058e..00000000000000 --- a/lib/routes/kzfeed/topic.js +++ /dev/null @@ -1,122 +0,0 @@ -/** - * 这里列出部分已知用途且在 Feed 中有用的属性 - * - * @typedef {Object} Card - * @property {String} id 卡片 id - * @property {String} title 卡片标题 - * @property {String} text 正文内容,会有换行符,里面的链接会是 的形式 - * @property {String} video 可能是内嵌视频地址 - * @property {String} video_thumb_img 可能是内嵌视频预览图片 - * @property {Number} bilibili_video_id 可能是关联的 Bilibili av 号 - * @property {String[]} images 内嵌图片地址 - * @property {Card~ImageInfo[]} images_info 内嵌图片信息 - * @property {String} url 原文网址 - * @property {String} url_cover 原文头图 - * @property {String} url_title 原文标题 - * @property {String} url_desc 原文简介 - * @property {String} url_host 原文网址的域名 - * @property {Number} created_time 创建的 Unix 时间戳 - * - * @typedef {Object} Card~ImageInfo - * @property {String} url - * @property {String} format - * @property {String} size - * @property {Number} width - * @property {Number} height - */ - -const got = require('@/utils/got'); - -/** - * @param {String} ctx.params.id - */ -module.exports = async (ctx) => { - const id = ctx.params.id; - - const info_res = await got({ - method: 'post', - url: 'https://kz.sync163.com/api/topic/info', - headers: { - from: 'h5', - token: 'asdfasdfasdf', - 'Content-Type': 'application/json', - }, - data: JSON.stringify({ - topic_id: id, - }), - }); - const info = info_res.data; - - const cards_res = await got({ - method: 'post', - url: 'https://kz.sync163.com/api/topic/cards', - headers: { - from: 'h5', - token: 'asdfasdfasdf', - 'Content-Type': 'application/json', - }, - data: JSON.stringify({ - topic_id: id, - }), - }); - const cardList = cards_res.data.list; - - ctx.state.data = { - title: `快知 - ${info.info.name}`, - description: info.info.description, - link: `https://kz.sync163.com/web/topic/${id}`, - image: info.info.icon, - item: cardList.map(buildFeedItem), - }; -}; - -/** - * @param {Card} cardData - */ -const buildFeedItem = (cardData) => { - const description = ` -

-

${cardData.url_title ? cardData.url_title : ''}${cardData.url_desc ? ` - ${cardData.url_desc}` : ''}

-

${serializeCardText(cardData.text)}

- ${renderImageList(cardData.images)} -

快知中间页

- `; - - return { - title: cardData.title ? cardData.title : cardData.url_title, - description, - pubDate: new Date(cardData.created_time * 1000), - link: cardData.url, - }; -}; - -const renderImageList = (images) => { - const renderItem = (src) => ` -
  • - -
  • - `; - - return ` -
      - ${images.map(renderItem).join('')} -
    - `; -}; - -const serializeCardText = (text) => - text - - /* 快知的 API 里的 a 标签名字叫做 a-link ,我们要把它改过来 */ - .replace(//g, '') - - /* 替换换行符 */ - .replace(/\n/g, '
    '); diff --git a/lib/routes/makeuseof/index.js b/lib/routes/makeuseof/index.js deleted file mode 100644 index 2edc58bf9aefc1..00000000000000 --- a/lib/routes/makeuseof/index.js +++ /dev/null @@ -1,59 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const category = ctx.params.category || ''; - - const rootUrl = 'https://www.makeuseof.com'; - const currentUrl = `${rootUrl}${category === '' ? '' : '/category/' + category}`; - const response = await got({ - method: 'get', - url: currentUrl, - }); - - const $ = cheerio.load(response.data); - - const list = $('.home-secondary, .listing-content') - .find('.bc-title-link') - .slice(0, 15) - .map((_, item) => { - item = $(item); - return { - title: item.text(), - link: `${rootUrl}${item.attr('href')}`, - }; - }) - .get(); - - const items = await Promise.all( - list.map((item) => - ctx.cache.tryGet(item.link, async () => { - const detailResponse = await got({ - method: 'get', - url: item.link, - }); - const content = cheerio.load(detailResponse.data); - - content('.img-article-item') - .find('img') - .each(function () { - content(this).attr('src', content(this).prev().attr('data-srcset').split('?')[0]); - }); - - content('.ad-zone-container, .sharing, .sentinel-article-nextArticle, .article-tags, .w-article-author-bio, .ml-form-embedContainer').remove(); - - item.description = content('.article-body').html(); - item.author = content('a.author').text().replace('By ', ''); - item.pubDate = new Date(content('time').attr('datetime')).toUTCString(); - - return item; - }) - ) - ); - - ctx.state.data = { - title: `MakeUseOf - ${$('.listing-title').text() ? $('.listing-title').text() : 'Trending'}`, - link: currentUrl, - item: items, - }; -}; diff --git a/lib/routes/matataki/site/posts/author.js b/lib/routes/matataki/site/posts/author.js deleted file mode 100644 index af84340585f049..00000000000000 --- a/lib/routes/matataki/site/posts/author.js +++ /dev/null @@ -1,17 +0,0 @@ -const matatakiUtils = require('@/routes/matataki/utils/matataki-utils'); - -module.exports = async (ctx) => { - const authorId = ctx.params.authorId; - const ipfsFlag = !!ctx.params.ipfsFlag; - - const authorName = await matatakiUtils.getUserNickname(authorId); - - const items = await matatakiUtils.getPostsAsFeedItems(`/posts/timeRanking?author=${authorId}`, ipfsFlag); - - ctx.state.data = { - title: `瞬Matataki - ${authorName}作品 ${ipfsFlag ? '(IPFS)' : ''}`, - link: `https://www.matataki.io/user/${authorId}`, - description: `瞬Matataki - ${authorName}作品`, - item: items, - }; -}; diff --git a/lib/routes/matataki/site/posts/favorite.js b/lib/routes/matataki/site/posts/favorite.js deleted file mode 100644 index b023588c0784be..00000000000000 --- a/lib/routes/matataki/site/posts/favorite.js +++ /dev/null @@ -1,42 +0,0 @@ -const matatakiUtils = require('@/routes/matataki/utils/matataki-utils'); - -module.exports = async (ctx) => { - const userId = ctx.params.userId; - const favoriteListId = ctx.params.favoriteListId; - const ipfsFlag = !!ctx.params.ipfsFlag; - - const response = await matatakiUtils.get(`/favorites/post?userId=${userId}&fid=${favoriteListId}&page=1`); - let items; - - if (ipfsFlag) { - items = await Promise.all( - response.data.data.list.map(async (item) => { - const ipfsHtmlHash = await matatakiUtils.getPostIpfsHtmlHash(item.pid); - - return { - title: item.title, - description: item.short_content, - link: `${matatakiUtils.IPFS_GATEWAY_URL}/ipfs/${ipfsHtmlHash}`, - pubDate: item.create_time, - guid: ipfsHtmlHash, - }; - }) - ); - } else { - items = response.data.data.list.map((item) => ({ - title: item.title, - description: item.short_content, - link: `https://www.matataki.io/p/${item.pid}`, - pubDate: item.create_time, - })); - } - - const text = `瞬Matataki - ${response.data.data.info.nickname || response.data.data.info.username} 收藏夹 #${response.data.data.info.name}# ${ipfsFlag ? '(IPFS)' : ''}`; - ctx.state.data = { - title: text, - link: `https://www.matataki.io/user/${userId}/favlist?fid=${favoriteListId}`, - description: text, - allowEmpty: true, - item: items, - }; -}; diff --git a/lib/routes/matataki/site/posts/scoreranking.js b/lib/routes/matataki/site/posts/scoreranking.js deleted file mode 100644 index 5930c60bc7c175..00000000000000 --- a/lib/routes/matataki/site/posts/scoreranking.js +++ /dev/null @@ -1,15 +0,0 @@ -const matatakiUtils = require('@/routes/matataki/utils/matataki-utils'); - -module.exports = async (ctx) => { - const querystring = ctx.request.querystring; - const ipfsFlag = !!ctx.params.ipfsFlag; - - const items = await matatakiUtils.getPostsAsFeedItems(`/posts/scoreRanking?${querystring}`, ipfsFlag); - - ctx.state.data = { - title: `瞬Matataki - 热门作品 ${ipfsFlag ? '(IPFS)' : ''}`, - link: `https://www.matataki.io/article/`, - description: `瞬Matataki - 热门作品`, - item: items, - }; -}; diff --git a/lib/routes/matataki/site/posts/tag.js b/lib/routes/matataki/site/posts/tag.js deleted file mode 100644 index f6e26fd82aaf3a..00000000000000 --- a/lib/routes/matataki/site/posts/tag.js +++ /dev/null @@ -1,16 +0,0 @@ -const matatakiUtils = require('@/routes/matataki/utils/matataki-utils'); - -module.exports = async (ctx) => { - const tagId = ctx.params.tagId; - const tagName = ctx.params.tagName; - const ipfsFlag = !!ctx.params.ipfsFlag; - - const items = await matatakiUtils.getPostsAsFeedItems(`/posts/getPostByTag?pagesize=20&tagid=${tagId}&extra=short_content&orderBy=hot_score&order=desc&page=1`, ipfsFlag); - - ctx.state.data = { - title: `瞬Matataki #${tagName} ${ipfsFlag ? '(IPFS)' : ''}`, - link: `https://www.matataki.io/tags/${tagId}`, - description: `瞬Matataki #${tagName}`, - item: items, - }; -}; diff --git a/lib/routes/matataki/site/posts/timeranking.js b/lib/routes/matataki/site/posts/timeranking.js deleted file mode 100644 index 98128919cdbfb4..00000000000000 --- a/lib/routes/matataki/site/posts/timeranking.js +++ /dev/null @@ -1,15 +0,0 @@ -const matatakiUtils = require('@/routes/matataki/utils/matataki-utils'); - -module.exports = async (ctx) => { - const querystring = ctx.request.querystring; - const ipfsFlag = !!ctx.params.ipfsFlag; - - const items = await matatakiUtils.getPostsAsFeedItems(`/posts/timeRanking?${querystring}`, ipfsFlag); - - ctx.state.data = { - title: `瞬Matataki - 最新作品 ${ipfsFlag ? '(IPFS)' : ''}`, - link: `https://www.matataki.io/article/latest`, - description: `瞬Matataki - 最新作品`, - item: items, - }; -}; diff --git a/lib/routes/matataki/site/posts/token.js b/lib/routes/matataki/site/posts/token.js deleted file mode 100644 index f767ac8f5d6e90..00000000000000 --- a/lib/routes/matataki/site/posts/token.js +++ /dev/null @@ -1,18 +0,0 @@ -const matatakiUtils = require('@/routes/matataki/utils/matataki-utils'); - -module.exports = async (ctx) => { - const id = ctx.params.id; - const filterCode = ctx.params.filterCode; - const ipfsFlag = !!ctx.params.ipfsFlag; - - const tokenName = await matatakiUtils.getTokenName(id); - const items = await matatakiUtils.getPostsAsFeedItems(`/minetoken/${id}/related?filter=${filterCode}&sort=time-desc&onlyCreator=0&page=1`, ipfsFlag); - - ctx.state.data = { - title: `瞬Matataki - ${tokenName ? tokenName : 'Fan票'}关联作品 ${ipfsFlag ? '(IPFS)' : ''}`, - link: `https://www.matataki.io/token/${id}/circle`, - description: `瞬Matataki - ${tokenName ? tokenName : 'Fan票'}关联作品`, - allowEmpty: true, - item: items, - }; -}; diff --git a/lib/routes/matataki/utils/matataki-utils.js b/lib/routes/matataki/utils/matataki-utils.js deleted file mode 100644 index 3c3edfc3c0f9ca..00000000000000 --- a/lib/routes/matataki/utils/matataki-utils.js +++ /dev/null @@ -1,125 +0,0 @@ -const got = require('@/utils/got'); - -/** - * Matataki API 地址 - */ -const MTATAKI_API_URL = 'https://api.mttk.net'; - -/** - * Matataki 官网地址 - */ -const MATATAKI_WEB_URL = 'https://www.matataki.io/'; - -/** - * IPFS网关的URL。可以换成其他公共网关,也可以换成自建的网关地址 - */ -const IPFS_GATEWAY_URL = 'https://10.via0.com'; - -/** - * 以`get` 方式调用Matataki API的简单封装 - * - * @param {string} path 以 / 开始 - */ -function get(path) { - return got({ - method: 'get', - url: MTATAKI_API_URL + path, - headers: { - Referer: MATATAKI_WEB_URL, - }, - }); -} - -/** - * 获取用户信息昵称 - * - * @param {number} userId - */ -async function getUserNickname(userId) { - try { - const userInfoResponse = await get(`/user/${userId}`); - return userInfoResponse.data.data.nickname || userInfoResponse.data.data.username; - } catch (err) { - return ''; - } -} - -/** - * 获取Fan票名称 - * - * @param {number} tokenId - */ -async function getTokenName(tokenId) { - try { - const tokenInfoResponse = await get(`/minetoken/${tokenId}`); - return tokenInfoResponse.data.data.token.name; - } catch (err) { - return ''; - } -} - -/** - * 获取Matataki作品在IPFS上的Hash - * - * @param {number} postId - */ -async function getPostIpfsHtmlHash(postId) { - const ipfsInfoResponse = await get(`/p/${postId}/ipfs`); - return ipfsInfoResponse.data.data[0].htmlHash; -} - -/** - * 将Matataki作品条目转为指向IPFS网关的RSS订阅源条目 - * - * @param {Object} item - */ -async function postToIpfsFeedItem(item) { - const ipfsHtmlHash = await getPostIpfsHtmlHash(item.id); - - return { - title: `${item.title} - ${item.nickname || item.author}${item.token_name ? ' $' + item.token_name : ''}`, - description: item.short_content, - link: `${IPFS_GATEWAY_URL}/ipfs/${ipfsHtmlHash}`, - pubDate: item.create_time, - guid: ipfsHtmlHash, - }; -} - -/** - * 将Matataki作品条目转为指向官网的RSS订阅源条目 - * - * @param {Object} item - */ -function postToFeedItem(item) { - return { - title: `${item.title} - ${item.nickname || item.author}${item.token_name ? ' $' + item.token_name : ''}`, - description: item.short_content, - link: `https://www.matataki.io/p/${item.id}`, - pubDate: item.create_time, - }; -} - -/** - * 获取作品列表并转为Feed Item数组 - * - * @param {string} url Matataki作品相关API的url - * @param {ipfsFlag} ipfsFlag 是否取IPFS地址 - */ -async function getPostsAsFeedItems(url, ipfsFlag) { - const response = await get(url); - if (ipfsFlag) { - return Promise.all(response.data.data.list.map(postToIpfsFeedItem)); - } - return response.data.data.list.map(postToFeedItem); -} - -module.exports = { - IPFS_GATEWAY_URL, - get, - getUserNickname, - getTokenName, - getPostIpfsHtmlHash, - postToIpfsFeedItem, - postToFeedItem, - getPostsAsFeedItems, -}; diff --git a/lib/routes/mitbbs/index.js b/lib/routes/mitbbs/index.js deleted file mode 100644 index f7a85df1f11eb3..00000000000000 --- a/lib/routes/mitbbs/index.js +++ /dev/null @@ -1,54 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); -const iconv = require('iconv-lite'); - -module.exports = async (ctx) => { - const caty = ctx.params.caty || ''; - const rootUrl = 'http://www.mitbbs.com'; - const currentUrl = `${rootUrl}/${caty === '' ? 'news/mitbbs_news_zahui.php' : 'news_pg/' + ctx.params.caty + '.html'}`; - const response = await got({ - method: 'get', - url: currentUrl, - responseType: 'buffer', - }); - - const $ = cheerio.load(iconv.decode(response.data, 'gb2312')); - const list = $('tr[align="center"] td a.blue_14p_link, tr[bgcolor="#FFFFFF"] td a.blue_14p_link') - .slice(0, 10) - .map((_, item) => { - item = $(item); - return { - title: item.text(), - link: `${rootUrl}${item.attr('href')}`, - pubDate: new Date(item.find('div.weinei_left_con_line_date').text() + ' GMT+8').toUTCString(), - }; - }) - .get(); - - const items = await Promise.all( - list.map((item) => - ctx.cache.tryGet(item.link, async () => { - const detailResponse = await got({ - method: 'get', - url: item.link, - responseType: 'buffer', - }); - const content = cheerio.load(iconv.decode(detailResponse.data, 'gb2312')); - - const dateTd = content('.black_32p').parent(); - dateTd.find('span, p').remove(); - - item.pubDate = new Date(dateTd.text().trim().replace(/年|月/g, '-').replace('日', ' ')).toUTCString(); - item.description = content('table').eq(5).find('table').eq(1).html(); - - return item; - }) - ) - ); - - ctx.state.data = { - title: `未名新闻 - ${caty === '' ? '新闻大杂烩' : $('strong').eq(1).text()}`, - link: currentUrl, - item: items, - }; -}; diff --git a/lib/routes/nba/app_news.js b/lib/routes/nba/app_news.js deleted file mode 100644 index b3fcb00375bc2b..00000000000000 --- a/lib/routes/nba/app_news.js +++ /dev/null @@ -1,40 +0,0 @@ -const got = require('@/utils/got'); - -const sourceTimezoneOffset = -8; -module.exports = async (ctx) => { - const id_url = 'https://sportsnba.qq.com/news/index?column=banner'; - const articles = await got.get(id_url); - const articleIds = articles.data.data.map((article) => article.id); - - const url = 'https://sportsnba.qq.com/news/item?column=banner&articleIds=' + articleIds.toString(); - const response = await got.get(url); - const xmls = response.data.data; - const out = Object.keys(xmls).map((xml) => { - const data = xmls[xml]; - const link = data.shareUrl; - - const guid = data.newsId; - const title = data.title; - const time = new Date(data.pub_time); - time.setTime(time.getTime() + (sourceTimezoneOffset - time.getTimezoneOffset() / 60) * 60 * 60 * 1000); - const pubDate = time.toUTCString(); - - const description = ''; - - const item = { - title, - description, - pubDate, - link, - guid, - }; - - return item; - }); - - ctx.state.data = { - title: 'NBA - news', - link: 'https://kbsapp.sports.qq.com', - item: out, - }; -}; diff --git a/lib/routes/northhouse/index.js b/lib/routes/northhouse/index.js deleted file mode 100644 index 012af84e7794af..00000000000000 --- a/lib/routes/northhouse/index.js +++ /dev/null @@ -1,54 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const category = ctx.params.category || ''; - - const rootUrl = 'http://www.northhouse.cc'; - const currentUrl = `${rootUrl}${category === '' ? '' : `/category/${category}`}`; - const response = await got({ - method: 'get', - url: currentUrl, - }); - - const $ = cheerio.load(response.data.replace(/
    <\/div>/g, '