diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index d1ffaeb44..a00661cf5 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,3 +1,11 @@ + + ## 该 PR 相关 Issue / Involved issue Close # @@ -5,9 +13,64 @@ Close # ## 完整路由地址 / Example for the proposed route(s) + + +```routes +``` + + +## 新RSS检查列表 / New RSS Script Checklist + + + +- [ ] 这个PR中包含了新的路由吗? Does this PR add new route? + - 如果有, 请完成检查列表. If yes, please finish the check list + - **如果你的PR符合下方某个事项, 也请注明. If any of the checklist item meets your PR, please fill it out.** + - [x] <- 这样打勾 +- [ ] 是否提供了文档? Documentation provided? + - [ ] 是否提供了英文文档? EN Documentation provided? +- [ ] 是否支持全文获取? Is this RSS Script support fulltext? + - [ ] 如果全文获取中需要访问文章链接, 是否使用了缓存? If fulltext requires to fetch detail pages, is cache used in the process? + - [缓存说明](https://docs.rsshub.app/joinus/#ti-jiao-xin-de-rsshub-gui-ze-bian-xie-jiao-ben-shi-yong-huan-cun) | [How to use cache](https://docs.rsshub.app/joinus/#ti-jiao-xin-de-rsshub-gui-ze-bian-xie-jiao-ben-shi-yong-huan-cun) +- [ ] 目标是否有明显的反爬/频率限制? Is there any sign of anti-bot or rate limit? + - [ ] 如果有, 是否有对应的措施? (延长缓存时间, 写文档说明, etc.) If yes, do your code reflect this sign? (e.g. write documentations, use long cache time) +- [ ] 是否引入的新的包? Any new package introduced? + - 如果有, 请说明原因. If yes, please state your reason +- [ ] 是否使用了`Puppeteer`? Make use of `Puppeteer`? + - 如果有, 请说明原因. If yes, please state your reason + + +## 说明 / Note + + diff --git a/.github/workflows/pr-deploy-route-test.yml b/.github/workflows/pr-deploy-route-test.yml new file mode 100644 index 000000000..2042fe581 --- /dev/null +++ b/.github/workflows/pr-deploy-route-test.yml @@ -0,0 +1,47 @@ +name: PR route test + +# https://github.com/actions/first-interaction/issues/10#issuecomment-670968624 +# https://github.com/actions/first-interaction/issues/10#issuecomment-752360668 +# Reopen Included +on: +- pull_request_target + + +jobs: + testRoute: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Fetch affected routes + id: fetchRoute + uses: actions/github-script@v3 + with: + # by default, JSON format returned + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const body = context.payload.pull_request.body + const number = context.payload.pull_request.number + const script = require(`${process.env.GITHUB_WORKSPACE}/scripts/workflow/test-route/identify.js`) + return await script({github, context, core}, body, number) + - name: Waiting for 200 from the Vercel Preview + if: (env.TEST_CONTINUE) + uses: patrickedqvist/wait-for-vercel-preview@master + id: waitFor200 + with: + token: ${{ secrets.GITHUB_TOKEN }} + max_timeout: 300 + - name: Generate feedback + if: (env.TEST_CONTINUE) + uses: actions/github-script@v3 + env: + TEST_BASEURL: ${{steps.waitFor200.outputs.url}} + TEST_ROUTES: ${{ steps.fetchRoute.outputs.result }} + with: + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + const link = process.env.TEST_BASEURL + const routes = JSON.parse(process.env.TEST_ROUTES) + const number = context.payload.pull_request.number + core.info(`${link}, ${routes}, ${number}`) + const script = require(`${process.env.GITHUB_WORKSPACE}/scripts/workflow/test-route/test.js`) + return await script({github, context, core}, link, routes, number) diff --git a/assets/radar-rules.js b/assets/radar-rules.js index 47b97b290..99a84e604 100644 --- a/assets/radar-rules.js +++ b/assets/radar-rules.js @@ -2035,6 +2035,82 @@ }, ], }, + '141jav.com': { + _name: '141JAV BT', + '.': [ + { + title: '今日种子', + docs: 'https://docs.rsshub.app/multimedia.html#141jav', + source: '/', + target: (params, url, document) => { + const today = document.querySelector('div.card.mb-1.card-overview').getAttribute('data-date').replace(/-/g, ''); + return `/141jav/day/${today}`; + }, + }, + { + title: '今日演员', + docs: 'https://docs.rsshub.app/multimedia.html#141jav', + source: '/', + target: (params, url, document) => { + const star = document.querySelector('div.card-content > div > a').getAttribute('href'); + return `/141jav${star}`; + }, + }, + { + title: '页面种子', + docs: 'https://docs.rsshub.app/multimedia.html#141jav', + source: ['/:type', '/:type/:key', '/:type/:key/:morekey'], + target: (params, url, document) => { + const itype = params.morekey === undefined ? `${params.type}` : params.type === 'tag' ? 'tag' : 'day'; + let ikey = `${itype === 'day' ? params.type : ''}${params.key || ''}${itype === 'tag' && params.morekey !== undefined ? '%2F' : ''}${params.morekey || ''}`; + if (ikey === '' && itype === 'tag') { + ikey = document.querySelector('div.thumbnail.is-inline > a').getAttribute('href').replace('/tag/', '').replace('/', '%2F'); + } else if (ikey === '' && itype === 'actress') { + ikey = document.querySelector('div.card > a').getAttribute('href').replace('/actress/', ''); + } + return `/141jav/${itype}/${ikey}`; + }, + }, + ], + }, + '141ppv.com': { + _name: '141ppv BT', + '.': [ + { + title: '今日种子', + docs: 'https://docs.rsshub.app/multimedia.html#141pvp', + source: '/', + target: (params, url, document) => { + const today = document.querySelector('div.card.mb-1.card-overview').getAttribute('data-date').replace(/-/g, ''); + return `/141ppv/day/${today}`; + }, + }, + { + title: '今日演员', + docs: 'https://docs.rsshub.app/multimedia.html#141ppv', + source: '/', + target: (params, url, document) => { + const star = document.querySelector('div.card-content > div > a').getAttribute('href'); + return `/141ppv${star}`; + }, + }, + { + title: '页面种子', + docs: 'https://docs.rsshub.app/multimedia.html#141ppv', + source: ['/:type', '/:type/:key', '/:type/:key/:morekey'], + target: (params, url, document) => { + const itype = params.morekey === undefined ? `${params.type}` : params.type === 'tag' ? 'tag' : 'day'; + let ikey = `${itype === 'day' ? params.type : ''}${params.key || ''}${itype === 'tag' && params.morekey !== undefined ? '%2F' : ''}${params.morekey || ''}`; + if (ikey === '' && itype === 'tag') { + ikey = document.querySelector('div.thumbnail.is-inline > a').getAttribute('href').replace('/tag/', '').replace('/', '%2F'); + } else if (ikey === '' && itype === 'actress') { + ikey = document.querySelector('div.card > a').getAttribute('href').replace('/actress/', ''); + } + return `/141ppv/${itype}/${ikey}`; + }, + }, + ], + }, 'sexinsex.net': { _name: 'sexinsex', '.': [ @@ -2500,4 +2576,18 @@ }, ], }, + 'scboy.com': { + _name: 'scboy 论坛', + www: [ + { + title: '帖子', + docs: 'https://docs.rsshub.app/bbs.html#scboy', + source: '', + target: (params, url) => { + const id = url.includes('thread') ? url.split('-')[1].split('.')[0] : ''; + return id ? `/scboy/thread/${id}` : ''; + }, + }, + ], + }, }); diff --git a/docs/anime.md b/docs/anime.md index bcc037374..cf25578ec 100644 --- a/docs/anime.md +++ b/docs/anime.md @@ -288,7 +288,7 @@ pageClass: routes ### 风之动漫 - + ## 海猫吧 diff --git a/docs/bbs.md b/docs/bbs.md index 392e28a72..f2247c6fd 100644 --- a/docs/bbs.md +++ b/docs/bbs.md @@ -180,6 +180,17 @@ pageClass: routes +## SCBOY 论坛 + +### 帖子 + + + +帖子网址如果为 那么帖子 tid 就是 `1789863`。 + +访问水区需要添加环境变量 `SCBOY_BBS_TOKEN`, 详情见部署页面的配置模块。 `SCBOY_BBS_TOKEN`在 cookies 的`bbs_token`中。 + + ## V2EX ### 最热 / 最新主题 @@ -326,6 +337,7 @@ pageClass: routes | CrackMe | crackme | | Pwn | pwn | | WEB 安全 | web | +| 外文翻译 | translate | | 全站 | all | | 类型 | type | @@ -395,6 +407,24 @@ pageClass: routes +## 品葱 + +### 发现 + + + +| 最新 | 推荐 | 热门 | +| ---- | --------- | ---- | +| new | recommend | hot | + +### 精选 + + + +### 话题 + + + ## 三星盖乐世社区 ### 最新帖子 @@ -463,7 +493,7 @@ pageClass: routes ### 用户帖子 - + 用户 ID 可以通过打开用户的主页后查看地址栏的 `un` 字段来获取。 diff --git a/docs/blog.md b/docs/blog.md index 35d38ebec..2a71f09a6 100644 --- a/docs/blog.md +++ b/docs/blog.md @@ -80,6 +80,12 @@ pageClass: routes +## Phrack Magazine + +### 文章 + + + ## WordPress diff --git a/docs/en/bbs.md b/docs/en/bbs.md index 953bb97a1..f716edc1c 100644 --- a/docs/en/bbs.md +++ b/docs/en/bbs.md @@ -35,3 +35,14 @@ pageClass: routes ### Discussion + +## SCBOY forum + +### Thread + + + +If the url of the thread is then tid would be `1789863`. + +When accessing Joeyray's Bar, `SCBOY_BBS_TOKEN` needs to be filled in `environment`. See for details. `SCBOY_BBS_TOKEN` is included in cookies with `bbs_token`. + diff --git a/docs/en/blog.md b/docs/en/blog.md index a7d4ab044..86250227f 100644 --- a/docs/en/blog.md +++ b/docs/en/blog.md @@ -31,3 +31,9 @@ pageClass: routes ### Essays + +## Phrack Magazine + +### Article + + diff --git a/docs/en/game.md b/docs/en/game.md index b8da52bd2..699d2b5fd 100755 --- a/docs/en/game.md +++ b/docs/en/game.md @@ -104,6 +104,14 @@ Sorting types, default to `date`: +### Feed The Beast Modpack Updates + + +| param | description | +| ------| ------------ | +| modpackEntry | The entry name of modpack, can be found in modpack\'s page link, for `https://www.feed-the-beast.com/modpack/ftb_presents_direwolf20_1_16`, use `ftb_presents_direwolf20_1_16`. | + + ## Nintendo ### eShop New Game Releases diff --git a/docs/en/install/README.md b/docs/en/install/README.md index 460be758e..4b97f5e1b 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. @@ -465,6 +494,7 @@ See docs of specified route and `lib/config.js` for detail information. - `IG_USERNAME`: Your Instagram username - `IG_PASSWORD`: Your Instagram password + - `IG_PROXY`: Proxy URL for Instagram Warning: Two Factor Authentication is *not* supported. diff --git a/docs/en/journal.md b/docs/en/journal.md index ffdf589d9..05f727b4f 100644 --- a/docs/en/journal.md +++ b/docs/en/journal.md @@ -90,6 +90,10 @@ The parameter id in the route is the id in the URL of the user ’s Google Schol ## MIT Technology Review + + +### Topics + diff --git a/docs/en/new-media.md b/docs/en/new-media.md index 070815cbe..a090eec64 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 @@ -75,6 +79,10 @@ Compared to the official one, the RSS feed generated by RSSHub not only has more +### Editors' Pick + + + ## China Labour Bulletin ### Commentary and Analysis @@ -260,6 +268,7 @@ This route provides a flexible plan with full text content to subscribe specific ### Blog + ## Quanta Magazine ### Archive @@ -273,6 +282,12 @@ Compared to the official one, this feed: +## Semiconductor Industry Association + +### Latest News + + + ## Simons Foundation ### Articles @@ -335,6 +350,12 @@ Provides a better reading experience (full text articles) over the official one. +## VOA News + +### Day in Photos + + + ## Vulture diff --git a/docs/en/picture.md b/docs/en/picture.md index cd3cb4f02..f41db2004 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 9325fd5e2..ab0600f4b 100644 --- a/docs/en/program-update.md +++ b/docs/en/program-update.md @@ -10,6 +10,12 @@ pageClass: routes +## AnyTXT + +### Release Notes + + + ## Apkpure ### Versions @@ -164,6 +170,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/shopping.md b/docs/en/shopping.md index 511fcc301..099fc598f 100644 --- a/docs/en/shopping.md +++ b/docs/en/shopping.md @@ -36,6 +36,12 @@ Parameter `time` only works when `mostwanted` is chosen as the category. +## booth.pm + +### Shop + + + ## Guiltfree.pl ### Onsale diff --git a/docs/en/social-media.md b/docs/en/social-media.md index fe64739a3..152b04a6b 100644 --- a/docs/en/social-media.md +++ b/docs/en/social-media.md @@ -34,6 +34,16 @@ pageClass: routes +## Gab + +### User's Posts + + + +### Popular Posts + + + ## Instagram ::: warning diff --git a/docs/en/traditional-media.md b/docs/en/traditional-media.md index 983211fe8..7180f4bab 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/finance.md b/docs/finance.md index 0e3dd9457..a180c2c0f 100644 --- a/docs/finance.md +++ b/docs/finance.md @@ -74,6 +74,21 @@ pageClass: routes | autos | banking-insurance | business-technology | consumers | healthcare-pharmaceuticals | mckinsey-global-institute | 全球基础材料 | innovation | macroeconomy | manufacturing | talent-leadership | technology-media-and-telecom | urbanization-sustainability | capital-projects-infrastructure | 交通运输与物流 | + +## 上海证券交易所 + +### 本所业务规则 + + + +将目标栏目的网址拆解为 `http://www.sse.com.cn/lawandrules/sserules/` 和后面的字段,把后面的字段中的 `/` 替换为 `-`,即为该路由的 slug + +如:(最新规则)[http://www.sse.com.cn/lawandrules/sserules/latest] 的网址在 `http://www.sse.com.cn/lawandrules/sserules/` 后的字段是 `latest`,则对应的 slug 为 `latest`,对应的路由即为 `/sse/sserules/latest` + +又如:(设立科创板并试点注册制规则 - 发行上市审核类)[http://www.sse.com.cn/lawandrules/sserules/tib/review] 的网址在 `http://www.sse.com.cn/lawandrules/sserules/` 后的字段是 `tib/review`,则对应的 slug 为 `tib-review`,对应的路由即为 `/sse/sserules/tib-review` + + + ## 世界经济论坛 ### 报告 diff --git a/docs/forecast.md b/docs/forecast.md index 684fb280a..647cb38c2 100644 --- a/docs/forecast.md +++ b/docs/forecast.md @@ -56,9 +56,13 @@ pageClass: routes ## 停电通知 +### 95598 停电查询网 + + + ### 南京市 - + ## 停水通知 diff --git a/docs/game.md b/docs/game.md index 9ac14e389..001a2ea32 100644 --- a/docs/game.md +++ b/docs/game.md @@ -211,6 +211,14 @@ pageClass: routes +### Feed The Beast (FTB) 模组包更新 + + +| 参数 | 说明 | +| ------| ------------ | +| modpackEntry | 模组包的短名从模组包的页面链接中找到,例如 `https://www.feed-the-beast.com/modpack/ftb_presents_direwolf20_1_16`,短名就是 `ftb_presents_direwolf20_1_16`。 | + + ## Nintendo ### eShop 新发售游戏 diff --git a/docs/government.md b/docs/government.md index 059809a44..d7d61b319 100644 --- a/docs/government.md +++ b/docs/government.md @@ -28,6 +28,16 @@ pageClass: routes +### 广东省深圳市人民政府 + + + +| 通知公告 | 政府采购 | 资金信息 | 重大项目 | +| :------: | :------: | :------: | :------: | +| tzgg | zfcg | zjxx | zdxm | + + + ## 国家税务总局 ### 最新文件 @@ -185,6 +195,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 +302,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 +407,6 @@ pageClass: routes -## 中国证券监督管理委员会 - -### 发审委公告 - - - -### 证监会消息 - - - -### 申请事项进度 - - - ## 中国驻外使领馆 ### 大使馆重要通知 diff --git a/docs/install/README.md b/docs/install/README.md index a98da79d6..87af9dcc1 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` 部署在您的电脑、服务器或者其他任何地方 @@ -491,7 +520,7 @@ RSSHub 支持使用访问密钥 / 码,白名单和黑名单三种方式进行 - `BILIBILI_COOKIE_{uid}`: 对应 uid 的 b 站用户登录后的 Cookie 值,`{uid}` 替换为 uid,如 `BILIBILI_COOKIE_2267573`,获取方式: 1. 打开 2. 打开控制台,切换到 Network 面板,刷新 - 3. 点击 dynamic_new 请求,找到 Cookie + 3. 点击 dynamic_new 请求,找到 Cookie。(Key:`SESSDATA`) - 语雀 全部路由:[注册地址](https://www.yuque.com/register) @@ -574,6 +603,7 @@ RSSHub 支持使用访问密钥 / 码,白名单和黑名单三种方式进行 - `IG_USERNAME`: Instagram 用户名。 - `IG_PASSWORD`: Instagram 密码。 + - `IG_PROXY`: Instagram 代理 URL。 注意,暂不支持两步验证。 @@ -619,3 +649,8 @@ RSSHub 支持使用访问密钥 / 码,白名单和黑名单三种方式进行 - `DIDA365_USERNAME`: 滴答清单用户名 - `DIDA365_PASSWORD`: 滴答清单密码 + +- 知乎用户关注时间线 + + - `ZHIHU_COOKIES`: 知乎登录后的 cookie 值. + 1. 可以在知乎网页版的一些请求的请求头中找到,如 `GET /moments` 请求头中的 `cookie` 值. diff --git a/docs/live.md b/docs/live.md index f41ff9d02..84f153c57 100644 --- a/docs/live.md +++ b/docs/live.md @@ -22,7 +22,7 @@ pageClass: routes ### 直播分区 - + ::: warning 注意 diff --git a/docs/multimedia.md b/docs/multimedia.md index d36583f23..a0e5cbca2 100644 --- a/docs/multimedia.md +++ b/docs/multimedia.md @@ -4,6 +4,102 @@ pageClass: routes # 音视频 +## 141JAV + +::: tip 提示 + +官方提供的订阅源不支持 BT 下载订阅,地址为 + +::: + +### 141JAV BT + + + +**类型** + +| 最新 | 热门 | 随机 | 指定演员 | 指定标签 | 指定日期 | +| ---- | ------- | ------ | -------- | -------- | -------- | +| new | popular | random | actress | tag | day | + +**关键词** + +| 空 | 日期范围 | 演员名 | 标签名 | 日期 | +| -- | ----------- | ------------ | -------------- | -------- | +| | 7 / 30 / 60 | Yua%20Mikami | Adult%20Awards | YYYYMMDD | + +**示例说明** + +- `/141jav/new` + + 仅当类型为 `new` `popular` 或 `random` 时关键词可为 **空** + +- `/141jav/popular/30` + + `popular` `random` 类型的关键词可填写 `7` `30` 或 `60` 三个 **日期范围** 之一 + +- `/141jav/actress/Yua%20Mikami` + + `actress` 类型的关键词必须填写 **演员名** ,可在 [此处](https://141jav.com/actress/) 演员单页链接中获取 + +- `/141jav/tag/Adult%20Awards` + + `tag` 类型的关键词必须填写 **标签名** 且标签中的 `/` 必须替换为 `%2F` ,可在 [此处](https://141jav.com/tag/) 标签单页链接中获取 + +- `/141jav/day/20200730` + + `day` 类型的关键词必须填写 **日期** ,按照示例写成形如 `20200730` 的格式 + + + +## 141PPV + +::: tip 提示 + +官方提供的订阅源不支持 BT 下载订阅,地址为 + +::: + +### 141PPV BT + + + +**类型** + +| 最新 | 热门 | 随机 | 指定演员 | 指定标签 | 指定日期 | +| ---- | ------- | ------ | -------- | -------- | -------- | +| new | popular | random | actress | tag | day | + +**关键词** + +| 空 | 日期范围 | 演员名 | 标签名 | 日期 | +| -- | ----------- | ------------ | -------------- | -------- | +| | 7 / 30 / 60 | Yua%20Mikami | Adult%20Awards | YYYYMMDD | + +**示例说明** + +- `/141ppv/new` + + 仅当类型为 `new` `popular` 或 `random` 时关键词可为 **空** + +- `/141ppv/popular/30` + + `popular` `random` 类型的关键词可填写 `7` `30` 或 `60` 三个 **日期范围** 之一 + +- `/141ppv/actress/Yua%20Mikami` + + `actress` 类型的关键词必须填写 **演员名** ,可在 [此处](https://141ppv.com/actress/) 演员单页链接中获取 + +- `/141ppv/tag/Adult%20Awards` + + `tag` 类型的关键词必须填写 **标签名** 且标签中的 `/` 必须替换为 `%2F` ,可在 [此处](https://141ppv.com/tag/) 标签单页链接中获取 + +- `/141ppv/day/20200730` + + `day` 类型的关键词必须填写 **日期** ,按照示例写成形如 `20200730` 的格式 + + + ## 2048 核基地 ### 论坛更新 @@ -344,6 +440,18 @@ pageClass: routes +## NEW 字幕组 + +### 分类 + + + +| 最近更新 | 剧集推荐 | 电影推荐 | 纪录片推荐 | 动画推荐 | 真人秀推荐 | +| -------- | -------- | -------- | ---------- | -------- | ---------- | +| 1 | 2 | 3 | 4 | 5 | 6 | + + + ## Nyaa ### 搜索结果 @@ -495,6 +603,74 @@ pageClass: routes +## 哔嘀影视 + +### 首页 + + + +#### 资源分类 + +| 不限 | 电影 | 电视剧 | +| ---- | ---- | ------ | +| all | 0 | 1 | + +#### 影视类型 + +| 不限 | 动作 | 爱情 | 喜剧 | 科幻 | 恐怖 | +| ---- | ------- | ------ | ---- | ------ | ------ | +| all | dongzuo | aiqing | xiju | kehuan | kongbu | + +| 战争 | 武侠 | 魔幻 | 剧情 | 动画 | 惊悚 | +| --------- | ----- | ------ | ------ | ------- | -------- | +| zhanzheng | wuxia | mohuan | juqing | donghua | jingsong | + +| 3D | 灾难 | 悬疑 | 警匪 | 文艺 | 青春 | +| -- | ------ | ------ | ------- | ----- | -------- | +| 3D | zainan | xuanyi | jingfei | wenyi | qingchun | + +| 冒险 | 犯罪 | 纪录 | 古装 | 奇幻 | 国语 | +| ------- | ------ | ---- | -------- | ------ | ----- | +| maoxian | fanzui | jilu | guzhuang | qihuan | guoyu | + +| 综艺 | 历史 | 运动 | 原创压制 | +| ------ | ----- | ------- | ---------- | +| zongyi | lishi | yundong | yuanchuang | + +| 美剧 | 韩剧 | 国产电视剧 | 日剧 | 英剧 | 德剧 | +| ----- | ----- | ---------- | ---- | ------ | ---- | +| meiju | hanju | guoju | riju | yingju | deju | + +| 俄剧 | 巴剧 | 加剧 | 西剧 | 意大利剧 | 泰剧 | +| ---- | ---- | ----- | ---- | -------- | ----- | +| eju | baju | jiaju | xiju | yidaliju | taiju | + +| 港台剧 | 法剧 | 澳剧 | +| --------- | ---- | ---- | +| gangtaiju | faju | aoju | + +#### 制片地区 + +| 大陆 | 中国香港 | 中国台湾 | +| ---- | -------- | -------- | + +| 美国 | 英国 | 日本 | 韩国 | 法国 | +| ---- | ---- | ---- | ---- | ---- | + +| 印度 | 德国 | 西班牙 | 意大利 | 澳大利亚 | +| ---- | ---- | ------ | ------ | -------- | + +| 比利时 | 瑞典 | 荷兰 | 丹麦 | 加拿大 | 俄罗斯 | +| ------ | ---- | ---- | ---- | ------ | ------ | + +#### 影视排序 + +| 更新时间 | 豆瓣评分 | +| -------- | -------- | +| 0 | 1 | + + + ## 播客 IBC 岩手放送| IBC ラジオ イヤーマイッタマイッタ ### IBC 岩手放送| IBC ラジオ イヤーマイッタマイッタ diff --git a/docs/new-media.md b/docs/new-media.md index 36c5e89aa..627e5a05d 100644 --- a/docs/new-media.md +++ b/docs/new-media.md @@ -122,6 +122,10 @@ pageClass: routes ## CGTN +### Opinions + + + ### Most Read & Most Share @@ -130,6 +134,10 @@ pageClass: routes +### Editors' Pick + + + ## cnBeta ### 最新 @@ -569,6 +577,12 @@ IPFS 网关有可能失效,那时候换成其他网关。 +## VOA News + +### Day in Photos + + + ## Vulture @@ -1339,13 +1353,67 @@ column 为 third 时可选的 category: ### 首页 -### 24小时热门 + +### 24 小时热门 + ### 节目 +## 留园网 + +### 分站 + + + +| 婚姻家庭 | 魅力时尚 | 女性频道 | 生活百态 | 美食厨房 | 非常影音 | +| -------- | -------- | -------- | -------- | -------- | -------- | +| life9 | life1 | chan10 | life2 | life6 | fr | + +| 车迷沙龙 | 游戏天地 | 卡通漫画 | 体坛纵横 | 运动健身 | 电脑前线 | +| -------- | -------- | -------- | -------- | -------- | -------- | +| enter7 | enter3 | enter6 | enter5 | sport | know1 | + +| 数码家电 | 旅游风向 | 摄影部落 | 奇珍异宝 | 笑口常开 | 娱乐八卦 | +| -------- | -------- | -------- | -------- | -------- | -------- | +| chan6 | life7 | chan8 | page | enter1 | enter8 | + +| 吃喝玩乐 | 文化长廊 | 军事纵横 | 百家论坛 | 科技频道 | 爱子情怀 | +| -------- | -------- | -------- | -------- | -------- | -------- | +| netstar | life10 | nz | other | chan2 | chan5 | + +| 健康人生 | 博论天下 | 史海钩沉 | 网际谈兵 | 经济观察 | 谈股论金 | +| -------- | -------- | -------- | -------- | -------- | -------- | +| life5 | bolun | chan1 | military | finance | chan4 | + +| 杂论闲侃 | 唯美乐园 | 学习园地 | 命理玄机 | 宠物情缘 | 网络歌坛 | +| -------- | -------- | -------- | -------- | -------- | -------- | +| pk | gz1 | gz2 | gz3 | life8 | chan7 | + +| 音乐殿堂 | 情感世界 | +| -------- | -------- | +| enter4 | life3 | + +::: tip 提示 + +酷 18 文档参见 [此处](https://docs.rsshub.app/picture.html#ku-18) + +禁忌书屋文档参见 [此处](https://docs.rsshub.app/reading.html#jin-ji-shu-wu) + +::: + + + +### 精华区 + + + +### 搜索关键字 + + + ## 妈咪帮 @@ -1370,6 +1438,24 @@ column 为 third 时可选的 category: +## 美国半导体行业协会 + +### 新闻 + + + +## 美国大学和雇主协会 + +### 博客 + + + +| Most Recent | Top Rated | Most Read | +| ----------- | --------- | ------------- | +| | top-blogs | mostreadblogs | + + + ## 梅花网 ### 作品 @@ -1404,18 +1490,6 @@ column 为 third 时可选的 category: -## 美国大学和雇主协会 - -### 博客 - - - -| Most Recent | Top Rated | Most Read | -| ----------- | --------- | ------------- | -| | top-blogs | mostreadblogs | - - - ## 梅斯医学 MedSci ### 推荐 @@ -2028,6 +2102,22 @@ column 为 third 时可选的 category: +## 游戏葡萄 + +无文章正文,仅有目录索引。 + +### 全部文章 + + + +### 分类 + +例子对应[深度分类](http://youxiputao.com/article/index/id/13) + + +## 鱼塘热榜 + + ## 遠見 @@ -2086,6 +2176,18 @@ column 为 third 时可选的 category: +## 眾新聞 + +### 眾聞 + + + +| 全部 | 經濟 | 社會 | 生活 | 政治 | 國際 | 台灣 | 人物 | 中國 | +| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | +| | 13 | 15 | 14 | 12 | 16 | 20 | 21 | 19 | + + + ## 装备前线 ### 首页最新帖子 diff --git a/docs/picture.md b/docs/picture.md index 3ea243e1d..2c095474f 100644 --- a/docs/picture.md +++ b/docs/picture.md @@ -358,6 +358,8 @@ R18 显示 ::: tip 提示 +留园网文档参见 [此处](https://docs.rsshub.app/new-media.html#liu-yuan-wang) + 禁忌书屋文档参见 [此处](https://docs.rsshub.app/reading.html#jin-ji-shu-wu) ::: diff --git a/docs/program-update.md b/docs/program-update.md index 1d9a236cd..649ab76f1 100644 --- a/docs/program-update.md +++ b/docs/program-update.md @@ -20,6 +20,12 @@ pageClass: routes +## AnyTXT + +### Release Notes + + + ## Apkpure ### Versions @@ -212,6 +218,12 @@ pageClass: routes +## Microsoft Store + +### Updates + + + ## Minecraft 见 [#minecraft](/game.html#minecraft) @@ -310,6 +322,16 @@ pageClass: routes +## simpread + +### 消息通知 + + + +### 更新日志 + + + ## sketch.com ### beta 更新 @@ -413,3 +435,23 @@ pageClass: routes ### 金米奖 + +## 猿料 + +### 标签 + + + +标签 + +| uTools | 插件发布 | +| ------ | -------- | +| utools | plugins | + +排序 + +| 最新回复 | 热门回复 | 新鲜出炉 | 陈年旧贴 | +| -------- | ------------- | ---------- | --------- | +| | -commentCount | -createdAt | createdAt | + + diff --git a/docs/programming.md b/docs/programming.md index 68a1c4949..ffa493b09 100644 --- a/docs/programming.md +++ b/docs/programming.md @@ -34,7 +34,7 @@ pageClass: routes ### TheBatch 周报 - + ## Dockone diff --git a/docs/reading.md b/docs/reading.md index 9ff48d5ca..0d569e9b1 100644 --- a/docs/reading.md +++ b/docs/reading.md @@ -190,10 +190,6 @@ count 的取值范围为 1-12,为防止请求次数过多,推荐设置为 5 -## 观止(每日一文) - - - ## 归档 diff --git a/docs/shopping.md b/docs/shopping.md index eae0a1657..ad773c822 100644 --- a/docs/shopping.md +++ b/docs/shopping.md @@ -36,6 +36,12 @@ pageClass: routes +## booth.pm + +### 店铺 + + + ## Craigslist ### 商品搜索 @@ -166,6 +172,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 e18c2d30d..71bdca940 100644 --- a/docs/social-media.md +++ b/docs/social-media.md @@ -320,6 +320,16 @@ Tiny Tiny RSS 会给所有 iframe 元素添加 `sandbox="allow-scripts"` 属性 +## Gab + +### 用戶時間線 + + + +### 熱門 + + + ## iCity ### 用户动态 @@ -1114,6 +1124,16 @@ rule +### 知乎分类热榜 + + + +| 全站 | 国际 | 科学 | 汽车 | 视频 | 时尚 | 时事 | 数码 | 体育 | 校园 | 影视 | +| ----- | ----- | ------- | ---- | ------ | ------- | ----- | ------- | ----- | ------ | ---- | +| total | focus | science | car | zvideo | fashion | depth | digital | sport | school | film | + + + ### 知乎想法热榜 @@ -1141,3 +1161,12 @@ rule ### 知乎书店 - 知乎周刊 + +### 用户关注时间线 + + +::: warning 注意 + +用户关注动态需要登录后的 Cookie 值,所以只能自建,详情见部署页面的配置模块。 + +::: diff --git a/docs/study.md b/docs/study.md index 042669c95..f62eb0ca4 100644 --- a/docs/study.md +++ b/docs/study.md @@ -388,6 +388,18 @@ pageClass: routes +## 阳光高考 + +### 教育部阳光高考信息公开平台招生政策规定 + + + +| 招生政策 | 深化考试招生制度改革 | 教育法律法规 | +| -------- | -------------------- | ------------ | +| dnzszc | zdgg | jyflfg | + + + ## 印象识堂 ### 印象剪藏 diff --git a/docs/traditional-media.md b/docs/traditional-media.md index 94db156ae..00404b478 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 ### 最新消息 @@ -247,6 +268,26 @@ Solidot 提供的 feed: +## Voice of America (VOA) + +透過提取全文,以獲得更好的閱讀體驗 + + + +`语言` + +| 粵語 | 中文 | 藏語 | +| --------- | ------- | ------- | +| cantonese | chinese | tibetan | + +`频道` + +可於各語言官網聚合新聞處 (如 ) 獲取 + +例如 `https://www.voacantonese.com/api/zyrtyequty` 將對應 `/voa/cantonese/zyrtyequty` + + + ## Yahoo ### 新聞 @@ -965,3 +1006,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/lib/config.js b/lib/config.js index 83112c8e7..3e69c3979 100644 --- a/lib/config.js +++ b/lib/config.js @@ -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, @@ -182,6 +185,9 @@ const calculateValue = () => { username: envs.DIDA365_USERNAME, password: envs.DIDA365_PASSWORD, }, + scboy: { + token: envs.SCBOY_BBS_TOKEN, + }, }; }; calculateValue(); diff --git a/lib/router.js b/lib/router.js index 76cab4faa..5fdfe7655 100644 --- a/lib/router.js +++ b/lib/router.js @@ -158,6 +158,8 @@ 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('/zhihu/hot/:category?', require('./routes/zhihu/hot')); // 妹子图 router.get('/mzitu/home/:type?', require('./routes/mzitu/home')); @@ -496,8 +498,10 @@ router.get('/oschina/user/:id', require('./routes/oschina/user')); router.get('/oschina/u/:id', require('./routes/oschina/u')); router.get('/oschina/topic/:topic', require('./routes/oschina/topic')); -// MIT technology review +// MIT Technology Review +router.get('/technologyreview', require('./routes/technologyreview/index')); router.get('/technologyreview/:category_name', require('./routes/technologyreview/topic')); + // 安全客 router.get('/aqk/vul', require('./routes/aqk/vul')); router.get('/aqk/:category', require('./routes/aqk/category')); @@ -774,7 +778,6 @@ 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')); router.get('/ynu/grs/qttz/:category', require('./routes/universities/ynu/grs/qttz')); @@ -1235,6 +1238,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')); @@ -1331,6 +1335,8 @@ router.get('/gov/beijing/bjeea/:type', require('./routes/gov/beijing/eea')); // 广东省教育厅 router.get('/gov/guangdong/edu/:caty', require('./routes/gov/guangdong/edu')); +// 广东省深圳市 +router.get('/gov/shenzhen/xxgk/zfxxgj/:caty', require('./routes/gov/shenzhen/xxgk/zfxxgj')); // 日本国外務省記者会見 router.get('/go.jp/mofa', require('./routes/go.jp/mofa/main')); @@ -2490,6 +2496,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')); @@ -2852,6 +2859,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')); @@ -2931,7 +2941,7 @@ router.get('/grubstreet', require('./routes/grubstreet/index')); router.get('/manhuadui/manhua/:name/:serial?', require('./routes/manhuadui/manhua')); // 风之漫画 -router.get('/fzdm/manhua/:id', require('./routes/fzdm/manhua')); +router.get('/fzdm/manhua/:id/:nums?', require('./routes/fzdm/manhua')); // Aljazeera 半岛网 router.get('/aljazeera/news', require('./routes/aljazeera/news')); @@ -3194,6 +3204,12 @@ router.get('/scut/scet/notice', require('./routes/universities/scut/scet/notice' // OneJAV router.get('/onejav/:type/:key?', require('./routes/onejav/one')); +// 141jav +router.get('/141jav/:type/:key?', require('./routes/141jav/141jav')); + +// 141ppv +router.get('/141ppv/:type/:key?', require('./routes/141ppv/141ppv')); + // CuriousCat router.get('/curiouscat/user/:id', require('./routes/curiouscat/user')); @@ -3337,14 +3353,16 @@ router.get('/qzcea/:caty?', require('./routes/qzcea/index')); router.get('/fulinian/:caty?', require('./routes/fulinian/index')); // CGTN +router.get('/cgtn/top', require('./routes/cgtn/top')); router.get('/cgtn/most/:type?/:time?', require('./routes/cgtn/most')); +router.get('/cgtn/pick', require('./routes/cgtn/pick')); + +router.get('/cgtn/opinions', require('./routes/cgtn/opinions')); + // AppSales router.get('/appsales/:caty?/:time?', require('./routes/appsales/index')); -// CGTN -router.get('/cgtn/top', require('./routes/cgtn/top')); - // Academy of Management router.get('/aom/journal/:id', require('./routes/aom/journal')); @@ -3768,10 +3786,96 @@ 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')); +// Semiconductor Industry Association +router.get('/semiconductors/latest-news', require('./routes/semiconductors/latest-news')); + +// VOA News +router.get('/voa/day-photos', require('./routes/voa/day-photos')); + +// Voice of America +router.get('/voa/:language/:channel?', require('./routes/voa/index')); + +// 留园网 +router.get('/6park/:id?/:type?/:keyword?', require('./routes/6park/index')); + +// 哔嘀影视 +router.get('/bde4/:type?/:caty?/:area?/:year?/:order?', require('./routes/bde4/index')); + +// 上海证券交易所 +router.get('/sse/sserules/:slug?', require('./routes/sse/sserules')); + +// 游戏葡萄 +router.get('/gamegrape/:id?', require('./routes/gamegrape/index')); + +// 阳光高考 +router.get('/chsi/zszcgd/:category?', require('./routes/chsi/zszcgd')); + +// 眾新聞 +router.get('/hkcnews/news/:category?', require('./routes/hkcnews/news')); + +// AnyTXT +router.get('/anytxt/release-notes', require('./routes/anytxt/release-notes')); + +// 鱼塘热榜 +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')); + +// booth.pm +router.get('/booth.pm/shop/:subdomain', require('./routes/booth-pm/shop')); + +// Minecraft feed the beast +router.get('/feed-the-beast/modpack/:modpackEntry', require('./routes/feed-the-beast/modpack')); + +// Gab +router.get('/gab/user/:username', require('./routes/gab/user')); +router.get('/gab/popular/:sort?', require('./routes/gab/explore')); + +// NEW字幕组 +router.get('/newzmz/:category?', require('./routes/newzmz/index')); + +// Phrack Magazine +router.get('/phrack', require('./routes/phrack/index')); + module.exports = router; diff --git a/lib/routes/141jav/141jav.js b/lib/routes/141jav/141jav.js new file mode 100644 index 000000000..440f34f1b --- /dev/null +++ b/lib/routes/141jav/141jav.js @@ -0,0 +1,37 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + const type = ctx.params.type || 'new'; + const key = type === 'day' ? ctx.params.key.slice(0, 4) + '/' + ctx.params.key.slice(4, 6) + '/' + ctx.params.key.slice(6, 8) : ctx.params.key || ''; + const link = 'https://www.141jav.com' + `/${type === 'day' ? '' : type}${type === 'new' ? '' : '/' + key}`.replace('//', '/'); + const response = await got({ + method: 'get', + url: link, + }); + + const $ = cheerio.load(response.data); + const list = $('div.columns'); + + let itemPicUrl; + + ctx.state.data = { + title: `141jav - ${type} ${key}`, + link: link, + item: + list && + list + .map((index, item) => { + item = $(item); + itemPicUrl = item.find('img').attr('src'); + return { + title: '【' + item.find('div.card-content.is-flex > h5 > a').text() + '】' + item.find('div.card-content.is-flex > h5 > span').text(), + description: `
Time: ${item.find('p.subtitle.is-6 > a').text()}
Desc: ${item.find('p.level.has-text-grey-dark').text()}`, + link: item.find('div.card-content.is-flex > h5 > a').attr('href'), + enclosure_url: item.find('div.card-content.is-flex > a').attr('href'), + enclosure_type: 'application/x-bittorrent', + }; + }) + .get(), + }; +}; diff --git a/lib/routes/141ppv/141ppv.js b/lib/routes/141ppv/141ppv.js new file mode 100644 index 000000000..ec3d8e63d --- /dev/null +++ b/lib/routes/141ppv/141ppv.js @@ -0,0 +1,37 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + const type = ctx.params.type || 'new'; + const key = type === 'day' ? ctx.params.key.slice(0, 4) + '/' + ctx.params.key.slice(4, 6) + '/' + ctx.params.key.slice(6, 8) : ctx.params.key || ''; + const link = 'https://www.141ppv.com' + `/${type === 'day' ? '' : type}${type === 'new' ? '' : '/' + key}`.replace('//', '/'); + const response = await got({ + method: 'get', + url: link, + }); + + const $ = cheerio.load(response.data); + const list = $('div.columns'); + + let itemPicUrl; + + ctx.state.data = { + title: `141ppv - ${type} ${key}`, + link: link, + item: + list && + list + .map((index, item) => { + item = $(item); + itemPicUrl = item.find('img').attr('src'); + return { + title: '【' + item.find('div.card-content.is-flex > h5 > a').text() + '】' + item.find('div.card-content.is-flex > h5 > span').text(), + description: `
Time: ${item.find('p.subtitle.is-6 > a').text()}
Desc: ${item.find('p.level.has-text-grey-dark').text()}`, + link: item.find('div.card-content.is-flex > h5 > a').attr('href'), + enclosure_url: item.find('div.card-content.is-flex > a').attr('href'), + enclosure_type: 'application/x-bittorrent', + }; + }) + .get(), + }; +}; diff --git a/lib/routes/6park/index.js b/lib/routes/6park/index.js new file mode 100644 index 000000000..433464641 --- /dev/null +++ b/lib/routes/6park/index.js @@ -0,0 +1,58 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + const id = ctx.params.id || 'chan1'; + const type = ctx.params.type || ''; + const keyword = ctx.params.keyword || ''; + + const rootUrl = 'https://club.6parkbbs.com'; + const indexUrl = `${rootUrl}/${id}/index.php`; + const currentUrl = `${indexUrl}${type === '' || keyword === '' ? '' : type === 'gold' ? '?app=forum&act=gold' : `?action=search&act=threadsearch&app=forum&${type}=${keyword}&submit=${type === 'type' ? '查询' : '栏目搜索'}`}`; + + const response = await got({ + method: 'get', + url: currentUrl, + }); + + const $ = cheerio.load(response.data); + + const list = $('#d_list ul li, #thread_list li, .t_l .t_subject') + .slice(0, 10) + .map((_, item) => { + item = $(item); + const a = item.find('a').eq(0); + return { + link: `${rootUrl}/${id}/${a.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); + + item.title = content('title').text().replace(' -6park.com', ''); + item.author = detailResponse.data.match(/送交者: .*>(.*)<.*\[/)[1]; + item.pubDate = new Date(detailResponse.data.match(/于 (.*) 已读/)[1]).toUTCString(); + item.description = content('pre') + .html() + .replace(/6park.com<\/font>/g, ''); + + 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 index 88d5a2c0b..c03a0c9f3 100644 --- a/lib/routes/allnow/column.js +++ b/lib/routes/allnow/column.js @@ -2,7 +2,7 @@ const got = require('@/utils/got'); const cheerio = require('cheerio'); module.exports = async (ctx) => { - const rootUrl = 'https://m.allnow.com'; + const rootUrl = 'https://www.allnow.com'; const currentUrl = `${rootUrl}/column/${ctx.params.id}`; const response = await got({ method: 'get', @@ -10,7 +10,7 @@ module.exports = async (ctx) => { }); const $ = cheerio.load(response.data); - const list = $('a.normal') + const list = $('.post-list .post') .slice(0, 10) .map((_, item) => { item = $(item); @@ -33,7 +33,7 @@ module.exports = async (ctx) => { item.title = content('p.title').text(); item.author = content('a.single-name').eq(0).text(); item.description = content('#article-content').html(); - item.pubDate = new Date(detailResponse.data.match(/time:"(.*)",abstract:"/)[1] + ' GMT+8').toUTCString(); + item.pubDate = new Date(detailResponse.data.match(/time:"(.*?)"\}/)[1] + ' GMT+8').toUTCString(); return item; }) diff --git a/lib/routes/anytxt/release-notes.js b/lib/routes/anytxt/release-notes.js new file mode 100644 index 000000000..da2ea9dcb --- /dev/null +++ b/lib/routes/anytxt/release-notes.js @@ -0,0 +1,33 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + const rootUrl = 'https://anytxt.net'; + const currentUrl = `${rootUrl}/download`; + const response = await got({ + method: 'get', + url: currentUrl, + }); + + const $ = cheerio.load(response.data); + + const items = $('.has-medium-font-size') + .map((_, item) => { + item = $(item); + const date = item.text().replace(':', ''); + + return { + title: date, + link: currentUrl, + pubDate: new Date(date).toUTCString(), + description: `
    ${item.next().html()}
`, + }; + }) + .get(); + + ctx.state.data = { + title: 'Release Notes - AnyTXT', + link: currentUrl, + item: items, + }; +}; diff --git a/lib/routes/apnews/index.js b/lib/routes/apnews/index.js new file mode 100644 index 000000000..a59c24f1d --- /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/bde4/index.js b/lib/routes/bde4/index.js new file mode 100644 index 000000000..f7533d3cb --- /dev/null +++ b/lib/routes/bde4/index.js @@ -0,0 +1,77 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + const type = ctx.params.type || 'all'; + const caty = ctx.params.caty || 'all'; + const area = ctx.params.area || 'all'; + const year = ctx.params.year || 'all'; + const order = ctx.params.order || '0'; + + const rootUrl = 'https://bde4.cc'; + const currentUrl = `${rootUrl}/s/${caty}?${type === 'all' ? '' : '&type=' + type}${area === 'all' ? '' : '&area=' + area}${year === 'all' ? '' : '&year=' + year}&order=${order}`; + const response = await got({ + method: 'get', + url: currentUrl, + }); + + const $ = cheerio.load(response.data); + + let jsessionid = ''; + + const list = $('.card a') + .slice(0, 15) + .map((_, item) => { + item = $(item); + const link = item.attr('href').split(';jsessionid='); + jsessionid = link[1]; + return { + title: item.attr('title'), + link: `${rootUrl}${link[0]}`, + pubDate: new Date(item.parent().find('.meta span').text()).toUTCString(), + }; + }) + .get(); + + const headers = { + cookie: `JSESSIONID=${jsessionid}`, + }; + + 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, + headers, + }); + const downloadResponse = await got({ + method: 'get', + url: `${rootUrl}/downloadInfo/list?mid=${item.link.split('/')[4].split('.')[0]}`, + headers, + }); + const content = cheerio.load(detailResponse.data); + + let downloadLinks = ''; + for (const downloadLink of downloadResponse.data) { + downloadLinks += `
${downloadLink.downloadCategory.name}: ${downloadLink.url}
`; + } + + const torrents = content('#download-wrapper').nextAll('.list').eq(0); + + item.description = content('.info0').html() + `
下载地址:${downloadLinks}
` + `${torrents.html() ? `
种子列表:${torrents.html()}
` : ''}`; + item.enclosure_url = torrents.html() ? torrents.find('a.header').eq(0).attr('href') : downloadResponse.data.pop().url; + item.enclosure_type = 'application/x-bittorrent'; + + return item; + }) + ) + ); + + ctx.state.data = { + title: '哔嘀影视', + link: currentUrl, + item: items, + }; +}; diff --git a/lib/routes/booth-pm/shop.js b/lib/routes/booth-pm/shop.js new file mode 100644 index 000000000..45bc0ad00 --- /dev/null +++ b/lib/routes/booth-pm/shop.js @@ -0,0 +1,57 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); + +const maxPages = 5; + +module.exports = async (ctx) => { + const { subdomain } = ctx.params; + const shopUrl = `https://${subdomain}.booth.pm`; + + let shopName; + const items = []; + for (let page = 1; page <= maxPages; page++) { + const pageUrl = `${shopUrl}/items?page=${page}`; + // eslint-disable-next-line no-await-in-loop + const response = await got({ + method: 'get', + url: pageUrl, + }); + + const data = response.data; + + const $ = cheerio.load(data); + shopName = $('div.shop-name > span').text(); + const pageItems = $('li.item'); + + if (pageItems.length === 0) { + break; + } + + for (let i = 0; i < pageItems.length; ++i) { + const pageItem = pageItems[i]; + + // extract item name + const itemName = $('h2.item-name > a', pageItem).text(); + + // extract item url + const itemUrl = shopUrl + $('h2.item-name > a', pageItem).attr('href'); + + // extract item preview url + const itemPreviewUrl = $('div.swap-image > img', pageItem).attr('src'); + + items.push({ + title: itemName, + description: ``, + link: itemUrl, + }); + } + } + + ctx.state.data = { + title: shopName, + link: shopUrl, + description: shopName, + allowEmpty: true, + item: items, + }; +}; diff --git a/lib/routes/cgtn/opinions.js b/lib/routes/cgtn/opinions.js new file mode 100644 index 000000000..c10c3216c --- /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/cgtn/pick.js b/lib/routes/cgtn/pick.js new file mode 100644 index 000000000..ea4dce237 --- /dev/null +++ b/lib/routes/cgtn/pick.js @@ -0,0 +1,46 @@ +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( + 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('#cmsMainContent').html(); + + return item; + }) + ) + ); + + ctx.state.data = { + title: "CGTN - Editors' Pick", + link: rootUrl, + item: items, + }; +}; diff --git a/lib/routes/chsi/zszcgd.js b/lib/routes/chsi/zszcgd.js new file mode 100644 index 000000000..911a5f6f3 --- /dev/null +++ b/lib/routes/chsi/zszcgd.js @@ -0,0 +1,52 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + const category = ctx.params.category || 'dnzszc'; + + const rootUrl = 'https://gaokao.chsi.com.cn'; + const currentUrl = `${rootUrl}/gkxx/zszcgd/${category}`; + const response = await got({ + method: 'get', + url: currentUrl, + }); + + const $ = cheerio.load(response.data); + + const list = $('.list ul li a') + .slice(0, 15) + .map((_, item) => { + item = $(item); + const link = item.attr('href'); + + return { + title: item.text(), + pubDate: new Date(item.prev().text()).toUTCString(), + link: link.indexOf('http') < 0 ? `${rootUrl}${link}` : link, + }; + }) + .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('.list').html(); + + return item; + }) + ) + ); + + ctx.state.data = { + title: `${$('.backb').text()} - 教育部阳光高考信息公开平台`, + link: currentUrl, + item: items, + }; +}; diff --git a/lib/routes/comicskingdom/index.js b/lib/routes/comicskingdom/index.js new file mode 100644 index 000000000..3a81c7b47 --- /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 bf6a69ee0..8d9b784dd 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/feed-the-beast/modpack.js b/lib/routes/feed-the-beast/modpack.js new file mode 100644 index 000000000..f1e7102d1 --- /dev/null +++ b/lib/routes/feed-the-beast/modpack.js @@ -0,0 +1,31 @@ +const got = require('got'); + +module.exports = async (ctx) => { + const modpackEntry = ctx.params.modpackEntry; + const ftbLink = `https://www.feed-the-beast.com/modpack/${modpackEntry}/`; + const { id } = await got({ + url: `https://api.sunekaer.com/modpack/${modpackEntry}`, + headers: { + Referer: ftbLink, + }, + }).json(); + const data = await got({ + url: `https://api.modpacks.ch/public/modpack/${id}`, + headers: { + Referer: ftbLink, + }, + }).json(); + + ctx.state.data = { + title: `${data.name} 模组包更新`, + link: ftbLink, + description: data.description, + item: data.versions.map((item) => ({ + title: item.name, + description: item.name, + pubDate: new Date(item.updated * 1000).toUTCString(), + link: ftbLink, + guid: `${id}-${item.id}`, + })), + }; +}; diff --git a/lib/routes/fzdm/manhua.js b/lib/routes/fzdm/manhua.js index 8d47d5fe8..b28fa5ad5 100644 --- a/lib/routes/fzdm/manhua.js +++ b/lib/routes/fzdm/manhua.js @@ -2,8 +2,43 @@ const got = require('@/utils/got'); const host = 'https://manhua.fzdm.com'; const cheerio = require('cheerio'); +const get_pic = (id, chapert, caches) => { + const picUrlPattern = RegExp(/var (mhurl1|mhurl)="(.*?)";/); + return caches.tryGet(`${host}/${id}/${chapert}/`, async () => { + let is_last_page = false; + let index = 0; + let pic_content = ''; + while (!is_last_page) { + // eslint-disable-next-line no-await-in-loop + const response = await got.get(`${host}/${id}/${chapert}/index_${index}.html`, { + headers: { + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36', + Host: 'manhua.fzdm.com', + 'Accept-Encoding': 'gzip, deflate, br', + Connection: 'keep-alive', + }, + }); + const data = response.data; + if (response.data !== undefined) { + const picurl = data.match(picUrlPattern); + pic_content += `
`; + if (data.match('最后一页了') !== null) { + is_last_page = true; + } + } else { + pic_content += ''; + is_last_page = true; + } + + index += 1; + } + return pic_content; + }); +}; + module.exports = async (ctx) => { const id = ctx.params.id; + const nums = ctx.params.nums || 1; const comicPage = host + `/${id}/`; const response = await got({ method: 'get', @@ -13,16 +48,24 @@ module.exports = async (ctx) => { const $ = cheerio.load(data); const list = $('div#content > li > a'); const comicTitle = $('div#content > img').attr('alt').replace(/漫画/, ''); + const chapter_detail = await Promise.all( + list.splice(0, nums).map(async (item) => { + const pic_content = await get_pic(id, $(item).attr('href').replace('/', ''), ctx.cache); + return { + title: $(item).text().trim(), + description: pic_content, + link: item.link, + }; + }) + ); ctx.state.data = { title: '风之动漫 - ' + comicTitle, link: comicPage, description: '风之动漫', - item: list - .map((i, item) => ({ - title: $(item).text().trim(), - description: $(item).text().trim(), - link: comicPage + $(item).attr('href'), - })) - .get(), + item: chapter_detail.map((item) => ({ + title: item.title, + description: item.description, + link: item.link, + })), }; }; diff --git a/lib/routes/gab/explore.js b/lib/routes/gab/explore.js new file mode 100644 index 000000000..5c9a66454 --- /dev/null +++ b/lib/routes/gab/explore.js @@ -0,0 +1,31 @@ +const cheerio = require('cheerio'); +const got = require('@/utils/got'); + +module.exports = async (ctx) => { + const sort = ctx.params.sort || 'hot'; + + let baseURL = 'https://gab.com/api/v1/timelines/explore?page=1&sort_by='; + baseURL += sort === 'hot' ? 'hot' : 'top_today'; + + const response = await got.get(baseURL); + + const result = await Promise.all( + response.data.map((item) => { + const media = item.media_attachments.map((item) => ``).join('
'); + const $ = cheerio.load(item.content); + + return { + title: $.text() || 'Untitled', + description: item.content + (media && '
' + media), + link: item.url || baseURL, + pubDate: new Date(item.created_at).toISOString(), + }; + }) + ); + + ctx.state.data = { + title: `Gab - Popular posts`, + link: baseURL, + item: result, + }; +}; diff --git a/lib/routes/gab/user.js b/lib/routes/gab/user.js new file mode 100644 index 000000000..8cb350ff7 --- /dev/null +++ b/lib/routes/gab/user.js @@ -0,0 +1,32 @@ +const cheerio = require('cheerio'); +const got = require('@/utils/got'); + +module.exports = async (ctx) => { + const username = ctx.params.username; + + const response = await got.get('https://gab.com/api/v1/account_by_username/' + username); + const id = response.data.id; + const gabs = await got.get(`https://gab.com/api/v1/accounts/${id}/statuses?exclude_replies=true`); + + const result = await Promise.all( + gabs.data + .filter((item) => !item.reblog) + .map((item) => { + const media = item.media_attachments.map((item) => ``).join('
'); + const $ = cheerio.load(item.content); + + return { + title: $.text() || 'Untitled', + description: item.content + (media && '
' + media), + link: item.url || `https://gab.com/${username}`, + pubDate: new Date(item.created_at).toISOString(), + }; + }) + ); + + ctx.state.data = { + title: `Gab - ${username}`, + link: `https://gab.com/${username}`, + item: result, + }; +}; diff --git a/lib/routes/gamegrape/index.js b/lib/routes/gamegrape/index.js new file mode 100644 index 000000000..418540b75 --- /dev/null +++ b/lib/routes/gamegrape/index.js @@ -0,0 +1,49 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const BASE_URL = 'http://youxiputao.com'; +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; + const feed_url = `${BASE_URL}/article/${id ? `index/id/${id}` : ''}`; + const resp = await got({ url: feed_url }); + const { data } = resp; + const $ = cheerio.load(data); + const feed_title = $('title').text(); + const list = $('.news-info-box') + .map((_, item) => { + item = $(item); + const txt_author_pubDate = $(item.find('div > p > span')[1]).text(); + return { + title: item.parent().find('h4').text(), + link: BASE_URL + item.find('a.cover').attr('href'), + author: `${txt_author_pubDate}`.replace(/ · \S*$/, ''), + description: $(item.find('div > p')[0]).text(), + pubDate: Date.now() - resolveRelativeTime(txt_author_pubDate), + }; + }) + .get(); + ctx.state.data = { + title: feed_title, + link: feed_url, + item: list, + }; +}; diff --git a/lib/routes/gocomics/index.js b/lib/routes/gocomics/index.js new file mode 100644 index 000000000..b74341835 --- /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 000000000..e0d71a856 --- /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 000000000..5dfd996fe --- /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/gov/shenzhen/xxgk/zfxxgj.js b/lib/routes/gov/shenzhen/xxgk/zfxxgj.js new file mode 100644 index 000000000..9595bca59 --- /dev/null +++ b/lib/routes/gov/shenzhen/xxgk/zfxxgj.js @@ -0,0 +1,63 @@ +const url = require('url'); +const got = require('@/utils/got'); +const cheerio = require('cheerio'); + +const rootUrl = 'http://www.sz.gov.cn/cn/xxgk/zfxxgj/'; + +const config = { + tzgg: { + link: 'tzgg/', + title: '通知公告', + }, + zjxx: { + link: 'zjxx/szfczyjs/', + title: '资金信息', + }, + zfcg: { + link: 'zfcg/zfcgml', + title: '政府采购', + }, + zdxm: { + link: 'zdxm', + title: '重大项目', + }, +}; + +module.exports = async (ctx) => { + const cfg = config[ctx.params.caty]; + if (!cfg) { + throw Error('Bad category. See docs'); + } + + const currentUrl = url.resolve(rootUrl, cfg.link); + const response = await got({ method: 'get', url: currentUrl }); + const $ = cheerio.load(response.data); + const list = $('div.zx_ml_list ul li span.tit') + .map((_, item) => { + item = $(item).find('a'); + return { + title: item.text(), + link: 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); + item.description = content('div.concent_center').html(); + item.pubDate = new Date(content('td[align="right"]').text().replace(/发布日期:/, '') + ' GMT+8').toUTCString(); + return item; + }) + ) + ); + + ctx.state.data = { + title: '广东省深圳市人民政府 - ' + cfg.title, + link: currentUrl, + item: items, + }; +}; diff --git a/lib/routes/hentai-cosplays/porn-images-xxx.js b/lib/routes/hentai-cosplays/porn-images-xxx.js index a2fc3880e..b16829c20 100644 --- a/lib/routes/hentai-cosplays/porn-images-xxx.js +++ b/lib/routes/hentai-cosplays/porn-images-xxx.js @@ -2,7 +2,7 @@ const { processFeed } = require('./utils'); module.exports = async (ctx) => { const url = ctx.params.type ? `https://ja.porn-images-xxx.com/search/${ctx.params.type}/${encodeURIComponent(ctx.params.name)}/` : 'https://ja.porn-images-xxx.com/search/'; - const items = await processFeed(url); + const items = await processFeed(ctx, url); ctx.state.data = { title: `${ctx.params.name || '新着画像一覧'} - エロ画像`, link: url, diff --git a/lib/routes/hentai-cosplays/utils.js b/lib/routes/hentai-cosplays/utils.js index 80770e3bc..85be00b28 100644 --- a/lib/routes/hentai-cosplays/utils.js +++ b/lib/routes/hentai-cosplays/utils.js @@ -1,26 +1,46 @@ const cheerio = require('cheerio'); const got = require('@/utils/got'); -exports.processFeed = async function processFeed(link) { +const host = 'https://ja.porn-images-xxx.com/'; + +exports.processFeed = async function processFeed(ctx, link) { const response = await got.get(link); const $ = cheerio.load(response.body); - const list = $('ul#image-list li'); + const list = $('ul#image-list li') + .map(function (index, item) { + item = $(item); + return { + title: item.find('.image-list-item-title').text(), + link: item.find('.image-list-item-title > a').attr('href'), + date: item.find('.image-list-item-regist-date > span').text(), + }; + }) + .get(); + return await Promise.all( + list.map(async (info) => { + const title = info.title.trim(); + const date = info.date; + const itemUrl = host + info.link; - return ( - list && - list - .map((index, item) => { - item = $(item); - return { - title: item.find('.image-list-item-title').text(), - link: item.find('.image-list-item-title > a').attr('href'), - description: item - .find('.image-list-item-image') - .html() - .replace(/\/p=\d+x\d+/, ''), - pubDate: new Date(item.find('.image-list-item-regist-date').text()), - }; - }) - .get() + const cache = await ctx.cache.get(itemUrl); + if (cache) { + return Promise.resolve(JSON.parse(cache)); + } + + const response = await got.get(itemUrl); + const $ = cheerio.load(response.data); + const images = $('.icon-overlay > a > img'); + const desc = cheerio.html(images); + const item = { + title: title, + link: itemUrl, + description: desc, + pubDate: new Date(date).toUTCString(), + }; + if (desc) { + ctx.cache.set(itemUrl, JSON.stringify(item)); + } + return Promise.resolve(item); + }) ); }; diff --git a/lib/routes/hkcnews/news.js b/lib/routes/hkcnews/news.js new file mode 100644 index 000000000..1c040d854 --- /dev/null +++ b/lib/routes/hkcnews/news.js @@ -0,0 +1,60 @@ +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( + 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('.article-content').html(); + + return item; + }) + ) + ); + + ctx.state.data = { + title: `眾新聞 - ${titles[category]}`, + link: `${rootUrl}/news${category === '' ? '' : `/${category}/${titles[category]}`}`, + item: items, + }; +}; diff --git a/lib/routes/icity/index.js b/lib/routes/icity/index.js index db87c45fa..c6ec0f34d 100644 --- a/lib/routes/icity/index.js +++ b/lib/routes/icity/index.js @@ -13,7 +13,7 @@ module.exports = async (ctx) => { .map((_, item) => { item = $(item); return { - link: rootUrl, + link: `https://icity.ly${item.find('a.timeago').attr('href')}`, title: item.prev('li.day-cut').text(), description: item.find('div.line').html(), pubDate: new Date(item.find('time.hours').attr('datetime')).toUTCString(), diff --git a/lib/routes/idaily/index.js b/lib/routes/idaily/index.js index 3205f932a..9c3567c3b 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/instagram/index.js b/lib/routes/instagram/index.js index 4aafe4a71..497e51596 100644 --- a/lib/routes/instagram/index.js +++ b/lib/routes/instagram/index.js @@ -1,5 +1,4 @@ const cheerio = require('cheerio'); -const path = require('path'); const { IgLoginRequiredError } = require('instagram-private-api'); const { ig, login } = require('./utils'); @@ -15,13 +14,17 @@ module.exports = async (ctx) => { throw Error('Such feed is not supported.'); } + if (process.env.IG_PROXY) { + ig.state.proxyUrl = process.env.IG_PROXY; + } + try { await ig.account.currentUser(); } catch (e) { if (e instanceof IgLoginRequiredError) { await login(ig); } else { - throw Error('Unknown error'); + throw e; } } @@ -51,7 +54,7 @@ module.exports = async (ctx) => { logo = userInfo.hd_profile_pic_url_info.url; const fullName = userInfo.full_name; title = `${fullName} (@${username}) - Instagram`; - link = path.join('https://www.instagram.com', username); + link = `https://www.instagram.com/${username}`; itemsRaw = await ig.feed.user(id).items(); break; @@ -60,7 +63,7 @@ module.exports = async (ctx) => { const tag = nameOrId; title = `#${tag}) - Instagram`; - link = path.join('https://www.instagram.com', 'explore', 'tags', tag); + link = `https://www.instagram.com/explore/tags/${tag}`; itemsRaw = await (await ig.feed.tags(tag).items()).slice(1); // the 0 item is undefined for unknown reason break; @@ -85,7 +88,7 @@ module.exports = async (ctx) => { } // Metadata - const url = path.join('https://www.instagram.com', 'p', item.code); + const url = `https://www.instagram.com/p/${item.code}`; const pubDate = new Date(item.taken_at * 1000).toUTCString(); const title = summary.split('\n')[0]; diff --git a/lib/routes/manhuagui/comic.js b/lib/routes/manhuagui/comic.js index 2ccefe675..5fef23310 100644 --- a/lib/routes/manhuagui/comic.js +++ b/lib/routes/manhuagui/comic.js @@ -1,6 +1,7 @@ const { resolve } = require('url'); const cheerio = require('cheerio'); const got = require('@/utils/got'); +const LZString = require('lz-string'); const getChapters = ($) => $('.chapter-list > ul') @@ -22,6 +23,14 @@ module.exports = async (ctx) => { const { data } = await got.get(`https://www.manhuagui.com/comic/${id}/`); const $ = cheerio.load(data); + if ($('#__VIEWSTATE').length > 0) { + const n = LZString.decompressFromBase64($('#__VIEWSTATE').val()); + if (n) { + $('#erroraudit_show').replaceWith(n); + $('#__VIEWSTATE').remove(); + } + } + const bookTitle = $('.book-title > h1').text(); const bookIntro = $('#intro-all').text(); const coverImgSrc = $('.book-cover img').attr('src'); diff --git a/lib/routes/mcdonalds/news.js b/lib/routes/mcdonalds/news.js new file mode 100644 index 000000000..f8fc8e371 --- /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 000000000..9c41c61b7 --- /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 000000000..4c5f63f62 --- /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 000000000..e8890bf1c --- /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/netease/open/vip.js b/lib/routes/netease/open/vip.js index 1d6c1e84a..7f6122d66 100644 --- a/lib/routes/netease/open/vip.js +++ b/lib/routes/netease/open/vip.js @@ -2,60 +2,38 @@ const got = require('@/utils/got'); const cheerio = require('cheerio'); module.exports = async (ctx) => { - const url = 'https://open.163.com/'; + const url = 'https://vip.open.163.com'; const list_response = await got.get(url); const $ = cheerio.load(list_response.data); - const list = $('.tabcon > div:nth-child(1) ul.list li').toArray(); - - const parseContent = (htmlString) => { - const $ = cheerio.load(htmlString); - - const author = $('.CourseCommonDetail_info > div:nth-child(4)'); - const content = $('.CourseCommonDetail_contentDesc'); - - return { - author: author.text().trim(), - description: content.html(), - pubDate: new Date(), - }; - }; - - const out = await Promise.all( - list.map(async (item) => { - const $ = cheerio.load(item); - const title = $('.ltxt').text().trim(); - const link = $('a.item').attr('href').split('?')[0]; - - const cache = await ctx.cache.get(link); - if (cache) { - return Promise.resolve(JSON.parse(cache)); - } - - const rssitem = { - title: title, - link: link, + const list = $('.CourseListItem_ListItem') + .map((index, ele) => { + $('.CourseListItem_oriPrice', ele).remove(); + const price = $('.CourseListItem_price', ele).text().trim(); + return { + title: price + ' - ' + $('.CourseListItem_title', ele).text(), + link: url + $(ele).attr('href'), }; - - try { - const response = await got.get(link); - const result = parseContent(response.data); - - rssitem.author = result.author; - rssitem.description = result.description; - rssitem.pubDate = result.pubDate; - } catch (err) { - return Promise.resolve(''); - } - ctx.cache.set(link, JSON.stringify(rssitem)); - return Promise.resolve(rssitem); }) + .get(); + + const item = await Promise.all( + list.slice(0, 10).map((item) => + ctx.cache.tryGet(item.link, async () => { + const res = await got.get(item.link); + const s = cheerio.load(res.data); + s('img').css('max-width', '100%'); + const toc = s('.CourseCommonDetail_contentItem').eq(1).html(); + item.description = `
${toc}` + s('.CourseCommonDetail_contentItem').first().html() + `
`; + return item; + }) + ) ); ctx.state.data = { title: '网易公开课 - 精品课程', link: url, - item: out.filter((item) => item !== ''), + item, }; }; diff --git a/lib/routes/newzmz/index.js b/lib/routes/newzmz/index.js new file mode 100644 index 000000000..e3cc8b720 --- /dev/null +++ b/lib/routes/newzmz/index.js @@ -0,0 +1,76 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + const category = parseInt(ctx.params.category || '1'); + + const rootUrl = 'https://newzmz.com'; + const response = await got({ + method: 'get', + url: rootUrl, + }); + + const $ = cheerio.load(response.data); + const target = $('.rowMod').eq(category); + + const links = await Promise.all( + target + .find('.slides li a') + .slice(0, 15) + .map((_, item) => { + item = $(item); + + return { + title: item.text(), + link: `${rootUrl}${item.attr('href')}`, + }; + }) + .get() + .map( + async (item) => + await ctx.cache.tryGet(item.link, async () => { + const resourceResponse = await got({ + method: 'get', + url: item.link, + }); + const $ = cheerio.load(resourceResponse.data); + + item.link = $('.addgz').attr('href'); + item.pubDate = new Date($('.duration').text().replace(/更新时间:/, '')).toUTCString(); + + return item; + }) + ) + ); + + const items = await Promise.all( + links.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); + + content('img, .link-name').remove(); + + content('a[title]').each(function () { + content(this).text(content(this).attr('title')); + }); + + item.description = content('.faq--area').html(); + item.enclosure_type = 'application/x-bittorrent'; + item.enclosure_url = content('a[title="磁力链下载"]').attr('href'); + + return item; + }) + ) + ); + + ctx.state.data = { + title: `${target.find('.row-header-title').text()} - NEW字幕组`, + link: rootUrl, + item: items, + }; +}; diff --git a/lib/routes/pediy/topic.js b/lib/routes/pediy/topic.js index db915d26c..6f741ea65 100644 --- a/lib/routes/pediy/topic.js +++ b/lib/routes/pediy/topic.js @@ -16,6 +16,7 @@ const categoryId = { crackme: [37, 'CrackMe'], pwn: [171, 'Pwn'], web: [151, 'WEB安全'], + translate: [32, '外文翻译'], }; module.exports = async (ctx) => { @@ -23,7 +24,6 @@ module.exports = async (ctx) => { const type = ctx.params.type || 'latest'; let path; let title; - if (categoryId.hasOwnProperty(category)) { if (type === 'digest') { // type为digest时只获取精华帖 diff --git a/lib/routes/phrack/index.js b/lib/routes/phrack/index.js new file mode 100644 index 000000000..2310a3050 --- /dev/null +++ b/lib/routes/phrack/index.js @@ -0,0 +1,39 @@ +const cheerio = require('cheerio'); +const got = require('@/utils/got'); +module.exports = async (ctx) => { + const response = await got({ + method: 'get', + url: 'http://www.phrack.org/', + }); + + const data = response.data; + let $ = cheerio.load(data); + const a = $('a[title="Paper Feed"]'); + const url = 'http://www.phrack.org/' + a.attr('href'); + const feed_data = await ctx.cache.tryGet(url, async () => { + const result = await got.get(url); + + return result.data; + }); + + $ = cheerio.load(feed_data); // 使用 cheerio 加载返回的 HTML + + ctx.state.data = { + title: 'phrack', // 项目的标题 + link: 'http://www.phrack.org/', // 指向项目的链接 + description: 'phrack magazine', // 描述项目 + allowEmpty: false, // 默认 false,设为 true 可以允许 item 为空 + item: [ + // 其中一篇文章或一项内容 + { + title: $('div[id="article"]').text(), // 文章标题 + author: '', // 文章作者 + category: '', // 文章分类 + // category: [''], // 多个分类 + description: $('div[class="around"]').children().first().next().children('pre').text(), // 文章摘要或全文 + pubDate: '', // 文章发布时间 + link: url, // 指向文章的链接 + }, + ], + }; +}; diff --git a/lib/routes/pincong/hot.js b/lib/routes/pincong/hot.js new file mode 100644 index 000000000..0f65af2ab --- /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 000000000..f1553de5f --- /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 000000000..2659515f8 --- /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 000000000..90791eb2f --- /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/scboy/thread.js b/lib/routes/scboy/thread.js new file mode 100644 index 000000000..acf87b25f --- /dev/null +++ b/lib/routes/scboy/thread.js @@ -0,0 +1,53 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const date = require('@/utils/date'); +const config = require('@/config').value; + +module.exports = async (ctx) => { + const tid = ctx.params.tid; + const link = `https://www.scboy.com/?thread-${tid}.htm`; + let cookieString = 'postlist_orderby=desc'; + if (config.scboy.token) { + cookieString = `postlist_orderby=desc; bbs_token=${config.scboy.token}`; + } + + const res = await got.get({ + method: 'get', + url: link, + responseType: 'buffer', + headers: { + Cookie: cookieString, + }, + }); + + const $ = cheerio.load(res.data); + const title = $('h4 > span:nth-of-type(1)').text(); + + const list = $('li.media.post'); + const count = []; + + for (let i = 0; i < Math.min(list.length, 30); i++) { + count.push(i); + } + + const resultItems = await Promise.all( + count.map(async (i) => { + const each = $(list[i]); + const floor = each.find('span.floor-parent').text(); + const item = { + title: `${title} #${floor ? floor : ' 热门回复'}`, + link: `https://www.scboy.com/?thread-${tid}`, + description: each.find('div.message.mt-1.break-all > div:nth-of-type(1)').html(), + author: each.find('username').text(), + pubDate: date(each.find('.date').text()), + }; + return Promise.resolve(item); + }) + ); + + ctx.state.data = { + title: title, + link: `https://www.scboy.com/?thread-${tid}.htm`, + item: resultItems, + }; +}; diff --git a/lib/routes/semiconductors/latest-news.js b/lib/routes/semiconductors/latest-news.js new file mode 100644 index 000000000..cd1787121 --- /dev/null +++ b/lib/routes/semiconductors/latest-news.js @@ -0,0 +1,48 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + const rootUrl = 'https://www.semiconductors.org'; + const currentUrl = `${rootUrl}/news-events/latest-news`; + const response = await got({ + method: 'get', + url: currentUrl, + }); + + const $ = cheerio.load(response.data); + + const list = $('h3') + .slice(0, 15) + .map((_, item) => { + item = $(item).parent(); + return { + title: item.text(), + link: 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); + + item.description = content('#main').html(); + item.pubDate = new Date(content('meta[property="article:published_time"]').attr('content')).toUTCString(); + + return item; + }) + ) + ); + + ctx.state.data = { + title: $('title').text(), + link: currentUrl, + item: items, + }; +}; diff --git a/lib/routes/simpread/changelog.js b/lib/routes/simpread/changelog.js new file mode 100644 index 000000000..59ecaea8f --- /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 000000000..79dd7950e --- /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/sse/sserules.js b/lib/routes/sse/sserules.js new file mode 100644 index 000000000..db0a1a3d9 --- /dev/null +++ b/lib/routes/sse/sserules.js @@ -0,0 +1,50 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + const slug = ctx.params.slug || 'latest'; + + const rootUrl = 'http://www.sse.com.cn'; + const currentUrl = `${rootUrl}/lawandrules/sserules/${slug.replace(/-/g, '/')}`; + const response = await got({ + method: 'get', + url: currentUrl, + }); + + const $ = cheerio.load(response.data); + + const list = $('.sse_list_1 dl dd a') + .slice(0, 15) + .map((_, item) => { + item = $(item); + return { + title: item.text(), + link: `${rootUrl}${item.attr('href')}`, + pubDate: new Date(item.prev().text()).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('.allZoom').html(); + + return item; + }) + ) + ); + + ctx.state.data = { + title: $('title').text(), + link: currentUrl, + item: items, + }; +}; diff --git a/lib/routes/technologyreview/index.js b/lib/routes/technologyreview/index.js new file mode 100644 index 000000000..a44bdd11e --- /dev/null +++ b/lib/routes/technologyreview/index.js @@ -0,0 +1,43 @@ +const cheerio = require('cheerio'); +const got = require('@/utils/got'); + +module.exports = async (ctx) => { + const response = await got.get('https://wp.technologyreview.com/wp-json/irving/v1/data/the_feed?page=1'); + + const result = await Promise.all( + response.data + .filter((item) => item.config.permalink) + .map( + async (item) => + await ctx.cache.tryGet(item.config.permalink, async () => { + const article = await got.get(item.config.permalink); + const $ = cheerio.load(article.data); + + // remove annoyances + $('.sliderAd__wrapper--1vLJw').remove(); + $('.newsletter__wrap').remove(); + $('.related__wrap').remove(); + $('aside').remove(); + $('svg.monogramTLogo').remove(); + $('.image__placeholder--1CF-F').remove(); + + const description = ($('.contentHeader__image--1pFzw').html() || $('.contentHeader--fullBleed__image--2jdH0').html() || '') + ($('.contentHeader__deck--3A9FE').html() || '') + $('#content--body').html(); + const author = $('.byline__name--2MpUW').clone().children().remove().end().text(); + + return { + title: item.config.title || item.config.name || '', + author, + description, + link: item.config.permalink, + pubDate: new Date($('.contentHeader__publishDate--37zcW').text()).toISOString(), + }; + }) + ) + ); + + ctx.state.data = { + title: 'MIT Technology Review', + link: 'https://www.technologyreview.com/', + item: result, + }; +}; diff --git a/lib/routes/tesla/update.js b/lib/routes/tesla/update.js index 979b06d98..9c801ca1b 100644 --- a/lib/routes/tesla/update.js +++ b/lib/routes/tesla/update.js @@ -34,7 +34,7 @@ module.exports = async (ctx) => { title: item.find('.container h1').text(), description: item.find('.notes-container').text() + '', pubDate: targetDate[0], - link: 'https://www.notateslaapp.com' + item.find('.selector-container-notes a').attr('href'), + link: 'https://www.notateslaapp.com' + item.find('.notes-container > .button-container > a').attr('href'), }; }) .get(), diff --git a/lib/routes/tieba/user.js b/lib/routes/tieba/user.js index 452e96aaf..95f7d3229 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 000000000..9cc3161ba --- /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/ahut/cstzgg.js b/lib/routes/universities/ahut/cstzgg.js index 79f1d2dff..c3177bb20 100644 --- a/lib/routes/universities/ahut/cstzgg.js +++ b/lib/routes/universities/ahut/cstzgg.js @@ -1,58 +1,39 @@ const got = require('@/utils/got'); const cheerio = require('cheerio'); +const url = require('url'); module.exports = async (ctx) => { - const url = `http://jsjxy.ahut.edu.cn/list.jsp?urltype=tree.TreeTempUrl&wbtreeid=1887`; - const response = await got({ - method: 'get', - url: url, - }); + const response = await got.get('http://jsjxy.ahut.edu.cn/index/tzgg.htm'); const $ = cheerio.load(response.data); - $('.clickstyle1022').remove(); - $('td[width = "1%"]').remove(); - $('tr[height = "1"]').remove(); - $('td[colspan="3"]').remove(); - $('.leaderfont47822').remove(); - // ## 获取列表 - const list = $('.winstyle47822 > tbody > tr').get(); - // ## 定义输出的item + + // 获取列表 + const list = $('a.c259382') + .map((index, ele) => ({ + title: $(ele).attr('title'), + link: url.resolve('http://jsjxy.ahut.edu.cn/', $(ele).attr('href')), + })) + .get(); + + // 定义输出的item const out = await Promise.all( - // ### 遍历列表,筛选出自己想要的内容 + // 遍历列表,筛选出自己想要的内容 list.map(async (item) => { - const itemSingle = cheerio.load(item); - const title = itemSingle.text().replace(/^[\s]+|[\s]+$/g, ''); - const re = /]*href=['"]([^"]*)['"][^>]*>/g; - let singleUrl = ''; - if (re.exec(itemSingle.html()) !== null) { - singleUrl = RegExp.$1; - } - if (singleUrl.search('http') === -1) { - singleUrl = 'http://jsjxy.ahut.edu.cn' + singleUrl; - } - const cache = await ctx.cache.get(singleUrl); // ### 得到全局中的缓存信息 - // ### 判断缓存是否存在,如果存在即跳过此次获取的信息 + const cache = await ctx.cache.get(item.link); // 得到全局中的缓存信息 + // 判断缓存是否存在,如果存在即跳过此次获取的信息 if (cache) { return Promise.resolve(JSON.parse(cache)); } // 获取详情页面的介绍 - const detail_response = await got({ - method: 'get', - url: singleUrl, - }); + const detail_response = await got.get(item.link); const $ = cheerio.load(detail_response.data); - const detail_content = $('.contentstyle47853 > div').html(); - // ### 设置 RSS feed item - const single = { - title: title.replace(/(^\s*)|(\s*$)/g, ''), - link: singleUrl, - // author: author, - description: detail_content, - // pubDate: updateDate, - }; - // // ### 设置缓存 - ctx.cache.set(singleUrl, JSON.stringify(single)); - return Promise.resolve(single); - // } + + // 设置 RSS feed item + item.description = $('.contentstyle47853 > div').html(); + item.pubDate = new Date($('.timestyle47853').text().trim()); + + // 设置缓存 + ctx.cache.set(item.link, JSON.stringify(item)); + return Promise.resolve(item); }) ); ctx.state.data = { diff --git a/lib/routes/universities/ahut/jwc.js b/lib/routes/universities/ahut/jwc.js index 77e55deb6..957ff3f93 100644 --- a/lib/routes/universities/ahut/jwc.js +++ b/lib/routes/universities/ahut/jwc.js @@ -1,56 +1,37 @@ const got = require('@/utils/got'); const cheerio = require('cheerio'); +const url = require('url'); module.exports = async (ctx) => { - const url = `http://jwc.ahut.edu.cn/list.jsp?urltype=tree.TreeTempUrl&wbtreeid=1082`; - const response = await got({ - method: 'get', - url: url, - }); + const response = await got.get('http://jwc.ahut.edu.cn/list.jsp?urltype=tree.TreeTempUrl&wbtreeid=1082'); const $ = cheerio.load(response.data); - $('tr[height="1"]').remove(); - $('td[width="1%"]').remove(); - $('td[colspan="3"]').remove(); - // ## 获取列表 - const list = $('.winstyle44456 > tbody > tr >td').get(); - // ## 定义输出的item + + // 获取列表 + const list = $('.winstyle44566 tr') + .map((index, ele) => ({ + title: $('a', ele).attr('title'), + link: url.resolve('http://jwc.ahut.edu.cn/', $('a', ele).attr('href')), + })) + .get(); + + // 定义输出的item const out = await Promise.all( - // ### 遍历列表,筛选出自己想要的内容 + // 遍历列表,筛选出自己想要的内容 list.map(async (item) => { - const itemSingle = cheerio.load(item); - const title = itemSingle.text(); - const re = /]*href=['"]([^"]*)['"][^>]*>/g; - let singleUrl = ''; - if (re.exec(itemSingle.html()) !== null) { - singleUrl = RegExp.$1; - } - if (singleUrl.search('http') === -1) { - singleUrl = 'http://jwc.ahut.edu.cn' + singleUrl; - } - const cache = await ctx.cache.get(singleUrl); // ### 得到全局中的缓存信息 - // ### 判断缓存是否存在,如果存在即跳过此次获取的信息 + const cache = await ctx.cache.get(item.link); // 得到全局中的缓存信息 + // 判断缓存是否存在,如果存在即跳过此次获取的信息 if (cache) { return Promise.resolve(JSON.parse(cache)); } // 获取详情页面的介绍 - const detail_response = await got({ - method: 'get', - url: singleUrl, - }); + const detail_response = await got.get(item.link); const $ = cheerio.load(detail_response.data); - const detail_content = $('.winstyle44457 > tbody').html(); - // ### 设置 RSS feed item - const single = { - title: title, - link: singleUrl, - // author: author, - description: detail_content, - // pubDate: updateDate, - }; - // // ### 设置缓存 - ctx.cache.set(singleUrl, JSON.stringify(single)); - return Promise.resolve(single); - // } + // 设置 RSS feed item + item.description = $('.winstyle44457 > tbody').html(); + item.pubDate = new Date($('.timestyle44457').text().trim()); + // 设置缓存 + ctx.cache.set(item.link, JSON.stringify(item)); + return Promise.resolve(item); }) ); ctx.state.data = { diff --git a/lib/routes/universities/ahut/news.js b/lib/routes/universities/ahut/news.js index 83aa8e310..67ae500da 100644 --- a/lib/routes/universities/ahut/news.js +++ b/lib/routes/universities/ahut/news.js @@ -1,58 +1,38 @@ const got = require('@/utils/got'); const cheerio = require('cheerio'); +const url = require('url'); module.exports = async (ctx) => { - const url = `http://news.ahut.edu.cn/list.jsp?urltype=tree.TreeTempUrl&wbtreeid=1002`; - const response = await got({ - method: 'get', - url: url, - }); + const response = await got.get('http://news.ahut.edu.cn/list.jsp?urltype=tree.TreeTempUrl&wbtreeid=1002'); const $ = cheerio.load(response.data); - $('tr[height="26"]').slice(20); - $('td[width="1%"]').remove(); - $('.clickstyle1022').remove(); - $('td[colspan="3"]').remove(); - $('.leaderfont1022').remove(); - // ## 获取列表 - const list = $('.winstyle1022 > tbody > tr > td').get(); - // ## 定义输出的item + + // 获取列表 + const list = $('.winstyle247968 a.c247968') + .map((index, ele) => ({ + title: $(ele).attr('title'), + link: url.resolve('http://news.ahut.edu.cn/', $(ele).attr('href')), + })) + .get(); + // 定义输出的item const out = await Promise.all( - // ### 遍历列表,筛选出自己想要的内容 + // 遍历列表,筛选出自己想要的内容 list.map(async (item) => { - const itemSingle = cheerio.load(item); - const title = itemSingle.text().trim(); - const re = /]*href=['"]([^"]*)['"][^>]*>/g; - let singleUrl = ''; - if (re.exec(itemSingle.html()) !== null) { - singleUrl = RegExp.$1; - } - if (singleUrl.search('http') === -1) { - singleUrl = 'http://news.ahut.edu.cn' + singleUrl; - } - const cache = await ctx.cache.get(singleUrl); // ### 得到全局中的缓存信息 - // ### 判断缓存是否存在,如果存在即跳过此次获取的信息 + const cache = await ctx.cache.get(item.link); // 得到全局中的缓存信息 + // 判断缓存是否存在,如果存在即跳过此次获取的信息 if (cache) { return Promise.resolve(JSON.parse(cache)); } // 获取详情页面的介绍 - const detail_response = await got({ - method: 'get', - url: singleUrl, - }); + const detail_response = await got.get(item.link); const $ = cheerio.load(detail_response.data); - const detail_content = $('.winstyle1023').html(); - // ### 设置 RSS feed item - const single = { - title: title, - link: singleUrl, - // author: author, - description: detail_content, - // pubDate: updateDate, - }; - // // ### 设置缓存 - ctx.cache.set(singleUrl, JSON.stringify(single)); - return Promise.resolve(single); - // } + + // 设置 RSS feed item + item.description = $('.winstyle1023').html(); + item.pubDate = new Date($('.timestyle1023').text().trim()); + + // 设置缓存 + ctx.cache.set(item.link, JSON.stringify(item)); + return Promise.resolve(item); }) ); ctx.state.data = { diff --git a/lib/routes/universities/bit/cs/cs.js b/lib/routes/universities/bit/cs/cs.js index 605491fa6..ab923eb31 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 d3d07dd1b..2efa8cc24 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 175d6cdde..52859cfe6 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 1c32dcfb6..d2891db29 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 e7f1306d8..f87507ffc 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/lntu/jwnews.js b/lib/routes/universities/lntu/jwnews.js index fd7af28b2..79752d211 100644 --- a/lib/routes/universities/lntu/jwnews.js +++ b/lib/routes/universities/lntu/jwnews.js @@ -1,26 +1,46 @@ const got = require('@/utils/got'); const cheerio = require('cheerio'); +const url = require('url'); module.exports = async (ctx) => { const link = 'http://jwzx.lntu.edu.cn/index/jwgg.htm'; const response = await got.get(link); + const $ = cheerio.load(response.data); - const list = $('.tr-ri li').slice(0, 10); + const list = $('.tr-ri ul').find('li').get(); + + const res = await Promise.all( + list.map(async (item) => { + let $ = cheerio.load(item); + // 通过解析后的子项地址 + const item_link = url.resolve(link, $('a').attr('href')); + + const description = await ctx.cache.tryGet(item_link, async () => { + const result = await got.get(item_link); + + $ = cheerio.load(result.data); + // remove style + $('img, div, span, p, table, td, tr').removeAttr('style'); + $('style, script').remove(); + + return $('.v_news_content') + .html() + .replace(/(]*>|<\/span>)/g, ''); + }); + + const rssitem = { + title: $('title').text().split('-')[0], + description: description, + link: item_link, + author: '辽宁工程技术大学教务处', + }; + return Promise.resolve(rssitem); + }) + ); ctx.state.data = { title: '辽宁工程技术大学教务公告', link: link, - description: '辽宁工程技术大学教务公告', - item: - list && - list - .map((index, item) => { - item = $(item); - return { - title: item.find('li a').text(), - link: item.find('li a').attr('href'), - }; - }) - .get(), + item: res, }; }; diff --git a/lib/routes/universities/uestc/sice.js b/lib/routes/universities/uestc/sice.js index acd553a52..18e1e5b45 100644 --- a/lib/routes/universities/uestc/sice.js +++ b/lib/routes/universities/uestc/sice.js @@ -6,28 +6,28 @@ module.exports = async (ctx) => { const page = await browser.newPage(); // 浏览器伪装 - await page.evaluateOnNewDocument(() => { //在每个新页面打开前执行以下脚本 + await page.evaluateOnNewDocument(() => { // 在每个新页面打开前执行以下脚本 const newProto = navigator.__proto__; - delete newProto.webdriver; //删除navigator.webdriver字段 + delete newProto.webdriver; // 删除navigator.webdriver字段 navigator.__proto__ = newProto; - window.chrome = {}; //添加window.chrome字段,为增加真实性还需向内部填充一些值 + window.chrome = {}; // 添加window.chrome字段,为增加真实性还需向内部填充一些值 window.chrome.app = {"InstallState":"hehe", "RunningState":"haha", "getDetails":"xixi", "getIsInstalled":"ohno"}; - window.chrome.csi = function(){}; - window.chrome.loadTimes = function(){}; - window.chrome.runtime = function(){}; - Object.defineProperty(navigator, 'userAgent', { //userAgent在无头模式下有headless字样,所以需覆写 + window.chrome.csi = function() {}; + window.chrome.loadTimes = function() {}; + window.chrome.runtime = function() {}; + Object.defineProperty(navigator, 'userAgent', { // userAgent在无头模式下有headless字样,所以需覆写 get: () => "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.113 Safari/537.36", }); - Object.defineProperty(navigator, 'plugins', { //伪装真实的插件信息 + Object.defineProperty(navigator, 'plugins', { // 伪装真实的插件信息 get: () => [{"description": "Portable Document Format", "filename": "internal-pdf-viewer", "length": 1, "name": "Chrome PDF Plugin"}] }); - Object.defineProperty(navigator, 'languages', { //添加语言 + Object.defineProperty(navigator, 'languages', { // 添加语言 get: () => ["zh-CN", "zh", "en"], }); - const originalQuery = window.navigator.permissions.query; //notification伪装 + const originalQuery = window.navigator.permissions.query; // notification伪装 window.navigator.permissions.query = (parameters) => ( parameters.name === 'notifications' ? Promise.resolve({ state: Notification.permission }) : @@ -58,7 +58,6 @@ module.exports = async (ctx) => { ).get(); - ctx.state.data = { title: '信通通知公告', link: 'https://www.sice.uestc.edu.cn/tzgg/yb.htm', diff --git a/lib/routes/voa/day-photos.js b/lib/routes/voa/day-photos.js new file mode 100644 index 000000000..79a4c7751 --- /dev/null +++ b/lib/routes/voa/day-photos.js @@ -0,0 +1,55 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + const rootUrl = 'https://www.voanews.com'; + const currentUrl = `${rootUrl}/day-photos`; + const response = await got({ + method: 'get', + url: currentUrl, + }); + + const $ = cheerio.load(response.data); + + const list = $('.teaser__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( + async (item) => + await ctx.cache.tryGet(item.link, async () => { + const detailResponse = await got({ + method: 'get', + url: item.link, + }); + const content = cheerio.load(detailResponse.data); + + content('img').each(function () { + content(this).attr('src', content(this).attr('data-src')); + content(this).removeAttr('data-src'); + }); + + content('noscript').remove(); + + item.description = content('.multimedia-gallery__items').html(); + item.pubDate = new Date(content('.page-header__meta-item').text()).toUTCString(); + + return item; + }) + ) + ); + + ctx.state.data = { + title: $('title').text(), + link: currentUrl, + item: items, + }; +}; diff --git a/lib/routes/voa/index.js b/lib/routes/voa/index.js new file mode 100644 index 000000000..fd37079a0 --- /dev/null +++ b/lib/routes/voa/index.js @@ -0,0 +1,55 @@ +const cheerio = require('cheerio'); +const got = require('@/utils/got'); + +module.exports = async (ctx) => { + let baseURL; + switch (ctx.params.language) { + case 'cantonese': + baseURL = 'https://www.voacantonese.com/'; + break; + case 'chinese': + baseURL = 'https://www.voachinese.com/'; + break; + case 'tibetan': + baseURL = 'https://www.voatibetan.com/'; + break; + default: + throw Error('The language specified does not exist'); + } + + const response = await got.get(baseURL + 'api/' + (ctx.params.channel || '')); + const $ = cheerio.load(response.data); + + const list = []; + $('item').each(function (_, e) { + const item = {}; + item.title = $(e).find('title').first().text(); + item.link = $(e).find('guid').first().text(); + item.pubDate = $(e).find('pubDate').first().text(); + item.description = $(e).find('description').first().text(); + list.push(item); + }); + + const result = await Promise.all( + list + .filter((item) => item.link) + .map( + async (item) => + await ctx.cache.tryGet(item.link, async () => { + const content = await got.get(item.link); + const description = cheerio.load(content.data); + description('.wsw__embed').remove(); + + item.description = description('div#article-content div').first().html() ? description('div.cover-media') + description('div#article-content div').first().html() : item.description; + + return item; + }) + ) + ); + + ctx.state.data = { + title: $('channel title').first().text(), + link: baseURL, + item: result, + }; +}; diff --git a/lib/routes/xiaoheihe/news.js b/lib/routes/xiaoheihe/news.js index 1eb2d2f82..a00a6730b 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/youtube/channel.js b/lib/routes/youtube/channel.js index 006940e3c..7f4b18aaa 100644 --- a/lib/routes/youtube/channel.js +++ b/lib/routes/youtube/channel.js @@ -13,9 +13,9 @@ module.exports = async (ctx) => { const data = (await utils.getPlaylistItems(playlistId, 'snippet,contentDetails')).data.items; ctx.state.data = { - title: `${data[0].snippet.channelTitle} 的 YouTube 视频`, + title: `${data[0].snippet.channelTitle} - YouTube`, link: `https://www.youtube.com/channel/${id}`, - description: `${data[0].snippet.channelTitle} 的 YouTube 视频`, + description: `YouTube channel ${data[0].snippet.channelTitle}`, item: data .filter((d) => d.snippet.title !== 'Private video' && d.snippet.title !== 'Deleted video') .map((item) => { @@ -25,8 +25,8 @@ module.exports = async (ctx) => { return { title: snippet.title, description: `${ - embed ? '' : '' - }${utils.formatDescription(snippet.description)}`, + embed ? '' : '' + }${utils.formatDescription(snippet.description)}`, pubDate: new Date(snippet.publishedAt).toUTCString(), link: `https://www.youtube.com/watch?v=${videoId}`, }; diff --git a/lib/routes/youtube/playlist.js b/lib/routes/youtube/playlist.js index bfd420f62..f944ded35 100644 --- a/lib/routes/youtube/playlist.js +++ b/lib/routes/youtube/playlist.js @@ -15,17 +15,17 @@ module.exports = async (ctx) => { const authors = (await utils.getVideoAuthor(ids, 'snippet')).data.items; ctx.state.data = { - title: `Playlist: ${playlistTitle} by ${data[0].snippet.channelTitle}`, + title: `${playlistTitle} by ${data[0].snippet.channelTitle} - YouTube`, link: `https://www.youtube.com/playlist?list=${id}`, - description: `Playlist: ${playlistTitle} by ${data[0].snippet.channelTitle}`, + description: `YouTube playlist ${playlistTitle} by ${data[0].snippet.channelTitle}`, item: data.map((item, index) => { const snippet = item.snippet; const videoId = snippet.resourceId.videoId; const img = utils.getThumbnail(snippet.thumbnails); return { title: snippet.title, - description: `${embed ? '' : ''} - ${utils.formatDescription(snippet.description)}`, + description: `${embed ? '' : ''} + ${utils.formatDescription(snippet.description)}`, pubDate: new Date(snippet.publishedAt).toUTCString(), link: `https://www.youtube.com/watch?v=${videoId}`, author: authors[index].snippet.channelTitle, diff --git a/lib/routes/youtube/user.js b/lib/routes/youtube/user.js index 969466f16..126599b69 100644 --- a/lib/routes/youtube/user.js +++ b/lib/routes/youtube/user.js @@ -13,9 +13,9 @@ module.exports = async (ctx) => { const data = (await utils.getPlaylistItems(playlistId, 'snippet,contentDetails')).data.items; ctx.state.data = { - title: `${username} 的 YouTube 视频`, + title: `${username} - YouTube`, link: `https://www.youtube.com/user/${username}`, - description: `${username} 的 YouTube 视频`, + description: `YouTube user ${username}`, item: data .filter((d) => d.snippet.title !== 'Private video' && d.snippet.title !== 'Deleted video') .map((item) => { @@ -25,8 +25,8 @@ module.exports = async (ctx) => { return { title: snippet.title, description: `${ - embed ? '' : '' - }${utils.formatDescription(snippet.description)}`, + embed ? '' : '' + }${utils.formatDescription(snippet.description)}`, pubDate: new Date(snippet.publishedAt).toUTCString(), link: `https://www.youtube.com/watch?v=${videoId}`, }; diff --git a/lib/routes/yuanliao/index.js b/lib/routes/yuanliao/index.js new file mode 100644 index 000000000..d9333428f --- /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/hot.js b/lib/routes/zhihu/hot.js new file mode 100644 index 000000000..2a35d244a --- /dev/null +++ b/lib/routes/zhihu/hot.js @@ -0,0 +1,37 @@ +const got = require('@/utils/got'); + +const titles = { + total: '全站', + focus: '国际', + science: '科学', + car: '汽车', + zvideo: '视频', + fashion: '时尚', + depth: '时事', + digital: '数码', + sport: '体育', + school: '校园', + film: '影视', +}; + +module.exports = async (ctx) => { + const category = ctx.params.category || 'total'; + + const response = await got({ + method: 'get', + url: `https://www.zhihu.com/api/v3/feed/topstory/hot-lists/${category}?limit=50`, + }); + + const items = response.data.data.map((item) => ({ + link: item.target.url, + title: item.target.title, + pubDate: new Date(item.target.created * 1000).toUTCString(), + description: item.target.excerpt ? `

    ${item.target.excerpt}

    ` : '', + })); + + ctx.state.data = { + title: `知乎热榜 - ${titles[category]}`, + link: `https://www.zhihu.com/hot?list=${category}`, + item: items, + }; +}; diff --git a/lib/routes/zhihu/timeline.js b/lib/routes/zhihu/timeline.js new file mode 100644 index 000000000..568c30a0e --- /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 ff684507d..e762c5ede 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 000000000..6117c5218 --- /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 000000000..50cae9b71 --- /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 000000000..604af7f5a --- /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 000000000..7781eb24f --- /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 000000000..d4a283725 --- /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 000000000..0c8352a44 --- /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 000000000..33671a51c --- /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 000000000..cd8f1df76 --- /dev/null +++ b/scripts/ansible/try.sh @@ -0,0 +1,5 @@ +#!/bin/bash +set -e + +vagrant rsync +vagrant ssh diff --git a/scripts/workflow/test-route/identify.js b/scripts/workflow/test-route/identify.js new file mode 100644 index 000000000..7fcf08fe4 --- /dev/null +++ b/scripts/workflow/test-route/identify.js @@ -0,0 +1,82 @@ +const noFound = 'Auto: Route No Found'; + +module.exports = async ({ github, context, core }, body, number) => { + core.debug(`body: ${body}`); + const m = body.match(/```routes\r\n((.|\r\n)*)```/); + core.debug(`match: ${m}`); + let res = null; + + const removeLabel = async () => + github.issues + .removeLabel({ + issue_number: number, + owner: context.repo.owner, + repo: context.repo.repo, + name: noFound, + }) + .catch((e) => { + core.warning(e); + }); + + if (m && m[1]) { + res = m[1].trim().split('\r\n'); + core.info(`routes detected: ${res}`); + + if (res.length > 0 && res[0] === 'NOROUTE') { + core.info('PR stated no route, passing'); + await removeLabel(); + await github.issues + .addLabels({ + issue_number: number, + owner: context.repo.owner, + repo: context.repo.repo, + labels: ['Auto: No Route Needed'], + }) + .catch((e) => { + core.warning(e); + }); + + return; + } else if (res.length > 0) { + core.exportVariable('TEST_CONTINUE', true); + await removeLabel(); + return res; + } + } + + core.warning('seems no route found, failing'); + + await github.issues + .addLabels({ + issue_number: number, + owner: context.repo.owner, + repo: context.repo.repo, + labels: [noFound], + }) + .catch((e) => { + core.warning(e); + }); + await github.issues + .createComment({ + issue_number: number, + owner: context.repo.owner, + repo: context.repo.repo, + body: `自动检测失败, 请确认PR正文部分符合格式规范并重新开启, 详情请检查日志 +Auto Route test failed, please check your PR body format and reopen pull request. Check logs for more details`, + }) + .catch((e) => { + core.warning(e); + }); + await github.pulls + .update({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_nulber: number, + state: 'closed', + }) + .catch((e) => { + core.warning(e); + }); + + throw 'Please follow the PR rules: failed to detect route'; +}; diff --git a/scripts/workflow/test-route/test.js b/scripts/workflow/test-route/test.js new file mode 100644 index 000000000..45e5067e9 --- /dev/null +++ b/scripts/workflow/test-route/test.js @@ -0,0 +1,65 @@ +/* eslint-disable */ + +module.exports = async ({ github, context, core }, baseUrl, routes, number) => { + if (routes[0] === 'NOROUTE') { + return; + } + + const links = routes.map((e) => { + const l = e.startsWith('/') ? e : `/${e}`; + return `${baseUrl}${l}`; + }); + + let com = 'Successfully generated as following:\n\n'; + + for (const lks of links) { + core.info(`testing route: ${lks}`); + // Intended, one at a time + const res = await github.request(`GET ${lks}`).catch((err) => { + com += ` + +
    + ${lks} - **Failed** + +\`\`\` + ${err} +\`\`\` +
    + +`; + }); + if (res && res.data) { + const { data } = res; + com += ` +
    + ${lks} - Success + +\`\`\` + ${data.split('\n').slice(0, 30).join('\n')} +\`\`\` +
    + +`; + } + } + github.issues + .addLabels({ + issue_number: number, + owner: context.repo.owner, + repo: context.repo.repo, + labels: ['Auto: Route Test Complete'], + }) + .catch((e) => { + core.warning(e); + }); + github.issues + .createComment({ + issue_number: number, + owner: context.repo.owner, + repo: context.repo.repo, + body: com, + }) + .catch((e) => { + core.warning(e); + }); +}; diff --git a/yarn.lock b/yarn.lock index c2b27d07d..b6ed190df 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"