diff --git a/.github/workflows/rebase.yml b/.github/workflows/rebase.yml index 947359ad24..917f6c0c41 100644 --- a/.github/workflows/rebase.yml +++ b/.github/workflows/rebase.yml @@ -18,4 +18,4 @@ jobs: name: Automatic Rebase uses: cirrus-actions/rebase@1.4 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.TOKEN_SUPER }} \ No newline at end of file diff --git a/assets/radar-rules.js b/assets/radar-rules.js index 6474ddca1c..8eba207081 100644 --- a/assets/radar-rules.js +++ b/assets/radar-rules.js @@ -463,12 +463,42 @@ 'juejin.cn': { _name: '掘金', '.': [ + { + title: '标签', + docs: 'https://docs.rsshub.app/programming.html#jue-jin-biao-qian', + source: '/tag/:tag', + target: '/juejin/tag/:tag', + }, + { + title: '小册', + docs: 'https://docs.rsshub.app/programming.html#jue-jin-xiao-ce', + source: '/books', + target: '/juejin/books', + }, + { + title: '沸点', + docs: 'https://docs.rsshub.app/programming.html#jue-jin-fei-dian', + source: ['/pins/:type', '/pins/topic/:type'], + target: (params) => (params.type !== 'recommended' ? '/juejin/pins/:type' : '/juejin/pins'), + }, { title: '专栏', - docs: 'https://docs.rsshub.app/programming.html#jue-jin', - source: '/user/:id/posts', + docs: 'https://docs.rsshub.app/programming.html#jue-jin-zhuan-lan', + source: ['/user/:id', '/user/:id/posts'], target: '/juejin/posts/:id', }, + { + title: '收藏集', + docs: 'https://docs.rsshub.app/programming.html#jue-jin-shou-cang-ji', + source: ['/user/:id', '/user/:id/collections'], + target: '/juejin/collections/:id', + }, + { + title: '单个收藏夹', + docs: 'https://docs.rsshub.app/programming.html#jue-jin-dan-ge-shou-cang-jia', + source: '/collection/:collectionId', + target: '/juejin/collection/:collectionId', + }, ], }, 'anime1.me': { diff --git a/docs/bbs.md b/docs/bbs.md index cbd036c839..a3eac63265 100644 --- a/docs/bbs.md +++ b/docs/bbs.md @@ -406,6 +406,24 @@ pageClass: routes +## 品葱 + +### 发现 + + + +| 最新 | 推荐 | 热门 | +| ---- | --------- | ---- | +| new | recommend | hot | + +### 精选 + + + +### 话题 + + + ## 三星盖乐世社区 ### 最新帖子 @@ -474,7 +492,7 @@ pageClass: routes ### 用户帖子 - + 用户 ID 可以通过打开用户的主页后查看地址栏的 `un` 字段来获取。 diff --git a/docs/en/install/README.md b/docs/en/install/README.md index fab3c570df..b612600623 100644 --- a/docs/en/install/README.md +++ b/docs/en/install/README.md @@ -104,6 +104,35 @@ $ docker run -d --name rsshub -p 1200:1200 -e CACHE_EXPIRE=3600 -e GITHUB_ACCESS To configure more options please refer to [Configuration](#configuration). +# Ansible Deployment + +This Ansible playbook includes RSSHub, Redis, browserless (uses Docker) and Caddy 2 + +Currently only support Ubuntu 20.04 + +Requires sudo privilege and virtualization capability (Docker will be automatically installed) + +### Install + +```bash +sudo apt update +sudo apt install ansible +git clone https://github.com/DIYgod/RSSHub.git ~/RSSHub +cd ~/RSSHub/scripts/ansible +sudo ansible-playbook rsshub.yaml +# When prompt to enter a domain name, enter the domain name that this machine/VM will use +# For example, if your users use https://rsshub.exmaple.com to access your RSSHub instance, enter rsshub.exmaple.com (remove the https://) +``` + +### Update + +```bash +cd ~/RSSHub/scripts/ansible +sudo ansible-playbook rsshub.yaml +# When prompt to enter a domain name, enter the domain name that this machine/VM will use +# For example, if your users use https://rsshub.exmaple.com to access your RSSHub instance, enter rsshub.exmaple.com (remove the https://) +``` + ## Manual Deployment The most direct way to deploy `RSSHub`, you can follow the steps below to deploy`RSSHub` on your computer, server or anywhere. @@ -394,7 +423,7 @@ See the relation between access key/code and white/blacklisting. `REQUEST_RETRY`: retries allowed for failed requests, default to `2` -`DEBUG_INFO`: display route information on homepage for debugging purpose, default to `true` +`DEBUG_INFO`: display route information on homepage for debugging purpose, default to `false` `NODE_ENV`: display error message on pages for authentication failing, default to `production` (i.e. no display) diff --git a/docs/en/new-media.md b/docs/en/new-media.md index 4c88a78f70..d0b372cc8b 100644 --- a/docs/en/new-media.md +++ b/docs/en/new-media.md @@ -67,6 +67,10 @@ Compared to the official one, the RSS feed generated by RSSHub not only has more ## CGTN +### Opinions + + + ### Most Read & Most Share @@ -215,6 +219,18 @@ Provides a better reading experience (full text articles) over the official one. +## National Association of Colleges and Employers + +### Blog + + + +| Most Recent | Top Rated | Most Read | +| - | - | - | +| | top-blogs | mostreadblogs | + + + ## Nautilus ### Topics diff --git a/docs/en/picture.md b/docs/en/picture.md index cd3cb4f024..f41db20042 100644 --- a/docs/en/picture.md +++ b/docs/en/picture.md @@ -42,6 +42,10 @@ pageClass: routes +## ComicsKingdom Comic Strips + + + ## DailyArt @@ -50,6 +54,10 @@ pageClass: routes +## GoComics Comic Strips + + + ## Google Doodles ### Update diff --git a/docs/en/program-update.md b/docs/en/program-update.md index 9325fd5e2b..13b7028215 100644 --- a/docs/en/program-update.md +++ b/docs/en/program-update.md @@ -164,6 +164,12 @@ The owner of the official image fills in the library, for example: https://rsshu +## Microsoft Store + +### Updates + + + ## Minecraft Refer to [#minecraft](/en/game.html#minecraft) diff --git a/docs/en/traditional-media.md b/docs/en/traditional-media.md index 983211fe80..7180f4bab0 100644 --- a/docs/en/traditional-media.md +++ b/docs/en/traditional-media.md @@ -20,6 +20,10 @@ Site ## AP News +### Top Stories + + + ### Topics @@ -149,6 +153,18 @@ Generates full-text feeds that the official feed doesn't provide. +## Radio Free Asia (RFA) + + + +Delivers a better experience by supporting parameter specification. + +Parameters can be obtained from the official website, for instance: + +`https://www.rfa.org/cantonese/news` corresponds to `/rfa/cantonese/news` + +`https://www.rfa.org/cantonese/news/htm` corresponds to `/rfa/cantonese/news/htm` + ## Reuters ### Channel diff --git a/docs/forecast.md b/docs/forecast.md index 684fb280a9..647cb38c24 100644 --- a/docs/forecast.md +++ b/docs/forecast.md @@ -56,9 +56,13 @@ pageClass: routes ## 停电通知 +### 95598 停电查询网 + + + ### 南京市 - + ## 停水通知 diff --git a/docs/government.md b/docs/government.md index 059809a443..eb76ada010 100644 --- a/docs/government.md +++ b/docs/government.md @@ -185,6 +185,18 @@ pageClass: routes +## 中国农工民主党 + +### 新闻中心 + + + +将目标栏目的网址拆解为 `http://www.ngd.org.cn/` 和后面的字段,去掉 `.htm` 后,把后面的字段中的 `/` 替换为 `-`,即为该路由的 slug + +如:(要闻动态)[http://www.ngd.org.cn/xwzx/ywdt/index.htm] 的网址在 `http://www.ngd.org.cn/` 后的字段是 `xwzx/ywdt/index.htm`,则对应的 slug 为 `xwzx-ywdt-index`,对应的路由即为 `/ngd/xwzx-ywdt-index` + + + ## 中国人大网 @@ -280,6 +292,32 @@ pageClass: routes +## 中国证券监督管理委员会 + +### 发审委公告 + + + +### 证监会消息 + + + +### 申请事项进度 + + + +## 中国政协网 + +### 栏目 + + + +将目标栏目的网址拆解为 `http://www.cppcc.gov.cn/` 和后面的字段,去掉 `.shtml` 后,把后面的字段中的 `/` 替换为 `-`,即为该路由的 slug + +如:(委员建言)[http://www.cppcc.gov.cn/zxww/newcppcc/wyjy/index.shtml] 的网址在 `http://www.cppcc.gov.cn/` 后的字段是 `zxww/newcppcc/wyjy/index.shtml`,则对应的 slug 为 `zxww-newcppcc-wyjy-index`,对应的路由即为 `/cppcc/zxww-newcppcc-wyjy-index` + + + ### 北京市人民政府 #### 北京教育考试院 @@ -359,20 +397,6 @@ pageClass: routes -## 中国证券监督管理委员会 - -### 发审委公告 - - - -### 证监会消息 - - - -### 申请事项进度 - - - ## 中国驻外使领馆 ### 大使馆重要通知 diff --git a/docs/install/README.md b/docs/install/README.md index cfb12f1eba..a8c59fa918 100644 --- a/docs/install/README.md +++ b/docs/install/README.md @@ -106,6 +106,35 @@ $ docker run -d --name rsshub -p 1200:1200 -e CACHE_EXPIRE=3600 -e GITHUB_ACCESS 更多配置项请看 [#配置](#pei-zhi) +## Ansible 部署 + +这个 Ansible playbook 包括了 RSSHub, Redis, browserless (依赖 Docker) 以及 Caddy 2 + +目前只支持 Ubuntu 20.04 + +需要 sudo 权限和虚拟化能力(Docker 将会被自动安装) + +### 安装 + +```bash +sudo apt update +sudo apt install ansible +git clone https://github.com/DIYgod/RSSHub.git ~/RSSHub +cd ~/RSSHub/scripts/ansible +sudo ansible-playbook rsshub.yaml +# 当提示输入 domain name 的时候,输入该主机所使用的域名 +# 举例:如果您的 RSSHub 用户使用 https://rsshub.exmaple.com 访问您的 RSSHub 实例,输入 rsshub.exmaple.com(去掉 https://) +``` + +### 更新 + +```bash +cd ~/RSSHub/scripts/ansible +sudo ansible-playbook rsshub.yaml +# 当提示输入 domain name 的时候,输入该主机所使用的域名 +# 举例:如果您的 RSSHub 用户使用 https://rsshub.exmaple.com 访问您的 RSSHub 实例,输入 rsshub.exmaple.com(去掉 https://) +``` + ## 手动部署 部署 `RSSHub` 最直接的方式,您可以按照以下步骤将 `RSSHub` 部署在您的电脑、服务器或者其他任何地方 @@ -422,7 +451,7 @@ RSSHub 支持使用访问密钥 / 码,白名单和黑名单三种方式进行 `REQUEST_RETRY`: 请求失败重试次数,默认 `2` -`DEBUG_INFO`: 是否在首页显示路由信息,默认 `true` +`DEBUG_INFO`: 是否在首页显示路由信息,默认 `false` `NODE_ENV`: 是否显示错误输出,默认 `production` (即关闭输出) @@ -619,3 +648,8 @@ RSSHub 支持使用访问密钥 / 码,白名单和黑名单三种方式进行 - `DIDA365_USERNAME`: 滴答清单用户名 - `DIDA365_PASSWORD`: 滴答清单密码 + +- 知乎用户关注时间线 + + - `ZHIHU_COOKIES`: 知乎登录后的 cookie 值. + 1. 可以在知乎网页版的一些请求的请求头中找到,如 `GET /moments` 请求头中的 `cookie` 值. diff --git a/docs/live.md b/docs/live.md index f41ff9d02d..84f153c57d 100644 --- a/docs/live.md +++ b/docs/live.md @@ -22,7 +22,7 @@ pageClass: routes ### 直播分区 - + ::: warning 注意 diff --git a/docs/new-media.md b/docs/new-media.md index 52a9128e2e..a9b2f164d2 100644 --- a/docs/new-media.md +++ b/docs/new-media.md @@ -122,6 +122,10 @@ pageClass: routes ## CGTN +### Opinions + + + ### Most Read & Most Share @@ -1370,6 +1374,18 @@ column 为 third 时可选的 category: +## 美国大学和雇主协会 + +### 博客 + + + +| Most Recent | Top Rated | Most Read | +| ----------- | --------- | ------------- | +| | top-blogs | mostreadblogs | + + + ## 梅花网 ### 作品 @@ -2016,6 +2032,9 @@ column 为 third 时可选的 category: +## 鱼塘热榜 + + ## 遠見 diff --git a/docs/program-update.md b/docs/program-update.md index 1d9a236cde..a78f659c95 100644 --- a/docs/program-update.md +++ b/docs/program-update.md @@ -212,6 +212,12 @@ pageClass: routes +## Microsoft Store + +### Updates + + + ## Minecraft 见 [#minecraft](/game.html#minecraft) @@ -310,6 +316,16 @@ pageClass: routes +## simpread + +### 消息通知 + + + +### 更新日志 + + + ## sketch.com ### beta 更新 @@ -413,3 +429,23 @@ pageClass: routes ### 金米奖 + +## 猿料 + +### 标签 + + + +标签 + +| uTools | 插件发布 | +| ------ | -------- | +| utools | plugins | + +排序 + +| 最新回复 | 热门回复 | 新鲜出炉 | 陈年旧贴 | +| -------- | ------------- | ---------- | --------- | +| | -commentCount | -createdAt | createdAt | + + diff --git a/docs/shopping.md b/docs/shopping.md index eae0a16575..a058a5241b 100644 --- a/docs/shopping.md +++ b/docs/shopping.md @@ -166,6 +166,18 @@ For instance, in +## 麦当劳 + +### 麦当劳活动资讯 + + + +| 全部分类 | 社会责任 | 人员品牌 | 产品故事 | 优惠 | 品牌文化 | 活动速报 | +| --------- | -------------- | -------- | -------- | ----- | -------- | -------- | +| news_list | responsibility | brand | product | sales | culture | event | + + + ## 缺书网 ### 促销 diff --git a/docs/social-media.md b/docs/social-media.md index e18c2d30de..d4ff76d2d9 100644 --- a/docs/social-media.md +++ b/docs/social-media.md @@ -1141,3 +1141,12 @@ rule ### 知乎书店 - 知乎周刊 + +### 用户关注时间线 + + +::: warning 注意 + +用户关注动态需要登录后的 Cookie 值,所以只能自建,详情见部署页面的配置模块。 + +::: diff --git a/docs/traditional-media.md b/docs/traditional-media.md index c9347c4f19..5fa926e34f 100644 --- a/docs/traditional-media.md +++ b/docs/traditional-media.md @@ -26,6 +26,10 @@ pageClass: routes ## AP News +### 首页头条 + + + ### 话题 @@ -181,6 +185,23 @@ pageClass: routes +## RTHK 傳媒透視 + + + +细则: + +- `:range` 时间范围参数 + (可为 `latest` 或 `四位数字的年份`) + + - `latest`: 最新的 50 篇文章 + - `2020`: 2020 年的所有文章 + +- 全文输出转换为简体字: `?opencc=t2s` + (`opencc` 是 RSSHub 的通用参数,详情请参阅 [「中文简繁体转换」](https://docs.rsshub.app/parameter.html#zhong-wen-jian-fan-ti-zhuan-huan)) + + + ## Solidot ### 最新消息 @@ -311,6 +332,14 @@ Category 列表: +### 最新文章 + + + +说明:此 RSS feed 会自动抓取财新网的最新文章,但不包含 FM 及视频内容。 + + + ## 第一财经 ### 直播区 @@ -957,3 +986,15 @@ category 对应的关键词有 ### 九江新闻 + +## 自由亚洲电台 + + + +通过指定频道参数,提供比官方源更佳的阅读体验。 + +参数均可在官网获取,如: + +`https://www.rfa.org/cantonese/news` 对应 `/rfa/cantonese/news` + +`https://www.rfa.org/cantonese/news/htm` 对应 `/rfa/cantonese/news/htm` diff --git a/docs/university.md b/docs/university.md index ed3eb8acd7..a30c3b731d 100644 --- a/docs/university.md +++ b/docs/university.md @@ -396,6 +396,10 @@ xskb1 对应 +### 信息与通信工程学院 + + + ## 东北大学 ### 东北大学新闻网 diff --git a/lib/config.js b/lib/config.js index 59f0e47e10..3e69c39790 100644 --- a/lib/config.js +++ b/lib/config.js @@ -40,7 +40,7 @@ const calculateValue = () => { listenInaddrAny: envs.LISTEN_INADDR_ANY || 1, // 是否允许公网连接,取值 0 1 requestRetry: parseInt(envs.REQUEST_RETRY) || 2, // 请求失败重试次数 // 是否显示 Debug 信息,取值 boolean 'false' 'key' ,取值为 'false' false 时永远不显示,取值为 'key' 时带上 ?debug=key 显示 - debugInfo: envs.DEBUG_INFO || true, + debugInfo: envs.DEBUG_INFO || false, disallowRobot: envs.DISALLOW_ROBOT !== '0' && envs.DISALLOW_ROBOT !== 'false', titleLengthLimit: parseInt(envs.TITLE_LENGTH_LIMIT) || 150, redis: { @@ -89,6 +89,9 @@ const calculateValue = () => { yuque: { token: envs.YUQUE_TOKEN, }, + zhihu: { + cookies: envs.ZHIHU_COOKIES, + }, puppeteerWSEndpoint: envs.PUPPETEER_WS_ENDPOINT, loggerLevel: envs.LOGGER_LEVEL || 'info', proxyUri: envs.PROXY_URI, diff --git a/lib/router.js b/lib/router.js index d1360d84ba..a14f5c4e2c 100644 --- a/lib/router.js +++ b/lib/router.js @@ -158,6 +158,7 @@ router.get('/zhihu/people/pins/:id', require('./routes/zhihu/pin/people')); router.get('/zhihu/bookstore/newest', require('./routes/zhihu/bookstore/newest')); router.get('/zhihu/pin/daily', require('./routes/zhihu/pin/daily')); router.get('/zhihu/weekly', require('./routes/zhihu/weekly')); +router.get('/zhihu/timeline', require('./routes/zhihu/timeline')); // 妹子图 router.get('/mzitu/home/:type?', require('./routes/mzitu/home')); @@ -772,6 +773,7 @@ router.get('/uestc/auto/:type?', require('./routes/universities/uestc/auto')); router.get('/uestc/cs/:type?', require('./routes/universities/uestc/cs')); router.get('/uestc/cqe/:type?', require('./routes/universities/uestc/cqe')); router.get('/uestc/gr', require('./routes/universities/uestc/gr')); +router.get('/uestc/sice', require('./routes/universities/uestc/sice')); // 云南大学 router.get('/ynu/grs/zytz', require('./routes/universities/ynu/grs/zytz')); @@ -1233,6 +1235,7 @@ router.get('/bihu/activaties/:id', require('./routes/bihu/activaties')); // 停电通知 router.get('/tingdiantz/nanjing', require('./routes/tingdiantz/nanjing')); +router.get('/tingdiantz/95598/:province/:city/:district?', require('./routes/tingdiantz/95598')); // 36kr router.get('/36kr/search/article/:keyword', require('./routes/36kr/search/article')); @@ -2488,6 +2491,7 @@ router.get('/gbcc/trust', require('./routes/gbcc/trust')); // Associated Press router.get('/apnews/topics/:topic', require('./routes/apnews/topics')); +router.get('/apnews', require('./routes/apnews/index')); // CBC router.get('/cbc/topics/:topic?', require('./routes/cbc/topics')); @@ -2850,6 +2854,9 @@ router.get('/xposed/module/:mod', require('./routes/xposed/module')); // Microsoft Edge router.get('/edge/addon/:crxid', require('./routes/edge/addon')); +// Microsoft Store +router.get('/microsoft-store/updates/:productid/:market?', require('./routes/microsoft-store/updates')); + // 上海立信会计金融学院 router.get('/slu/tzgg/:id', require('./routes/universities/slu/tzgg')); router.get('/slu/jwc/:id', require('./routes/universities/slu/jwc')); @@ -3336,6 +3343,7 @@ router.get('/fulinian/:caty?', require('./routes/fulinian/index')); // CGTN router.get('/cgtn/most/:type?/:time?', require('./routes/cgtn/most')); +router.get('/cgtn/opinions', require('./routes/cgtn/opinions')); // AppSales router.get('/appsales/:caty?/:time?', require('./routes/appsales/index')); @@ -3766,7 +3774,52 @@ router.get('/sciencenet/blog/:type?/:time?/:sort?', require('./routes/sciencenet // DailyArt router.get('/dailyart/:language?', require('./routes/dailyart/index')); + // SCBOY router.get('/scboy/thread/:tid', require('./routes/scboy/thread')); +// 猿料 +router.get('/yuanliao/:tag?/:sort?', require('./routes/yuanliao/index')); + +// 中国政协网 +router.get('/cppcc/:slug?', require('./routes/gov/cppcc/index')); + +// National Association of Colleges and Employers +router.get('/nace/blog/:sort?', require('./routes/nace/blog')); + +// Caixin Latest +router.get('/caixin/latest', require('./routes/caixin/latest')); + +// 鱼塘热榜 +router.get('/mofish/:id', require('./routes/mofish/index')); + +// Mcdonalds +router.get('/mcdonalds/:category', require('./routes/mcdonalds/news')); + +// Pincong 品葱 +router.get('/pincong/category/:category?/:sort?', require('./routes/pincong/index')); +router.get('/pincong/hot/:category?', require('./routes/pincong/hot')); +router.get('/pincong/topic/:topic', require('./routes/pincong/topic')); + +// GoComics +router.get('/gocomics/:name', require('./routes/gocomics/index')); + +// Comics Kingdom +router.get('/comicskingdom/:name', require('./routes/comicskingdom/index')); + +// Media Digest +router.get('/mediadigest/:range/:category?', require('./routes/mediadigest/category')); + +// 中国农工民主党 +router.get('/ngd/:slug?', require('./routes/gov/ngd/index')); + +// SimpRead-消息通知 +router.get('/simpread/notice', require('./routes/simpread/notice')); +// SimpRead-更新日志 +router.get('/simpread/changelog', require('./routes/simpread/changelog')); + +// Radio Free Asia +router.get('/rfa/:language?/:channel?/:subChannel?', require('./routes/rfa/index')); + + module.exports = router; diff --git a/lib/routes/apnews/index.js b/lib/routes/apnews/index.js new file mode 100644 index 0000000000..a59c24f1de --- /dev/null +++ b/lib/routes/apnews/index.js @@ -0,0 +1,54 @@ +const cheerio = require('cheerio'); +const got = require('@/utils/got'); + +module.exports = async (ctx) => { + const response = await got.get('https://apnews.com/'); + const $ = cheerio.load(response.data); + const list = []; + + // main story component + const main = $('div[data-key=main-story]').first(); + + // headline news + const headline = {}; + headline.title = $(main).find('a[data-key=card-headline] h1').first().text(); + headline.link = 'https://apnews.com' + $(main).find('a[data-key=card-headline]').first().attr('href'); + list.push(headline); + + // related stories + $(main) + .find('a[data-key=related-story-link]') + .each(function (_, e) { + const item = {}; + item.title = $(e).find('div[data-key=related-story-headline]').first().text(); + item.link = 'https://apnews.com' + $(e).attr('href'); + list.push(item); + }); + + const result = await Promise.all( + list.map( + async (item) => + await ctx.cache.tryGet(item.link, async () => { + const content = await got.get(item.link); + + const description = cheerio.load(content.data); + const metadata = JSON.parse(description('script[type="application/ld+json"]').html()); + const featureImageURL = metadata.image; + + item.description = ``; + item.description += description('div[class=Article]') + .html() + .replace(/ADVERTISEMENT/g, ''); + item.pubDate = new Date(metadata.datePublished).toISOString(); + item.author = metadata.author[0]; + return item; + }) + ) + ); + + ctx.state.data = { + title: 'Associated Press News', + link: 'https://apnews.com/', + item: result, + }; +}; diff --git a/lib/routes/caixin/article.js b/lib/routes/caixin/article.js index 29fd6d70a0..6874fe8aad 100644 --- a/lib/routes/caixin/article.js +++ b/lib/routes/caixin/article.js @@ -1,4 +1,5 @@ const got = require('@/utils/got'); +const cheerio = require('cheerio'); module.exports = async (ctx) => { const response = await got({ @@ -12,15 +13,33 @@ module.exports = async (ctx) => { const data = response.data.data.list; + const items = await Promise.all( + data.map(async (item) => { + const link = item.web_url; + const summary = `

${item.summary}

`; + + const fullText = await ctx.cache.tryGet(link, async () => { + const result = await got.get(link); + + const $ = cheerio.load(result.data); + + return $('#Main_Content_Val').html(); + }); + + return { + title: item.title, + description: fullText ? summary + fullText : summary, + link: link, + pubDate: new Date(item.time * 1000), + author: item.author_name, + }; + }) + ); + ctx.state.data = { title: `财新网 - 首页`, link: `http://www.caixin.com/`, description: '财新网 - 首页', - item: data.map((item) => ({ - title: item.title, - description: `

${item.summary}

`, - link: item.web_url, - pubDate: new Date(item.time * 1000), - })), + item: items, }; }; diff --git a/lib/routes/caixin/latest.js b/lib/routes/caixin/latest.js new file mode 100644 index 0000000000..8b5f9f0426 --- /dev/null +++ b/lib/routes/caixin/latest.js @@ -0,0 +1,71 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + const li_r = await got({ + method: 'get', + url: 'http://finance.caixin.com/2020-11-03/101622309.html', + }); + + const $ = cheerio.load(li_r.data); + const list = $('div.columnBox a[name="new_artical"]~ul.list li'); + + const tasks = []; + + list.map((_index, li) => $(li).find('a').first().attr('href')) + .filter((_index, link) => link.indexOf('fm.caixin.com') === -1 && link.indexOf('video.caixin.com') === -1) // content filter + .each((_index, link) => { + const entry = ctx.cache.tryGet(link, async () => { + const entry_r = await got.get(link); + const $ = cheerio.load(entry_r.data); + // title + const h1 = $('div#conTit h1').text(); + // desc items + const subhead = $('div#subhead.subhead').text(); + let pic_url = $('img.cx-img-loader').attr('src'); + if (pic_url === undefined) { + pic_url = $('img.cx-img-loader').attr('data-src'); + } + const pic_alt = $('dl.media_pic dd').text(); + const content = $('div#Main_Content_Val.text').html(); + + /* + const [, count] = + $('a.box_titlecontent.cost-uibtn') + .text() + .match(/本文共计(\d+)字/) || []; + if (count !== 0 && count !== undefined) { + content = `${content}

此乃财新通收费文章,全文共计${count}字。

`; + } + */ + // desc + let desc; + if (pic_url === undefined) { + desc = `

${subhead}

${content}`; + } else { + desc = `

${subhead}

${pic_alt}${content}`; + } + // time + const [, year, month, day, hour, minute] = $('div#artInfo.artInfo') + .text() + .match(/(\d+)年(\d+)月(\d+)日 *(\d+):(\d+)/); + const time = new Date(`${year}-${month}-${day}T${hour}:${minute}:00+0800`).toUTCString(); + + return { + title: h1, + description: desc, + pubDate: time, + link: link, + }; + }); + tasks.push(entry); + }); + + const rss = await Promise.all(tasks); + + ctx.state.data = { + title: '财新网 - 最新文章', + link: 'http://www.caixin.com/', + item: rss, + }; +}; diff --git a/lib/routes/cgtn/opinions.js b/lib/routes/cgtn/opinions.js new file mode 100644 index 0000000000..c10c3216c5 --- /dev/null +++ b/lib/routes/cgtn/opinions.js @@ -0,0 +1,51 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + const rootUrl = `https://www.cgtn.com/opinions`; + const response = await got({ + method: 'get', + url: rootUrl, + }); + + const $ = cheerio.load(response.data); + + $('.cg-pic').parent().remove(); + + const list = $(`.cg-title h4`) + .slice(0, 15) + .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( + async (item) => + await ctx.cache.tryGet(item.link, async () => { + const detailResponse = await got({ + method: 'get', + url: item.link, + }); + const content = cheerio.load(detailResponse.data); + + item.author = content('.news-author-name').text(); + item.description = content('#cmsMainContent').html(); + + return item; + }) + ) + ); + + ctx.state.data = { + title: 'CGTN - Opinions', + link: rootUrl, + item: items, + }; +}; diff --git a/lib/routes/comicskingdom/index.js b/lib/routes/comicskingdom/index.js new file mode 100644 index 0000000000..3a81c7b47b --- /dev/null +++ b/lib/routes/comicskingdom/index.js @@ -0,0 +1,62 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + const baseURL = 'https://www.comicskingdom.com'; + const name = ctx.params.name; + const url = `${baseURL}/${name}/archive`; + const response = await got({ + method: 'get', + url: url, + }); + + const data = response.data; + const $ = cheerio.load(data); + + // Determine Comic and Author from main page + const comic = $('title').text().replace('Comics Kingdom - ', '').trim(); + const author = $('div.author p').text(); + + // Find the links for all non-archived items + const links = $('div.archive-tile[data-is-blocked=false]') + .map((i, el) => $(el).find('a[data-prem="Comic Tile"]').first().attr('href')) + .get() + .map((url) => `${baseURL}${url}`); + + if (links.length === 0) { + throw `Comic Not Found - ${name}`; + } + const items = await Promise.all( + links.map( + async (link) => + await ctx.cache.tryGet(link, async () => { + const detailResponse = await got({ + method: 'get', + url: link, + }); + const content = cheerio.load(detailResponse.data); + + const title = content('title').text(); + const image = content('meta[property="og:image"]').attr('content'); + const description = ``; + // Pull the date out of the URL + const pubDate = new Date(link.split('/').slice(-3).join('/')).toUTCString(); + + return { + title: title, + author: author, + category: 'comic', + description: description, + pubDate: pubDate, + link: link, + }; + }) + ) + ); + + ctx.state.data = { + title: `${comic} - Comics Kingdom`, + link: url, + item: items, + }; +}; diff --git a/lib/routes/douban/later.js b/lib/routes/douban/later.js index bf6a69ee0e..8d9b784ddd 100644 --- a/lib/routes/douban/later.js +++ b/lib/routes/douban/later.js @@ -1,19 +1,32 @@ const got = require('@/utils/got'); +const cheerio = require('cheerio'); module.exports = async (ctx) => { const response = await got({ method: 'get', - url: 'https://api.douban.com/v2/movie/coming_soon?apikey=0df993c66c0c636e29ecbb5344252a4a', + url: 'https://movie.douban.com/cinema/later/beijing/', }); - const movieList = response.data.subjects; + const $ = cheerio.load(response.data); + + const item = $('#showing-soon .item') + .map((index, ele) => { + const description = $(ele).html(); + const name = $('h3', ele).text().trim(); + const date = $('ul li', ele).eq(0).text().trim(); + const type = $('ul li', ele).eq(1).text().trim(); + const link = $('a.thumb', ele).attr('href'); + + return { + title: `${date} - 《${name}》 - ${type}`, + link, + description, + }; + }) + .get(); ctx.state.data = { title: '即将上映的电影', link: 'https://movie.douban.com/cinema/later/', - item: movieList.map((item) => ({ - title: item.title, - description: `标题:${item.title}
影片类型:${item.genres.join(' | ')}
评分:${item.rating.stars === '00' ? '无' : item.rating.average}
`, - link: item.alt, - })), + item, }; }; diff --git a/lib/routes/gocomics/index.js b/lib/routes/gocomics/index.js new file mode 100644 index 0000000000..b743418358 --- /dev/null +++ b/lib/routes/gocomics/index.js @@ -0,0 +1,64 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + const baseURL = 'https://www.gocomics.com'; + const name = ctx.params.name; + const limit = ctx.query.limit || 5; + const url = `${baseURL}/${name}/`; + const response = await got({ + method: 'get', + url: url, + }); + + const data = response.data; + const $ = cheerio.load(data); + + // Determine Comic and Author from main page + const comic = $('.media-heading').eq(0).text(); + const author = $('.media-subheading').eq(0).text().replace('By ', ''); + + // Load previous comic URL + const items = []; + let previous = $('.gc-deck--cta-0 a').attr('href'); + + if (!previous) { + throw `Comic Not Found - ${name}`; + } + + while (items.length < limit) { + const link = `${baseURL}${previous}`; + /* eslint-disable no-await-in-loop */ + const item = await ctx.cache.tryGet(link, async () => { + const detailResponse = await got({ + method: 'get', + url: link, + }); + const content = cheerio.load(detailResponse.data); + + const title = content('h1.m-0').eq(0).text(); + const image = content('.comic.container').eq(0).attr('data-image'); + const description = ``; + // Pull the date out of the URL + const pubDate = new Date(link.split('/').slice(-3).join('/')).toUTCString(); + const previous = content('.js-previous-comic').eq(0).attr('href'); + + return { + title: title, + author: author, + category: 'comic', + description: description, + pubDate: pubDate, + link: link, + previous: previous, + }; + }); + items.push(item); + previous = item.previous; + } + ctx.state.data = { + title: `${comic} - GoComics`, + link: url, + item: items, + }; +}; diff --git a/lib/routes/gov/cppcc/index.js b/lib/routes/gov/cppcc/index.js new file mode 100644 index 0000000000..e0d71a856d --- /dev/null +++ b/lib/routes/gov/cppcc/index.js @@ -0,0 +1,49 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + const slug = ctx.params.slug || 'zxww-newcppcc-zxyw-index'; + + const rootUrl = 'http://www.cppcc.gov.cn'; + const currentUrl = `${rootUrl}/${slug.replace(/-/g, '/')}.shtml`; + const response = await got({ + method: 'get', + url: currentUrl, + }); + + const list = response.data + .match(/new title_array\('(.*)','(.*)','\d{4}-\d{2}-\d{2}'\);/g) + .slice(0, 15) + .map((item) => { + const array = item.replace(/new title_array\(|\);|'/g, '').split(','); + return { + link: array[0], + title: array[1], + pubDate: new Date(array[2]).toUTCString(), + }; + }); + + const items = await Promise.all( + list.map( + async (item) => + await ctx.cache.tryGet(item.link, async () => { + const detailResponse = await got({ + method: 'get', + url: item.link, + }); + const content = cheerio.load(detailResponse.data); + + item.description = content('.cnt_box .con').html(); + item.author = content('.info em').text().split(':')[1]; + + return item; + }) + ) + ); + + ctx.state.data = { + title: `${response.data.match(/><\/span>(.*)<\/p>/)[1]} - 中国政协网`, + link: currentUrl, + item: items, + }; +}; diff --git a/lib/routes/gov/ngd/index.js b/lib/routes/gov/ngd/index.js new file mode 100644 index 0000000000..5dfd996fe9 --- /dev/null +++ b/lib/routes/gov/ngd/index.js @@ -0,0 +1,52 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + const slug = ctx.params.slug || 'xwzx-ywdt-index'; + + const rootUrl = 'http://www.ngd.org.cn'; + const currentUrl = `${rootUrl}/${slug.replace(/-/g, '/')}.htm`; + const response = await got({ + method: 'get', + url: currentUrl, + }); + + const $ = cheerio.load(response.data); + + const list = $('.gp-ellipsis a') + .slice(0, 15) + .map((_, item) => { + item = $(item); + return { + title: item.text(), + link: `${currentUrl.replace('/index.htm', '')}/${item.attr('href')}`, + }; + }) + .get(); + + const items = await Promise.all( + list.map( + async (item) => + await ctx.cache.tryGet(item.link, async () => { + const detailResponse = await got({ + method: 'get', + url: item.link, + }); + const content = cheerio.load(detailResponse.data); + const info = content('.articleAuthor').text().split('|'); + + item.author = info[0].replace('来源:', ''); + item.description = content('.gp-article').html(); + item.pubDate = new Date(info[info.length - 1].replace('发布时间:', '')).toUTCString(); + + return item; + }) + ) + ); + + ctx.state.data = { + title: $('title').text(), + link: currentUrl, + item: items, + }; +}; diff --git a/lib/routes/idaily/index.js b/lib/routes/idaily/index.js index 3205f932a2..9c3567c3bd 100644 --- a/lib/routes/idaily/index.js +++ b/lib/routes/idaily/index.js @@ -6,19 +6,12 @@ module.exports = async (ctx) => { url: 'http://idaily-cdn.idailycdn.com/api/list/v3/iphone/zh-hans?page=1&ver=iphone', }); - const data = response.data; - - let dataToday = data.filter((item) => item.pubdate_timestamp * 1000 >= new Date().getTime() - 86400000); - - // leverage yesterday's items if today's not published yet - if (dataToday.length === 0) { - dataToday = data.filter((item) => item.pubdate_timestamp * 1000 >= new Date().getTime() - 86400000 * 2); - } + const data = response.data.filter((item) => item.ui_sets && item.ui_sets.caption_subtitle).slice(0, 15); ctx.state.data = { title: `iDaily 每日环球视野`, description: 'iDaily 每日环球视野', - item: dataToday.map((item) => ({ + item: data.map((item) => ({ title: item.ui_sets.caption_subtitle, description: `
${item.content}`, pubDate: new Date(item.pubdate_timestamp * 1000).toUTCString(), diff --git a/lib/routes/mcdonalds/news.js b/lib/routes/mcdonalds/news.js new file mode 100644 index 0000000000..f8fc8e3717 --- /dev/null +++ b/lib/routes/mcdonalds/news.js @@ -0,0 +1,53 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + const category_param = ctx.params.category || 'news_list'; + const categories = category_param.split('+'); + const baseUrl = 'https://www.mcdonalds.com.cn/news/'; + + const get_news_list = async (cates) => + await Promise.all( + cates.map(async (cate) => { + const response = await got.get(baseUrl + cate); + const $ = cheerio.load(response.data); + // console.log($('title').text()); + const news = $('.news_list .box-container > div') + .slice(0, 10) + .map((idx, item) => { + item = $(item); + return item.find('a[target]').attr('href'); + }) + .get(); + // console.log(news); + return Promise.resolve(news); + }) + ); + const all_news = [].concat.apply([], await get_news_list(categories)); + + const out = await Promise.all( + all_news.map(async (news_url) => { + const news_detail = await ctx.cache.tryGet(news_url, async () => { + const result = await got.get(news_url); + const $ = cheerio.load(result.data); + + // console.log($('h3 ~ time').text(), news_url); + + return { + title: $('h3').text(), + link: news_url, + // author: author, + pubDate: new Date($('h3 ~ time').text()).toUTCString(), + description: $('.cmsPage').html(), + }; + }); + return Promise.resolve(news_detail); + }) + ); + + ctx.state.data = { + title: '麦当劳资讯', + link: baseUrl, + item: out, + }; +}; diff --git a/lib/routes/mediadigest/category.js b/lib/routes/mediadigest/category.js new file mode 100644 index 0000000000..9c41c61b77 --- /dev/null +++ b/lib/routes/mediadigest/category.js @@ -0,0 +1,131 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); + +async function getArticle(ctx, list) { + const now = list.map( + async (line) => + await ctx.cache.tryGet(line, async () => { + const a_r = await got.get(`https://app3.rthk.hk/mediadigest/${line}`); + const $ = cheerio.load(a_r.data); + // title + const h1 = $('h1.story-title').text(); + // author + const author_list = $('div.story-author'); + const authors = author_list.map((_index, author) => $(author).text()); + const author = authors.map((_index, author) => `${author}
`); + const s_author = author.toArray().join(''); + const author_block = `

${s_author}

`; + // date + const date = $('div.story-calendar').text(); + // desc + const desc = `${$(author_block)}${$('div.story-content').html()}`; + + return { + title: h1, + description: desc, + pubDate: new Date(`${date}T09:00:00+0800`).toUTCString(), + link: line, + }; + }) + ); + // 執行一個切片 (20 個文章 URL) 的任務並將結果資料推至 rss 値 + return await Promise.all(now); +} + +module.exports = async (ctx) => { + const range = ctx.params.range || 'latest'; + const category = ctx.params.category || 'all'; + + // for range validation + const num = /^[1-9][0-9]{3}$/; + const current_year = new Date().getFullYear(); + // placeholders + let title = '傳媒透視'; + let rss = [ + { + description: '

Invalid :range input.

所輸入:range參數有誤。

所输入:range参数有误。

', + }, + ]; + // cid + const cids = [1, 2]; + for (let i = 4; i < 28; ++i) { + cids.push(i); + } + + // latest (50 articles): + // if 'all' (latest 50 articles of the site); + // else if 'cid' (deprecated) (latest 50 articles of a specific category); + // else 'error'. + if (range === 'latest') { + if (category === 'all') { + // 獲取全站文章 URL + const urls = cids.map((cid) => `https://app3.rthk.hk/mediadigest/category.php?cid=${cid}`); + const list_allt = await Promise.all( + urls.map(async (url) => { + const response = await got.get(url); + const $ = cheerio.load(response.data); + const list = $('div.category-line').map((_index, line) => $(line).find('a').first().attr('href')); + return Promise.resolve(list.toArray()); + }) + ); + const list_all = [...new Set(list_allt.flat())]; // removed duplicates and flatten + // 時序排列並抽取最新 50 項 + const list = list_all + .sort((a, b) => { + const aid_a = a.match(/aid=(\d+)/)[1]; + const aid_b = b.match(/aid=(\d+)/)[1]; + // reverse + return aid_b - aid_a; + }) + .slice(0, 50); + // getArticle(ctx, list); + rss = await getArticle(ctx, list); + } else if (cids.includes(parseInt(category))) { + // 獲取特定 category 文章目錄 + const response = await got.get(`https://app3.rthk.hk/mediadigest/category.php?cid=${category}`); + const $ = cheerio.load(response.data); + + const list = $('div.category-line') + .map((_index, line) => $(line).find('a').first().attr('href')) + .toArray(); + rss = await getArticle(ctx, list.slice(0, 50)); + } + } + // year (specific year range): + // if 'all' (latest 200 articles in a specific year range); + // else 'error'. + else if (num.test(range)) { + const range_num = parseInt(range); + if (category === 'all' && range_num >= 1970 && range_num <= current_year) { + // 獲取全站文章 URL + const urls = cids.map((cid) => `https://app3.rthk.hk/mediadigest/category.php?cid=${cid}`); + const list_all = await Promise.all( + // 每個任務是篩選出一個文章目錄裏需要抓取的文章 URL,以供後續「獲取全文」 + urls.map(async (url) => { + const response = await got.get(url); + const $ = cheerio.load(response.data); + // 對應文章 URL 與年份 + // Ref: https://cythilya.github.io/2016/03/13/jquery-map-grep/ + let list = $('div.category-line') + .map((_index, line) => $(line).find('a').first().attr('href')) + .toArray(); + const year = $('div.category-line div.pull-right') + .map((_index, date) => new Date($(date).text()).getFullYear()) + .toArray(); + list = list.filter((_url, i) => year[i] === range_num); + // 篩出 list (需要抓取的文章 URL 並組成數列) + return Promise.resolve(list); + }) + ); + const list = [...new Set(list_all.flat())]; // removed duplicates and flatten + rss = await getArticle(ctx, list.slice(0, 200)); + title = `傳媒透視 - ${range}`; + } + } + + ctx.state.data = { + title: title, + link: 'https://app3.rthk.hk/mediadigest/index.php', + item: rss, + }; +}; diff --git a/lib/routes/microsoft-store/updates.js b/lib/routes/microsoft-store/updates.js new file mode 100644 index 0000000000..4c5f63f625 --- /dev/null +++ b/lib/routes/microsoft-store/updates.js @@ -0,0 +1,32 @@ +const got = require('@/utils/got'); + +module.exports = async (ctx) => { + const { market = 'CN', productid } = ctx.params; + + const { data } = await got({ + method: 'get', + url: `https://displaycatalog.mp.microsoft.com/v7.0/products/${productid}/?fieldsTemplate=&market=${market}&languages=en`, + headers: { + 'Content-Type': 'application/json', + 'MS-CV': `${Array(16) + .join() + .split(',') + .map(function () { + return 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'.charAt(Math.floor(Math.random() * 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'.length)); + }) + .join('')}.1`, + }, + }); + + ctx.state.data = { + title: `${data.Product.LocalizedProperties[0].ProductTitle} - Microsoft Store Updates`, + link: `https://www.microsoft.com/store/productId/${productid}`, + item: [ + { + title: data.Product.DisplaySkuAvailabilities[0].Sku.Properties.Packages[0].PackageFullName, + pubDate: new Date(data.Product.DisplaySkuAvailabilities[0].Sku.LastModifiedDate), + link: `https://www.microsoft.com/store/productId/${productid}`, + }, + ], + }; +}; diff --git a/lib/routes/mofish/index.js b/lib/routes/mofish/index.js new file mode 100644 index 0000000000..e8890bf1ca --- /dev/null +++ b/lib/routes/mofish/index.js @@ -0,0 +1,29 @@ +const got = require('@/utils/got'); + +module.exports = async (ctx) => { + const id = ctx.params.id; + const page = ctx.query.page || 0; + + const url = `https://api.tophub.fun/v2/GetAllInfoGzip?id=${id}&page=${page}`; + + const response = await got({ + method: 'get', + url: url, + }); + + const data = response.data.Data.data; + + const title = `鱼塘热榜`; + + ctx.state.data = { + title: title, + link: `https://mo.fish/`, + description: title, + item: data.map((item) => ({ + title: item.Title, + pubDate: new Date(item.releaseTime).toUTCString(), + link: item.Url, + guid: item.id, + })), + }; +}; diff --git a/lib/routes/nace/blog.js b/lib/routes/nace/blog.js new file mode 100644 index 0000000000..6e428b8bc5 --- /dev/null +++ b/lib/routes/nace/blog.js @@ -0,0 +1,53 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + const sort = ctx.params.sort || ''; + + const rootUrl = 'https://community.naceweb.org'; + const currentUrl = `${rootUrl}/browse/blogs/${sort}`; + const response = await got({ + method: 'get', + url: currentUrl, + }); + + const $ = cheerio.load(response.data); + + const list = $('.BlogTitle') + .slice(0, 10) + .map((_, item) => { + item = $(item); + const link = item.attr('href'); + const split = link.split('/'); + + return { + link, + title: item.text(), + pubDate: new Date(`${split[5]}-${split[6]}-${split[7]}`).toUTCString(), + }; + }) + .get(); + + const items = await Promise.all( + list.map( + async (item) => + await ctx.cache.tryGet(item.link, async () => { + const detailResponse = await got({ + method: 'get', + url: item.link, + }); + const content = cheerio.load(detailResponse.data); + + item.description = content('.blogs-block .col-md-12').html(); + + return item; + }) + ) + ); + + ctx.state.data = { + title: $('title').text(), + link: currentUrl, + item: items, + }; +}; diff --git a/lib/routes/pincong/hot.js b/lib/routes/pincong/hot.js new file mode 100644 index 0000000000..0f65af2ab5 --- /dev/null +++ b/lib/routes/pincong/hot.js @@ -0,0 +1,33 @@ +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + let url = 'https://pincong.rocks/hot/list/'; + + url += ctx.params.category ? 'category-' + ctx.params.category : 'category-0'; + + // use Puppeteer due to the obstacle by cloudflare challenge + const browser = await require('@/utils/puppeteer')(); + const page = await browser.newPage(); + await page.goto(url); + const html = await page.evaluate( + // eslint-disable-next-line no-undef + () => document.documentElement.innerHTML + ); + + browser.close(); + + const $ = cheerio.load(html); + const list = $('div.aw-item'); + + ctx.state.data = { + title: '品葱 - 精选', + link: 'https://pincong.rocks/hot/', + item: list + .map((_, item) => ({ + title: $(item).find('h2 a').text().trim(), + description: $(item).find('div.markitup-box').html(), + link: 'https://pincong.rocks' + $(item).find('div.mod-head h2 a').attr('href'), + })) + .get(), + }; +}; diff --git a/lib/routes/pincong/index.js b/lib/routes/pincong/index.js new file mode 100644 index 0000000000..f1553de5f2 --- /dev/null +++ b/lib/routes/pincong/index.js @@ -0,0 +1,40 @@ +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + let url = 'https://pincong.rocks/'; + + const sortMap = { + new: 'sort_type-new', + recommend: 'recommend-1', + hot: 'sort_type-hot__day2', + }; + + url += (ctx.params.sort && sortMap[ctx.params.sort]) || 'recommend-1'; + url += ctx.params.category ? '__category-' + ctx.params.category : ''; + + // use Puppeteer due to the obstacle by cloudflare challenge + const browser = await require('@/utils/puppeteer')(); + const page = await browser.newPage(); + await page.goto(url); + const html = await page.evaluate( + // eslint-disable-next-line no-undef + () => document.querySelector('div.aw-common-list').innerHTML + ); + + browser.close(); + + const $ = cheerio.load(html); + const list = $('div.aw-item'); + + ctx.state.data = { + title: '品葱 - 发现', + link: url, + item: list + .map((_, item) => ({ + title: $(item).find('h4 a').text().trim(), + link: 'https://pincong.rocks' + $(item).find('h4 a').attr('href'), + pubDate: new Date($(item).attr('data-timestamp') * 1000).toISOString(), + })) + .get(), + }; +}; diff --git a/lib/routes/pincong/topic.js b/lib/routes/pincong/topic.js new file mode 100644 index 0000000000..2659515f80 --- /dev/null +++ b/lib/routes/pincong/topic.js @@ -0,0 +1,32 @@ +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + const url = 'https://pincong.rocks/topic/' + ctx.params.topic; + + // use Puppeteer due to the obstacle by cloudflare challenge + const browser = await require('@/utils/puppeteer')(); + const page = await browser.newPage(); + await page.goto(url); + const html = await page.evaluate( + () => + // eslint-disable-next-line no-undef + (document.querySelector('div.aw-common-list') && document.querySelector('div.aw-common-list').innerHTML) || '' + ); + + browser.close(); + + const $ = cheerio.load(html); + const list = $('div.aw-item'); + + ctx.state.data = { + title: `品葱 - ${ctx.params.topic}`, + link: url, + item: list + .map((_, item) => ({ + title: $(item).find('h4 a').text().trim(), + link: 'https://pincong.rocks' + $(item).find('h4 a').attr('href'), + pubDate: new Date($(item).attr('data-timestamp') * 1000).toISOString(), + })) + .get(), + }; +}; diff --git a/lib/routes/rfa/index.js b/lib/routes/rfa/index.js new file mode 100644 index 0000000000..90791eb2fc --- /dev/null +++ b/lib/routes/rfa/index.js @@ -0,0 +1,47 @@ +const cheerio = require('cheerio'); +const got = require('@/utils/got'); + +module.exports = async (ctx) => { + let url = 'https://www.rfa.org/' + (ctx.params.language || 'english'); + + if (ctx.params.channel) { + url += '/' + ctx.params.channel; + } + if (ctx.params.subChannel) { + url += '/' + ctx.params.subChannel; + } + + const response = await got.get(url); + const $ = cheerio.load(response.data); + + const selectors = ['div[id=topstorywidefulltease]', 'div.two_featured', 'div.three_featured', 'div.single_column_teaser', 'div.sectionteaser', 'div.specialwrap']; + const list = []; + selectors.forEach(function (selector) { + $(selector).each(function (_, e) { + const item = {}; + item.title = $(e).find('h2 a span').first().text(); + item.link = $(e).find('h2 a').first().attr('href'); + list.push(item); + }); + }); + + const result = await Promise.all( + list.map( + async (item) => + await ctx.cache.tryGet(item.link, async () => { + const content = await got.get(item.link); + + const description = cheerio.load(content.data); + item.description = description('div[id=storytext]').html(); + item.pubDate = new Date(description('span[id=story_date]').text()).toUTCString(); + return item; + }) + ) + ); + + ctx.state.data = { + title: 'RFA', + link: 'https://www.rfa.org/', + item: result, + }; +}; diff --git a/lib/routes/simpread/changelog.js b/lib/routes/simpread/changelog.js new file mode 100644 index 0000000000..59ecaea8f7 --- /dev/null +++ b/lib/routes/simpread/changelog.js @@ -0,0 +1,79 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + const url = 'http://ksria.com/simpread/changelog.html'; + const response = await got.get(url); + const data = response.data; + const $ = cheerio.load(data); + ctx.state.data = { + title: 'SimpRead 更新日志', + link: 'https://simpread.pro/changelog.html', + description: $('body > div.container.changelog > div.desc').html(), + item: $('.version') + .map((index, item) => { + const year = $(item).find('.year').html(); + const month_day = $(item).find('.day').html(); + let version = ''; + let detail = ''; + // 版本名称处理 + version = $(item).find('.num > a').clone().children().remove().end().text(); + // detail处理 + detail = $(item).find('.details'); + if (version === '') { + version = $(item).find('.num').clone().children().remove().end().text(); + } + let version_type = $(item).find('.num > a > i').attr('class'); + // 部分结构不一致处理 + if (version_type === undefined) { + version_type = $(item).find('.num > i').attr('class'); + } + if (version_type.indexOf('chrome') !== -1) { + version_type = 'Chrome'; + } + if (version_type.indexOf('apple') !== -1) { + version_type = 'Safari'; + } + if (version_type.indexOf('code') !== -1) { + version_type = 'UserScript'; + } + if (version_type.indexOf('firefox') !== -1) { + version_type = 'Firefox'; + } + + // detail + const text_color = { + important: '#9c27b0', + add: '#4caf50', + change: '#ffc107', + fix: '#f44336', + complete: '#03a9f4', + }; + $(detail) + .find('li') + .map((index, item) => { + let span_class = $(item).find('span').attr('class'); + const text = $(item).find('span').html(); + $(item).find('span').remove(); + if (span_class !== undefined) { + span_class = span_class.split(' '); + if (span_class[1] === 'empty') { + $(item).wrap('
    '); + } else { + $(item).prepend(`${text}: `); + } + } + return {}; + }); + + return { + description: $(detail).html(), + link: 'https://simpread.pro/changelog.html', + pubDate: `${year}-${month_day.replace('.', '-')} 00:00:00 GMT`, + title: `${version_type}${version}`, + author: 'SimpRead', + }; + }) + .get(), + }; +}; diff --git a/lib/routes/simpread/notice.js b/lib/routes/simpread/notice.js new file mode 100644 index 0000000000..79dd7950ef --- /dev/null +++ b/lib/routes/simpread/notice.js @@ -0,0 +1,20 @@ +const got = require('@/utils/got'); +const md = require('markdown-it')(); + +module.exports = async (ctx) => { + const url = 'https://static.simp.red/notice'; + const response = await got.get(url); + const data = response.data.notice; + ctx.state.data = { + title: 'SimpRead 消息通知', + link: 'https://simpread.pro/changelog.html', + description: 'SimpRead 消息通知', + item: data.map((item) => ({ + description: md.render(item.content), + link: 'https://simpread.pro/changelog.html', + pubDate: item.date, + title: `${item.category.name}-${item.title}`, + author: 'SimpRead', + })), + }; +}; diff --git a/lib/routes/tieba/user.js b/lib/routes/tieba/user.js index 452e96aaf5..95f7d32294 100644 --- a/lib/routes/tieba/user.js +++ b/lib/routes/tieba/user.js @@ -1,36 +1,31 @@ const got = require('@/utils/got'); -const cheerio = require('cheerio'); module.exports = async (ctx) => { const uid = ctx.params.uid; + + const rootUrl = 'https://tieba.baidu.com'; + const userUrl = `${rootUrl}/home/get/getthread?un=${uid}&pn=1&ie=utf8`; const response = await got({ method: 'get', - url: `https://tieba.baidu.com/home/main?un=${uid}`, + url: userUrl, }); - const data = response.data; - - const $ = cheerio.load(data); - const name = $('span.userinfo_username').text(); - const list = $('div.n_right.clearfix'); - let imgurl; - ctx.state.data = { - title: `${name} 的贴吧`, - link: `https://tieba.baidu.com/home/main?un=${uid}`, - item: - list && - list - .map((index, item) => { - item = $(item).find('.n_contain'); - imgurl = item.find('ul.n_media.clearfix img').attr('original'); - return { - title: item.find('div.thread_name a').attr('title'), - pubDate: item.parent().find('div .n_post_time').text(), - description: `${item.find('div.n_txt').text()}
    `, - link: item.find('div.thread_name a').attr('href'), - }; - }) - .get(), + title: `${uid}的贴子 - 百度贴吧`, + link: `${rootUrl}/home/main?un=${uid}`, + item: response.data.data.thread_list.map((item) => { + let media = ''; + if (item.media) { + for (const m of item.media) { + media += ``; + } + } + return { + title: item.title, + description: `

    ${item.content}

    ${media}`, + pubDate: new Date(item.create_time * 1000).toUTCString(), + link: `https://tieba.baidu.com/p/${item.post_id}?pid=${item.thread_id}&cid=#${item.thread_id}`, + }; + }), }; }; diff --git a/lib/routes/tingdiantz/95598.js b/lib/routes/tingdiantz/95598.js new file mode 100644 index 0000000000..9cc3161bab --- /dev/null +++ b/lib/routes/tingdiantz/95598.js @@ -0,0 +1,46 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); + +const HOME_PAGE = 'http://www.sttcq.com'; + +module.exports = async (ctx) => { + const province = ctx.params.province; + const city = ctx.params.city; + const district = ctx.params.district; + + let url; + if (district) { + url = `${HOME_PAGE}/td/${province}/${city}/${district}`; + } else { + url = `${HOME_PAGE}/td/${province}/${city}`; + } + + const response = await got.get(url); + + const data = response.data; + const $ = cheerio.load(data); + const list = $('.news-blocks ul li'); + + ctx.state.data = { + title: $('.main-nav2.clearfix').text(), + link: url, + item: list + .map((index, item) => { + const $item = $(item); + const $aTag = $item.find('a'); + const link = $aTag.attr('href'); + const title = $aTag.text(); + + let pubDate = $item.find('span').text(); + pubDate = new Date(pubDate).toUTCString(); + + return { + title, + description: '停电通知', + link: `${HOME_PAGE}${link}`, + pubDate, + }; + }) + .get(), + }; +}; diff --git a/lib/routes/universities/bit/cs/cs.js b/lib/routes/universities/bit/cs/cs.js index 605491fa6c..ab923eb31e 100644 --- a/lib/routes/universities/bit/cs/cs.js +++ b/lib/routes/universities/bit/cs/cs.js @@ -6,6 +6,9 @@ module.exports = async (ctx) => { const response = await got({ method: 'get', url: 'http://cs.bit.edu.cn/tzgg', + https: { + rejectUnauthorized: false, + }, }); const $ = cheerio.load(response.data); diff --git a/lib/routes/universities/bit/cs/utils.js b/lib/routes/universities/bit/cs/utils.js index d3d07dd1b6..2efa8cc240 100644 --- a/lib/routes/universities/bit/cs/utils.js +++ b/lib/routes/universities/bit/cs/utils.js @@ -5,7 +5,11 @@ const url = require('url'); // 专门定义一个function用于加载文章内容 async function load(link) { // 异步请求文章 - const response = await got.get(link); + const response = await got.get(link, { + https: { + rejectUnauthorized: false, + }, + }); // 加载文章内容 const $ = cheerio.load(response.data); diff --git a/lib/routes/universities/bit/jwc/jwc.js b/lib/routes/universities/bit/jwc/jwc.js index 175d6cdde3..52859cfe6f 100644 --- a/lib/routes/universities/bit/jwc/jwc.js +++ b/lib/routes/universities/bit/jwc/jwc.js @@ -6,6 +6,9 @@ module.exports = async (ctx) => { const response = await got({ method: 'get', url: 'http://jwc.bit.edu.cn/tzgg', + https: { + rejectUnauthorized: false, + }, }); const $ = cheerio.load(response.data); diff --git a/lib/routes/universities/bit/jwc/utils.js b/lib/routes/universities/bit/jwc/utils.js index 1c32dcfb67..d2891db294 100644 --- a/lib/routes/universities/bit/jwc/utils.js +++ b/lib/routes/universities/bit/jwc/utils.js @@ -5,7 +5,11 @@ const url = require('url'); // 专门定义一个function用于加载文章内容 async function load(link) { // 异步请求文章 - const response = await got.get(link); + const response = await got.get(link, { + https: { + rejectUnauthorized: false, + }, + }); // 加载文章内容 const $ = cheerio.load(response.data); diff --git a/lib/routes/universities/cpu/home.js b/lib/routes/universities/cpu/home.js index e7f1306d89..f87507ffc5 100644 --- a/lib/routes/universities/cpu/home.js +++ b/lib/routes/universities/cpu/home.js @@ -15,13 +15,13 @@ module.exports = async (ctx) => { const data = response.data; const $ = cheerio.load(data); - const $list = $('div#wp_news_w3 a').slice(0, 10).get(); + const $list = $('div#wp_news_w3 a').get(); const resultItem = await Promise.all( $list.map(async (item) => { const title = $(item).attr('title'); const href = $(item).attr('href'); - const detail_url = 'http://www.cpu.edu.cn' + href; + const detail_url = href.startsWith('/') ? `http://www.cpu.edu.cn${href}` : href; const single = { title: title, link: detail_url, @@ -37,7 +37,7 @@ module.exports = async (ctx) => { { const detail_data = detail.data; const $ = cheerio.load(detail_data); - single.description = $('table[bgcolor="#FFFFFF"]').html(); + single.description = $('table[bgcolor="#FFFFFF"]').html() || $('table.nyxx').html() || $('div.inner div.article').html(); } return Promise.resolve(single); }) diff --git a/lib/routes/universities/uestc/sice.js b/lib/routes/universities/uestc/sice.js new file mode 100644 index 0000000000..ef5f34c16f --- /dev/null +++ b/lib/routes/universities/uestc/sice.js @@ -0,0 +1,30 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + const baseIndexUrl = 'https://www.sice.uestc.edu.cn/'; + const response = await got.get(baseIndexUrl); + const $ = cheerio.load(response.data); + const out = $('.notice p') + .map((index, item) => { + item = $(item); + let date = new Date(new Date().getFullYear() + '-' + item.find('a.date').text()); + if (new Date() < date) { + date = new Date(new Date().getFullYear() - 1 + '-' + item.find('a.date').text()); + } + return { + title: item.find('a[href]').text(), + link: baseIndexUrl + item.find('a[href]').attr('href'), + pubDate: date, + }; + }) + .get(); + // console.log(out); + + ctx.state.data = { + title: '信通通知公告', + link: 'https://www.sice.uestc.edu.cn/tzgg/yb.htm', + description: '电子科技大学信息与通信工程学院通知公告', + item: out, + }; +}; diff --git a/lib/routes/xiaoheihe/news.js b/lib/routes/xiaoheihe/news.js index 1eb2d2f827..a00a6730bf 100644 --- a/lib/routes/xiaoheihe/news.js +++ b/lib/routes/xiaoheihe/news.js @@ -38,6 +38,7 @@ module.exports = async (ctx) => { // 存放到缓存区 ctx.cache.set(cacheKey, content); news.description = content; + news.link = `https://api.xiaoheihe.cn/maxnews/app/share/detail/${newsId}`; } return Promise.resolve(news); diff --git a/lib/routes/yuanliao/index.js b/lib/routes/yuanliao/index.js new file mode 100644 index 0000000000..d9333428fa --- /dev/null +++ b/lib/routes/yuanliao/index.js @@ -0,0 +1,43 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + const tag = ctx.params.tag || 'utools'; + const sort = ctx.params.sort || ''; + + const rootUrl = 'https://yuanliao.info'; + const currentUrl = `${rootUrl}/api/discussions?tags=${tag}&sort=${sort}`; + const response = await got({ + method: 'get', + url: currentUrl, + }); + + const list = response.data.data.map((item) => ({ + title: item.attributes.title, + link: `${rootUrl}/d/${item.id}-${item.attributes.slug}`, + pubDate: new Date(item.attributes.lastPostedAt).toUTCString(), + })); + + const items = await Promise.all( + list.map( + async (item) => + await ctx.cache.tryGet(item.link, async () => { + const detailResponse = await got({ + method: 'get', + url: item.link, + }); + const content = cheerio.load(detailResponse.data); + + item.description = content('#flarum-content').html(); + + return item; + }) + ) + ); + + ctx.state.data = { + title: `${tag} - 猿料`, + link: currentUrl, + item: items, + }; +}; diff --git a/lib/routes/zhihu/timeline.js b/lib/routes/zhihu/timeline.js new file mode 100644 index 0000000000..568c30a0ed --- /dev/null +++ b/lib/routes/zhihu/timeline.js @@ -0,0 +1,33 @@ +const got = require('@/utils/got'); +const config = require('@/config').value; + +module.exports = async (ctx) => { + const cookie = config.zhihu.cookies; + if (cookie === undefined) { + throw Error('缺少知乎用户登录后的 Cookie 值'); + } + + const response = await got({ + method: 'get', + url: `https://www.zhihu.com/api/v3/moments?limit=10`, + headers: { + Cookie: cookie, + }, + }); + const feeds = response.data.data; + + const out = feeds.map((e) => ({ + title: `${e.action_text}: ${e.target.title ? e.target.title : e.target.question.title}`, + description: `${e.target.excerpt}`, + pubDate: new Date(e.updated_time * 1000), + link: e.target.url.replace('api.zhihu.com', 'zhihu.com'), + author: e.target.author.name, + guid: e.id, + })); + + ctx.state.data = { + title: `知乎关注动态`, + link: `https://www.zhihu.com/follow`, + item: out, + }; +}; diff --git a/package.json b/package.json index ff684507dc..e762c5ede9 100644 --- a/package.json +++ b/package.json @@ -38,17 +38,17 @@ "@types/cheerio": "0.22.23", "@types/got": "9.6.11", "@types/koa": "2.11.6", - "@vuepress/plugin-back-to-top": "1.7.1", - "@vuepress/plugin-google-analytics": "1.7.1", - "@vuepress/plugin-pwa": "1.7.1", + "@vuepress/plugin-back-to-top": "1.8.0", + "@vuepress/plugin-google-analytics": "1.8.0", + "@vuepress/plugin-pwa": "1.8.0", "cross-env": "7.0.3", - "eslint": "7.16.0", + "eslint": "7.17.0", "eslint-config-prettier": "7.1.0", - "eslint-plugin-prettier": "3.3.0", + "eslint-plugin-prettier": "3.3.1", "jest": "26.6.3", "mockdate": "3.0.2", "nock": "13.0.5", - "nodemon": "2.0.6", + "nodemon": "2.0.7", "pinyin": "2.9.1", "prettier": "2.2.1", "prettier-check": "2.0.0", @@ -60,7 +60,7 @@ "staged-git-files": "1.2.0", "string-width": "4.2.0", "supertest": "6.0.1", - "vuepress": "1.7.1", + "vuepress": "1.8.0", "yorkie": "2.0.0" }, "dependencies": { @@ -75,14 +75,14 @@ "co-redis": "2.1.1", "crypto-js": "4.0.0", "currency-symbol-map": "4.0.4", - "dayjs": "1.9.8", + "dayjs": "1.10.3", "dotenv": "8.2.0", "emailjs-imap-client": "3.1.0", "entities": "2.1.0", "etag": "1.8.1", "fanfou-sdk": "4.2.0", "git-rev-sync": "3.0.1", - "googleapis": "66.0.0", + "googleapis": "67.0.0", "got": "11.8.1", "https-proxy-agent": "5.0.0", "iconv-lite": "0.6.2", @@ -92,7 +92,7 @@ "jsdom": "16.4.0", "json-bigint": "1.0.0", "json5": "2.1.3", - "koa": "2.13.0", + "koa": "2.13.1", "koa-basic-auth": "4.0.0", "koa-favicon": "2.1.0", "koa-mount": "4.0.0", @@ -106,10 +106,10 @@ "pidusage": "2.0.21", "plist": "3.0.1", "puppeteer": "5.5.0", - "query-string": "6.13.7", + "query-string": "6.13.8", "redis": "3.0.2", "require-all": "3.0.0", - "rss-parser": "3.9.0", + "rss-parser": "3.10.0", "showdown": "1.9.1", "socks-proxy-agent": "5.0.0", "string-similarity": "^4.0.3", diff --git a/scripts/ansible/.gitignore b/scripts/ansible/.gitignore new file mode 100644 index 0000000000..6117c52186 --- /dev/null +++ b/scripts/ansible/.gitignore @@ -0,0 +1,90 @@ +# Created by https://www.toptal.com/developers/gitignore/api/windows,linux,macos,ansible,vagrant +# Edit at https://www.toptal.com/developers/gitignore?templates=windows,linux,macos,ansible,vagrant + +### Ansible ### +*.retry + +### Linux ### +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### Vagrant ### +# General +.vagrant/ + +# Log files (if you are creating logs in debug mode, uncomment this) +# *.log + +### Vagrant Patch ### +*.box + +### Windows ### +# Windows thumbnail cache files +Thumbs.db +Thumbs.db:encryptable +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# End of https://www.toptal.com/developers/gitignore/api/windows,linux,macos,ansible,vagrant + +# vagrant logs +*.log \ No newline at end of file diff --git a/scripts/ansible/README.md b/scripts/ansible/README.md new file mode 100644 index 0000000000..50cae9b717 --- /dev/null +++ b/scripts/ansible/README.md @@ -0,0 +1,20 @@ +# Readme + +Ansible playbook to deploy [RSSHub](https://github.com/DIYgod/RSSHub) on bare-metal with Redis, browserless and Caddy 2 + +Requires sudo permission + +## Usage +On `Ubuntu 20.04`, [install ansible](https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-ansible-on-ubuntu-20-04), then + +```bash +sudo ansible-playbook rsshub.yaml +``` + +## Development +Install `vagrant`, then + +```bash +./try.sh +ansible-playbook rsshub.yaml +``` diff --git a/scripts/ansible/Vagrantfile b/scripts/ansible/Vagrantfile new file mode 100644 index 0000000000..604af7f5ad --- /dev/null +++ b/scripts/ansible/Vagrantfile @@ -0,0 +1,5 @@ +Vagrant.configure("2") do |config| + config.vm.box = "generic/ubuntu2004" + config.vm.synced_folder ".", "/vagrant", type: "rsync", rsync__exclude: ".git/" + config.ssh.extra_args = ["-t", "cd /vagrant; bash --login"] +end diff --git a/scripts/ansible/rsshub.Caddyfile b/scripts/ansible/rsshub.Caddyfile new file mode 100644 index 0000000000..7781eb24fd --- /dev/null +++ b/scripts/ansible/rsshub.Caddyfile @@ -0,0 +1,3 @@ +{{ domain_name }} + +reverse_proxy localhost:1200 diff --git a/scripts/ansible/rsshub.env b/scripts/ansible/rsshub.env new file mode 100644 index 0000000000..d4a283725c --- /dev/null +++ b/scripts/ansible/rsshub.env @@ -0,0 +1,3 @@ +NODE_ENV=production +CACHE_TYPE=redis +PUPPETEER_WS_ENDPOINT=ws://localhost:3000 diff --git a/scripts/ansible/rsshub.service b/scripts/ansible/rsshub.service new file mode 100644 index 0000000000..0c8352a44e --- /dev/null +++ b/scripts/ansible/rsshub.service @@ -0,0 +1,11 @@ +[Unit] +Description=RSSHub is an open source, easy to use, and extensible RSS feed aggregator + +[Service] +User=rsshub +WorkingDirectory=/home/rsshub/app +ExecStart=yarn start +EnvironmentFile=/home/rsshub/app/.env + +[Install] +WantedBy=multi-user.target diff --git a/scripts/ansible/rsshub.yaml b/scripts/ansible/rsshub.yaml new file mode 100644 index 0000000000..33671a51ce --- /dev/null +++ b/scripts/ansible/rsshub.yaml @@ -0,0 +1,130 @@ +- + name: Install RSSHub + hosts: localhost + become: true + vars_prompt: + - + name: domain_name + prompt: What is the domain name (without www, e.g. rsshub.example.com)? Use "http://localhost" for development in Vagrant VM. + private: no + tasks: + - + name: Check OS + fail: + msg: This playbook can only be run on Ubuntu 20.04 at this moment + when: ansible_distribution != 'Ubuntu' or ansible_distribution_version !='20.04' + - + name: Install GPG keys for repos + apt_key: + url: '{{ item }}' + state: present + with_items: + - https://deb.nodesource.com/gpgkey/nodesource.gpg.key + - https://dl.yarnpkg.com/debian/pubkey.gpg + - https://download.docker.com/linux/ubuntu/gpg + - https://dl.cloudsmith.io/public/caddy/stable/cfg/gpg/gpg.155B6D79CA56EA34.key + - + name: Install repos + apt_repository: + repo: '{{ item }}' + state: present + update_cache: yes + with_items: + - deb https://deb.nodesource.com/node_12.x focal main + - deb https://dl.yarnpkg.com/debian/ stable main + - deb https://download.docker.com/linux/ubuntu focal stable + - deb https://dl.cloudsmith.io/public/caddy/stable/deb/debian any-version main + - + name: Install prerequisites + apt: + name: + - nodejs + - yarn + - build-essential + - python-is-python2 + - redis-server + - docker-ce + - python3-pip + - virtualenv + - python3-setuptools + - caddy + state: present + update_cache: yes + - + name: Install python module for docker + pip: + name: docker + - + name: Pull docker image for browserless + docker_image: + name: browserless/chrome + source: pull + - + name: Start redis + systemd: + state: restarted + enabled: yes + name: redis + daemon_reload: yes + - + name: Copy caddy configuration + template: + src: rsshub.Caddyfile + dest: /etc/caddy/Caddyfile + - + name: Start caddy + systemd: + state: restarted + enabled: yes + name: caddy + daemon_reload: yes + - + name: Create and start browserless container + docker_container: + name: browserless + image: browserless/chrome + state: started + restart_policy: always + published_ports: + - "3000:3000" + - + name: Create the user + user: + name: rsshub + create_home: true + shell: /bin/bash + - + name: Clone the repo + git: + repo: https://github.com/DIYgod/RSSHub.git + dest: /home/rsshub/app + update: yes + - + name: Install repo dependencies + command: yarn install --production + args: + chdir: /home/rsshub/app + - + name: Copy configuration + copy: + src: rsshub.env + dest: /home/rsshub/app/.env + - + name: Own repo to the user + file: + path: /home/rsshub/app + owner: rsshub + group: rsshub + recurse: yes + - + name: Install the systemd unit + copy: + src: rsshub.service + dest: /etc/systemd/system/rsshub.service + - + name: Start the systemd service + systemd: + state: restarted + enabled: yes + name: rsshub + daemon_reload: yes diff --git a/scripts/ansible/try.sh b/scripts/ansible/try.sh new file mode 100755 index 0000000000..cd8f1df76d --- /dev/null +++ b/scripts/ansible/try.sh @@ -0,0 +1,5 @@ +#!/bin/bash +set -e + +vagrant rsync +vagrant ssh diff --git a/yarn.lock b/yarn.lock index c2b27d07d3..b6ed190df1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1906,18 +1906,18 @@ source-map "~0.6.1" vue-template-es2015-compiler "^1.9.0" -"@vuepress/core@1.7.1": - version "1.7.1" - resolved "https://registry.yarnpkg.com/@vuepress/core/-/core-1.7.1.tgz#e92faad0e9445fdd775f8e0d65e927bc35e80571" - integrity sha512-M5sxZq30Ke1vXa4ZZjk6185fwtpiJOqzXNnzcIe0GxtvtaF8Yij6b+KqQKlUJnnUXm+CKxiLCr8PTzDY26N7yw== +"@vuepress/core@1.8.0": + version "1.8.0" + resolved "https://registry.yarnpkg.com/@vuepress/core/-/core-1.8.0.tgz#b5450cdd33d7fc1e1d21a1590806d429c92d0dc9" + integrity sha512-DrHx3gXa5rUDdvjcUHhmZg1DccMwc3kiYpgtbKCuJpHksz9eAVuOxbcy/b6TGRbbY4Q5EA2Fs3kI9hvPjYdCrQ== dependencies: "@babel/core" "^7.8.4" "@vue/babel-preset-app" "^4.1.2" - "@vuepress/markdown" "1.7.1" - "@vuepress/markdown-loader" "1.7.1" - "@vuepress/plugin-last-updated" "1.7.1" - "@vuepress/plugin-register-components" "1.7.1" - "@vuepress/shared-utils" "1.7.1" + "@vuepress/markdown" "1.8.0" + "@vuepress/markdown-loader" "1.8.0" + "@vuepress/plugin-last-updated" "1.8.0" + "@vuepress/plugin-register-components" "1.8.0" + "@vuepress/shared-utils" "1.8.0" autoprefixer "^9.5.1" babel-loader "^8.0.4" cache-loader "^3.0.0" @@ -1950,21 +1950,21 @@ webpack-merge "^4.1.2" webpackbar "3.2.0" -"@vuepress/markdown-loader@1.7.1": - version "1.7.1" - resolved "https://registry.yarnpkg.com/@vuepress/markdown-loader/-/markdown-loader-1.7.1.tgz#f3ab20965d5dec6e2fc2d11c78ef1a9f08d62f72" - integrity sha512-GM1F/tRhP9qZydTC89FXJPlLH+BmZijMKom5BYLAMEXsU20A9kABTRoatPjOUbZuKT+gn03JgG97qVd8xa/ETw== +"@vuepress/markdown-loader@1.8.0": + version "1.8.0" + resolved "https://registry.yarnpkg.com/@vuepress/markdown-loader/-/markdown-loader-1.8.0.tgz#0d7493995869f974953b1aa47c7a791943d1d835" + integrity sha512-ykYTNe4mC/0CxyEfyM9+oYJqFvOMZWw5qiNZVfg2t+Ip8nVR2pFhQ6fJe07Pbtc59eT4awKSEd8/kcjhTpfeZA== dependencies: - "@vuepress/markdown" "1.7.1" + "@vuepress/markdown" "1.8.0" loader-utils "^1.1.0" lru-cache "^5.1.1" -"@vuepress/markdown@1.7.1": - version "1.7.1" - resolved "https://registry.yarnpkg.com/@vuepress/markdown/-/markdown-1.7.1.tgz#56f60c2362fd82b8f2702eefa366c0d5b02fdcbd" - integrity sha512-Ava9vJECHG1+RC53ut1dXSze35IH5tc3qesC06Ny37WS93iDSQy09j8y+a0Lugy12j1369+QQeRFWa40tdHczA== +"@vuepress/markdown@1.8.0": + version "1.8.0" + resolved "https://registry.yarnpkg.com/@vuepress/markdown/-/markdown-1.8.0.tgz#2fb0a9f6011d2543a4dc7d6a2ae976b9f49873ef" + integrity sha512-f2yhoIHTD6gaPeLLidkxuytKGQCT6Gopm0fpyKZwfFZaWWz5+RPPGevq5UTmTb+5vvO2Li44HJc1EV7QONOw9Q== dependencies: - "@vuepress/shared-utils" "1.7.1" + "@vuepress/shared-utils" "1.8.0" markdown-it "^8.4.1" markdown-it-anchor "^5.0.2" markdown-it-chain "^1.3.0" @@ -1972,64 +1972,64 @@ markdown-it-table-of-contents "^0.4.0" prismjs "^1.13.0" -"@vuepress/plugin-active-header-links@1.7.1": - version "1.7.1" - resolved "https://registry.yarnpkg.com/@vuepress/plugin-active-header-links/-/plugin-active-header-links-1.7.1.tgz#5a16281bebb977fc1c2b93d992b1a3b7ff840641" - integrity sha512-Wgf/oB9oPZLnYoLjQ/xbQc4Qa3RU5tXAo2dB4Xl/7bUL6SqBxO866kX3wPxKdSOIL58tq8iH9XbUe3Sxi8/ISQ== +"@vuepress/plugin-active-header-links@1.8.0": + version "1.8.0" + resolved "https://registry.yarnpkg.com/@vuepress/plugin-active-header-links/-/plugin-active-header-links-1.8.0.tgz#1e3f9c1057a58f3bc849d0eebbcd492975f63a88" + integrity sha512-0SqdkJLJSQqhPTgGccu/ev5zRCfeKKMkyPnUMJYsQe4zGhSosmwLcfB7LDo/VLqLhRipipzBnONESr12OgI4SQ== dependencies: lodash.debounce "^4.0.8" -"@vuepress/plugin-back-to-top@1.7.1": - version "1.7.1" - resolved "https://registry.yarnpkg.com/@vuepress/plugin-back-to-top/-/plugin-back-to-top-1.7.1.tgz#8bdc4a2de95f8244f167b3b3066c2610b88aabeb" - integrity sha512-Hw/5kQjqtkHEstifcq4gpdVwS38C3ecruLCUibq3YEES6DJUYZ8tN1oo3FTugYgpXsyn3HxWftyalozcZ2IutA== +"@vuepress/plugin-back-to-top@1.8.0": + version "1.8.0" + resolved "https://registry.yarnpkg.com/@vuepress/plugin-back-to-top/-/plugin-back-to-top-1.8.0.tgz#eb7062e33cd65f4582e012702f7f69ccf0f55ae7" + integrity sha512-myyC4ZLT887IAaKcBBles8OHYeAfYMFSvC0CqjCBOyoBExNt6E+Xg3ksYksxrew/mNCTiwxXJvu+0o2a/8WIYA== dependencies: lodash.debounce "^4.0.8" -"@vuepress/plugin-google-analytics@1.7.1": - version "1.7.1" - resolved "https://registry.yarnpkg.com/@vuepress/plugin-google-analytics/-/plugin-google-analytics-1.7.1.tgz#c337e13c8a27f6fea911a04db22a3f3596a571fb" - integrity sha512-27fQzRMsqGYpMf+ruyhsdfLv/n6z6b6LutFLE/pH66Itlh6ox9ew31x0pqYBbWIC/a4lBfXYUwFvi+DEvlb1EQ== +"@vuepress/plugin-google-analytics@1.8.0": + version "1.8.0" + resolved "https://registry.yarnpkg.com/@vuepress/plugin-google-analytics/-/plugin-google-analytics-1.8.0.tgz#99752be07867730df27e830a15c95b3f25b04741" + integrity sha512-1aILIrGjyGOtNROZhNRezrnAsTq3RA4Q9/euTkpdNDyRs4etmW6hWm5yx43Sp+upREMycpbXZ/QoOWmahGwMNA== -"@vuepress/plugin-last-updated@1.7.1": - version "1.7.1" - resolved "https://registry.yarnpkg.com/@vuepress/plugin-last-updated/-/plugin-last-updated-1.7.1.tgz#668c55daa6b8bc1d8ee42cdb4169cf67c01b6e97" - integrity sha512-VW5jhBuO0WRHDsBmFsKC6QtEyBLCgyhuH9nQ65aairCn3tdoJPz0uQ4g3lr/boVbgsPexO677Sn3dRPgYqnMug== +"@vuepress/plugin-last-updated@1.8.0": + version "1.8.0" + resolved "https://registry.yarnpkg.com/@vuepress/plugin-last-updated/-/plugin-last-updated-1.8.0.tgz#a0fcd2906a4dcae107634013f7c49ddd05e0de87" + integrity sha512-fBwtlffAabpTTalUMPSaJy/5fp3WpIA1FdWOfFcQ12X6179tupZB8fnueNsVJGBvGcdw8fbyzh5C9yKAq9lR/w== dependencies: cross-spawn "^6.0.5" -"@vuepress/plugin-nprogress@1.7.1": - version "1.7.1" - resolved "https://registry.yarnpkg.com/@vuepress/plugin-nprogress/-/plugin-nprogress-1.7.1.tgz#101ebf720eaa635a473e16ca16e7b4a7850331fa" - integrity sha512-KtqfI3RitbsEbm22EhbooTvhjfMf6zttKlbND7LcyJwP3MEPVYyzQJuET03hk9z4SgCfNV2r/W3sYyejzzTMog== +"@vuepress/plugin-nprogress@1.8.0": + version "1.8.0" + resolved "https://registry.yarnpkg.com/@vuepress/plugin-nprogress/-/plugin-nprogress-1.8.0.tgz#8fd3d5415d4c8326ca569118e935b875e5fd7bb5" + integrity sha512-JmjeJKKWhbF/8z+EnY8BCWHoHKhUWfqXjXOfV+xifITl6BJlf53I/jLFpX7Sij8Whe+SKjH7kNvc+hioUdwJQw== dependencies: nprogress "^0.2.0" -"@vuepress/plugin-pwa@1.7.1": - version "1.7.1" - resolved "https://registry.yarnpkg.com/@vuepress/plugin-pwa/-/plugin-pwa-1.7.1.tgz#22fb176b48a4f9cba3d69a0a8c6d1971efb7e49d" - integrity sha512-c3oozxPPGpraU+UnY3gp3sWnKYO3mOLcexQWXaYABWnUC3yFbHx4e8wIF8LGqp7Z75bjQuUoI+LcHqpQXyYNag== +"@vuepress/plugin-pwa@1.8.0": + version "1.8.0" + resolved "https://registry.yarnpkg.com/@vuepress/plugin-pwa/-/plugin-pwa-1.8.0.tgz#e3baa9a83828cd3d538825a5b52db3c217b2f220" + integrity sha512-wdXSi5ZNMFqIJ6uAazP6xYObrjHk4Mfez84ImZQ68zzeLw9eI8f8WfWvRW7PCRxBa3V95WIGDRcz0MZJ0JzHCg== dependencies: - "@vuepress/shared-utils" "1.7.1" + "@vuepress/shared-utils" "1.8.0" register-service-worker "^1.7.0" workbox-build "^4.3.1" -"@vuepress/plugin-register-components@1.7.1": - version "1.7.1" - resolved "https://registry.yarnpkg.com/@vuepress/plugin-register-components/-/plugin-register-components-1.7.1.tgz#1ff58e931e8c27d64f9b86f2df879ddaceccdebe" - integrity sha512-MlFdH6l3rTCJlGMvyssXVG998cq5LSMzxCuQLYcRdtHQT4HbikIcV4HSPGarWInD1mP12+qX/PvKUawGwp1eVg== +"@vuepress/plugin-register-components@1.8.0": + version "1.8.0" + resolved "https://registry.yarnpkg.com/@vuepress/plugin-register-components/-/plugin-register-components-1.8.0.tgz#cb23c8b54865926f16e81fdf5fa6ccf0dec17c0e" + integrity sha512-ztafaAxn7XFS4F8z51d+QQB6DNAUG54wBSdfKydfnHbAYgtxoALzPlJW7FKQdxvZKxqGrJa9e4rkoZsat13KRQ== dependencies: - "@vuepress/shared-utils" "1.7.1" + "@vuepress/shared-utils" "1.8.0" -"@vuepress/plugin-search@1.7.1": - version "1.7.1" - resolved "https://registry.yarnpkg.com/@vuepress/plugin-search/-/plugin-search-1.7.1.tgz#f52b6e77af30f452213bc677741cefe8a8309be2" - integrity sha512-OmiGM5eYg9c+uC50b6/cSxAhqxfD7AIui6JEztFGeECrlP33RLHmteXK9YBBZjp5wTNmoYs+NXI/cWggYUPW8Q== +"@vuepress/plugin-search@1.8.0": + version "1.8.0" + resolved "https://registry.yarnpkg.com/@vuepress/plugin-search/-/plugin-search-1.8.0.tgz#d10cc04cff7467829b2e2e896b7e72a5ebc27ce1" + integrity sha512-LlOCPg7JJ3I9WEpiBU8vCEFp6I5sa3OBu6SFHk+uK9iyKHwJYdRs4VK9x+igG40Rt/OIDRDo3c9SbLX/E/kqeA== -"@vuepress/shared-utils@1.7.1": - version "1.7.1" - resolved "https://registry.yarnpkg.com/@vuepress/shared-utils/-/shared-utils-1.7.1.tgz#028bc6003247bb4c60cdc96f231eecfb55e7b85d" - integrity sha512-ydB2ZKsFZE6hFRb9FWqzZksxAPIMJjtBawk50RP6F+YX5HbID/HlyYYZM9aDSbk6RTkjgB5UzJjggA2xM8POlw== +"@vuepress/shared-utils@1.8.0": + version "1.8.0" + resolved "https://registry.yarnpkg.com/@vuepress/shared-utils/-/shared-utils-1.8.0.tgz#b1187c764f4c2dee018b83f3560a14067d931240" + integrity sha512-CVNMiYBntQyb4CuyS4KzmglDqsuBpj8V4QMzL9gCSoMv0VmwKx05fZedu+r0G5OcxYN4qjnu99yl9G6zWhOU9w== dependencies: chalk "^2.3.2" escape-html "^1.0.3" @@ -2041,14 +2041,14 @@ toml "^3.0.0" upath "^1.1.0" -"@vuepress/theme-default@1.7.1": - version "1.7.1" - resolved "https://registry.yarnpkg.com/@vuepress/theme-default/-/theme-default-1.7.1.tgz#36fee5bb5165798c0082c512cbf4d94352260d97" - integrity sha512-a9HeTrlcWQj3ONHiABmlN2z9TyIxKfQtLsA8AL+WgjN3PikhFuZFIJGzfr+NLt67Y9oiI+S9ZfiaVyvWM+7bWQ== +"@vuepress/theme-default@1.8.0": + version "1.8.0" + resolved "https://registry.yarnpkg.com/@vuepress/theme-default/-/theme-default-1.8.0.tgz#5bcca542bc61099498f5d99a9928f0ff66e6e382" + integrity sha512-CueCaANfICFbLnEL78YxSjgCHXL7mkgQI/cfyEHBgxlr247cYJQ+9IFDQIS0fJNuzHdLRy9UFUvVrCu6go8PUg== dependencies: - "@vuepress/plugin-active-header-links" "1.7.1" - "@vuepress/plugin-nprogress" "1.7.1" - "@vuepress/plugin-search" "1.7.1" + "@vuepress/plugin-active-header-links" "1.8.0" + "@vuepress/plugin-nprogress" "1.8.0" + "@vuepress/plugin-search" "1.8.0" docsearch.js "^2.5.2" lodash "^4.17.15" stylus "^0.54.8" @@ -4304,10 +4304,10 @@ date-now@^0.1.4: resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b" integrity sha1-6vQ5/U1ISK105cx9vvIAZyueNFs= -dayjs@1.9.8, dayjs@^1.8.29: - version "1.9.8" - resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.9.8.tgz#9a65fbdca037e3d5835f98672da6e796f757cd58" - integrity sha512-F42qBtJRa30FKF7XDnOQyNUTsaxDkuaZRj/i7BejSHC34LlLfPoIU4aeopvWfM+m1dJ6/DHKAWLg2ur+pLgq1w== +dayjs@1.10.3, dayjs@^1.8.29: + version "1.10.3" + resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.10.3.tgz#cf3357c8e7f508432826371672ebf376cb7d619b" + integrity sha512-/2fdLN987N8Ki7Id8BUN2nhuiRyxTLumQnSQf9CNncFCyqFsSKb9TNhzRYcC8K8eJSJOKvbvkImo/MKKhNi4iw== de-indent@^1.0.2: version "1.0.2" @@ -4497,16 +4497,16 @@ denque@^1.4.1: resolved "https://registry.yarnpkg.com/denque/-/denque-1.4.1.tgz#6744ff7641c148c3f8a69c307e51235c1f4a37cf" integrity sha512-OfzPuSZKGcgr96rf1oODnfjqBFmr1DVoc/TrItj3Ohe0Ah1C5WX5Baquw/9U9KovnQ88EqmJbD66rKYUQYN1tQ== -depd@^1.1.2, depd@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" - integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= - -depd@~2.0.0: +depd@^2.0.0, depd@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== +depd@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" + integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= + des.js@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.0.tgz#c074d2e2aa6a8a9a07dbd61f9a15c2cd83ec8ecc" @@ -5059,10 +5059,10 @@ eslint-config-prettier@7.1.0: resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-7.1.0.tgz#5402eb559aa94b894effd6bddfa0b1ca051c858f" integrity sha512-9sm5/PxaFG7qNJvJzTROMM1Bk1ozXVTKI0buKOyb0Bsr1hrwi0H/TzxF/COtf1uxikIK8SwhX7K6zg78jAzbeA== -eslint-plugin-prettier@3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.3.0.tgz#61e295349a65688ffac0b7808ef0a8244bdd8d40" - integrity sha512-tMTwO8iUWlSRZIwS9k7/E4vrTsfvsrcM5p1eftyuqWH25nKsz/o6/54I7jwQ/3zobISyC7wMy9ZsFwgTxOcOpQ== +eslint-plugin-prettier@3.3.1: + version "3.3.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.3.1.tgz#7079cfa2497078905011e6f82e8dd8453d1371b7" + integrity sha512-Rq3jkcFY8RYeQLgk2cCwuc0P7SEFwDravPhsJZOQ5N4YI4DSg50NyqJ/9gdZHzQlHf8MvafSesbNJCcP/FF6pQ== dependencies: prettier-linter-helpers "^1.0.0" @@ -5099,10 +5099,10 @@ eslint-visitor-keys@^2.0.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz#21fdc8fbcd9c795cc0321f0563702095751511a8" integrity sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ== -eslint@7.16.0: - version "7.16.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.16.0.tgz#a761605bf9a7b32d24bb7cde59aeb0fd76f06092" - integrity sha512-iVWPS785RuDA4dWuhhgXTNrGxHHK3a8HLSMBgbbU59ruJDubUraXN8N5rn7kb8tG6sjg74eE0RA3YWT51eusEw== +eslint@7.17.0: + version "7.17.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.17.0.tgz#4ccda5bf12572ad3bf760e6f195886f50569adb0" + integrity sha512-zJk08MiBgwuGoxes5sSQhOtibZ75pz0J35XTRlZOk9xMffhpA9BTbQZxoXZzOl5zMbleShbGwtw+1kGferfFwQ== dependencies: "@babel/code-frame" "^7.0.0" "@eslint/eslintrc" "^0.2.2" @@ -6077,10 +6077,10 @@ googleapis-common@^4.4.1: url-template "^2.0.8" uuid "^8.0.0" -googleapis@66.0.0: - version "66.0.0" - resolved "https://registry.yarnpkg.com/googleapis/-/googleapis-66.0.0.tgz#008062d06b13954bd3a0425c17e8f8396e884957" - integrity sha512-jdEleRoyo/AeJZjKGC7Z2mHgochn2vR2JKqey6kydRkIBmCZxoQKLisRR4H8CRYZeEd6+c8Ns/LzS1S7qUjoFw== +googleapis@67.0.0: + version "67.0.0" + resolved "https://registry.yarnpkg.com/googleapis/-/googleapis-67.0.0.tgz#ce0b92dcf5e4bc0fd1b82666a1625eb37fd3dc36" + integrity sha512-luhulHrk42DruR+c12W2sY2rrEVoKVdjaZDuHWSxcp1qz+VxvWQpuiK2QDLCXmo36/VFPMaa+Y7rRUR+Qqzd7w== dependencies: google-auth-library "^6.0.0" googleapis-common "^4.4.1" @@ -8038,10 +8038,10 @@ koa-mount@4.0.0: debug "^4.0.1" koa-compose "^4.1.0" -koa@2.13.0: - version "2.13.0" - resolved "https://registry.yarnpkg.com/koa/-/koa-2.13.0.tgz#25217e05efd3358a7e5ddec00f0a380c9b71b501" - integrity sha512-i/XJVOfPw7npbMv67+bOeXr3gPqOAw6uh5wFyNs3QvJ47tUx3M3V9rIE0//WytY42MKz4l/MXKyGkQ2LQTfLUQ== +koa@2.13.1: + version "2.13.1" + resolved "https://registry.yarnpkg.com/koa/-/koa-2.13.1.tgz#6275172875b27bcfe1d454356a5b6b9f5a9b1051" + integrity sha512-Lb2Dloc72auj5vK4X4qqL7B5jyDPQaZucc9sR/71byg7ryoD1NCaCm63CShk9ID9quQvDEi1bGR/iGjCG7As3w== dependencies: accepts "^1.3.5" cache-content-type "^1.0.0" @@ -8050,7 +8050,7 @@ koa@2.13.0: cookies "~0.8.0" debug "~3.1.0" delegates "^1.0.0" - depd "^1.1.2" + depd "^2.0.0" destroy "^1.0.4" encodeurl "^1.0.2" escape-html "^1.0.3" @@ -9197,10 +9197,10 @@ nodemailer@6.4.16: resolved "https://registry.yarnpkg.com/nodemailer/-/nodemailer-6.4.16.tgz#5cb6391b1d79ab7eff32d6f9f48366b5a7117293" integrity sha512-68K0LgZ6hmZ7PVmwL78gzNdjpj5viqBdFqKrTtr9bZbJYj6BRj5W6WGkxXrEnUl3Co3CBXi3CZBUlpV/foGnOQ== -nodemon@2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/nodemon/-/nodemon-2.0.6.tgz#1abe1937b463aaf62f0d52e2b7eaadf28cc2240d" - integrity sha512-4I3YDSKXg6ltYpcnZeHompqac4E6JeAMpGm8tJnB9Y3T0ehasLa4139dJOcCrB93HHrUMsCrKtoAlXTqT5n4AQ== +nodemon@2.0.7: + version "2.0.7" + resolved "https://registry.yarnpkg.com/nodemon/-/nodemon-2.0.7.tgz#6f030a0a0ebe3ea1ba2a38f71bf9bab4841ced32" + integrity sha512-XHzK69Awgnec9UzHr1kc8EomQh4sjTQ8oRf8TsGrSmHDx9/UmiGG9E/mM3BuTfNeFwdNBvrqQq/RHL0xIeyFOA== dependencies: chokidar "^3.2.2" debug "^3.2.6" @@ -10626,10 +10626,10 @@ qs@~6.5.2: resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== -query-string@6.13.7, query-string@^6.2.0: - version "6.13.7" - resolved "https://registry.yarnpkg.com/query-string/-/query-string-6.13.7.tgz#af53802ff6ed56f3345f92d40a056f93681026ee" - integrity sha512-CsGs8ZYb39zu0WLkeOhe0NMePqgYdAuCqxOYKDR5LVCytDZYMGx3Bb+xypvQvPHVPijRXB0HZNFllCzHRe4gEA== +query-string@6.13.8, query-string@^6.2.0: + version "6.13.8" + resolved "https://registry.yarnpkg.com/query-string/-/query-string-6.13.8.tgz#8cf231759c85484da3cf05a851810d8e825c1159" + integrity sha512-jxJzQI2edQPE/NPUOusNjO/ZOGqr1o2OBa/3M00fU76FsLXDVbJDv/p7ng5OdQyorKrkRz1oqfwmbe5MAMePQg== dependencies: decode-uri-component "^0.2.0" split-on-first "^1.0.0" @@ -11260,10 +11260,10 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: hash-base "^3.0.0" inherits "^2.0.1" -rss-parser@3.9.0: - version "3.9.0" - resolved "https://registry.yarnpkg.com/rss-parser/-/rss-parser-3.9.0.tgz#469a1201619d155e902b073c4f495c589943085a" - integrity sha512-wlRSfGrotOXuWo19Dtl2KmQt7o9i5zzCExUrxpechE0O54BAx7JD+xhWyGumPPqiJj771ndflV3sE3bTHen0HQ== +rss-parser@3.10.0: + version "3.10.0" + resolved "https://registry.yarnpkg.com/rss-parser/-/rss-parser-3.10.0.tgz#19a8bcc569981832180a87fe58a17f1838ca3a45" + integrity sha512-TC6FNvEmdFeaW6r/60MSJT7cp4d95X4M9As+mvNtxRx7YXHxpV95syMnWZthZSeD1BRN7SEKdq6c3nxMLQRopw== dependencies: entities "^2.0.3" xml2js "^0.4.19" @@ -11977,9 +11977,9 @@ string-length@^4.0.1: strip-ansi "^6.0.0" string-similarity@^4.0.3: - version "4.0.3" - resolved "https://registry.yarnpkg.com/string-similarity/-/string-similarity-4.0.3.tgz#ef52d6fc59c8a0fc93b6307fbbc08cc6e18cde21" - integrity sha512-QEwJzNFCqq+5AGImk5z4vbsEPTN/+gtyKfXBVLBcbPBRPNganZGfQnIuf9yJ+GiwSnD65sT8xrw/uwU1Q1WmfQ== + version "4.0.4" + resolved "https://registry.yarnpkg.com/string-similarity/-/string-similarity-4.0.4.tgz#42d01ab0b34660ea8a018da8f56a3309bb8b2a5b" + integrity sha512-/q/8Q4Bl4ZKAPjj8WerIBJWALKkaPRfrvhfF8k/B23i4nzrlRj2/go1m90In7nG/3XDSbOo0+pu6RvCTM9RGMQ== string-width@4.2.0, string-width@^4.0.0, string-width@^4.2.0: version "4.2.0" @@ -13268,13 +13268,13 @@ vuepress-plugin-smooth-scroll@^0.0.3: dependencies: smoothscroll-polyfill "^0.4.3" -vuepress@1.7.1: - version "1.7.1" - resolved "https://registry.yarnpkg.com/vuepress/-/vuepress-1.7.1.tgz#bb0e139d8c407a0b5aa962cf9577832a5808937e" - integrity sha512-AdA3do1L4DNzeF8sMTE+cSUJ5hR/6f3YujU8DVowi/vFOg/SX2lJF8urvDkZUSXzaAT6aSgkI9L+B6D+i7SJjA== +vuepress@1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/vuepress/-/vuepress-1.8.0.tgz#0139d466b33fbfdb628abb76d555368b85cf9772" + integrity sha512-YvNitvoEc+JSJRv1W+IoRnvOTFyTWyUMuGuF2kTIbiSwIHb1hNinc3lqNSeBQJy7IBqyEzK5fnTq1mlynh4gwA== dependencies: - "@vuepress/core" "1.7.1" - "@vuepress/theme-default" "1.7.1" + "@vuepress/core" "1.8.0" + "@vuepress/theme-default" "1.8.0" cac "^6.5.6" envinfo "^7.2.0" opencollective-postinstall "^2.0.2"