sync upstream

This commit is contained in:
jinkin
2021-01-12 20:51:22 +08:00
116 changed files with 3976 additions and 459 deletions
+65 -2
View File
@@ -1,3 +1,11 @@
<!--
请不要删除, 自行修改已有结构/注释, 这会导致自动检测失败;不符合要求的部分留空即可
Do not remove existing titles or structures: it breaks CI
-->
## 该 PR 相关 Issue / Involved issue
Close #
@@ -5,9 +13,64 @@ Close #
## 完整路由地址 / Example for the proposed route(s)
<!--
为方便测试,请附上完整路由地址,包括所有必选与可选参数,否则将导致 PR 被关闭。
To simplify the testing workflow, please include the complete route, with all required and optional parameters, otherwise your pull request will be closed.
请按照如下格式填写`routes`区域: 我们将会根据你的参数展开自动测试. 一行一个路由
Please fill the `routes` block follow the format below, as we will perform automatic test based on this information. one route per line.
```
/some/route
/some/other/route
```
如果与路由无关, 请写`NOROUTE`
-->
<!-- 在下方填写, 请不要删除`routes`标识: CI验证需要. FILL BELOW and keep `routes` keyword -->
```routes
```
## 新RSS检查列表 / New RSS Script Checklist
<!--
Please go over the checklist below before PR: this improve your PR pass rate.
Reference: https://docs.rsshub.app/en/joinus/
请在提交PR前检查以下事项: 这可以大大提升通过率
这些就是我们在审核时主要关注的事项, 敬请留意
参考: https://docs.rsshub.app/joinus
-->
- [ ] 这个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
<!--
Please state your reason/note here
请在这里描述你的原因或留下其他相关的说明
-->
@@ -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)
+90
View File
@@ -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}` : '';
},
},
],
},
});
+1 -1
View File
@@ -288,7 +288,7 @@ pageClass: routes
### 风之动漫
<Route author="geeeeoff" path="/fzdm/manhua/:id" example="/fzdm/manhua/39" :paramsDesc="['漫画ID']"/>
<Route author="geeeeoff zytomorrow" path="/fzdm/manhua/:id/:nums?" example="/fzdm/manhua/39/2" :paramsDesc="['漫画ID', '最新的n话, 默认为最新1话']" anticrawler="1"/>
## 海猫吧
+31 -1
View File
@@ -180,6 +180,17 @@ pageClass: routes
</Route>
## SCBOY 论坛
### 帖子
<Route author="totorowechat" example="/scboy/thread/188673" path="/scboy/thread/:tid" :paramsDesc="['帖子 tid']" radar="1">
帖子网址如果为 <https://www.scboy.com/?thread-188673.htm> 那么帖子 tid 就是 `1789863`。
访问水区需要添加环境变量 `SCBOY_BBS_TOKEN`, 详情见部署页面的配置模块。 `SCBOY_BBS_TOKEN`在 cookies 的`bbs_token`中。
</Route>
## V2EX
### 最热 / 最新主题
@@ -326,6 +337,7 @@ pageClass: routes
| CrackMe | crackme |
| Pwn | pwn |
| WEB 安全 | web |
| 外文翻译 | translate |
| 全站 | all |
| 类型 | type |
@@ -395,6 +407,24 @@ pageClass: routes
</Route>
## 品葱
### 发现
<Route author="zphw" example="/pincong/category/1/new" path="/pincong/category/:category?/:sort?" :paramsDesc="['分类,与官网分类 URL `category-` 后的数字对应,默认为全部', '排序方式,参数可见下表,默认为推荐']" anticrawler="1" />
| 最新 | 推荐 | 热门 |
| ---- | --------- | ---- |
| new | recommend | hot |
### 精选
<Route author="zphw" example="/pincong/hot" path="/pincong/hot/:category?" :paramsDesc="['分类,与官网分类 URL `category-` 后的数字对应,默认为全部']" anticrawler="1" />
### 话题
<Route author="zphw" example="/pincong/topic/美国" path="/pincong/topic/:topic?" :paramsDesc="['话题,可在官网获取']" anticrawler="1" />
## 三星盖乐世社区
### 最新帖子
@@ -463,7 +493,7 @@ pageClass: routes
### 用户帖子
<Route author="humpylin" example="/tieba/user/斗鱼游戏君" path="/tieba/user/:uid" :paramsDesc="['用户 ID']" />
<Route author="humpylin nczitzk" example="/tieba/user/斗鱼游戏君" path="/tieba/user/:uid" :paramsDesc="['用户 ID']" />
用户 ID 可以通过打开用户的主页后查看地址栏的 `un` 字段来获取。
+6
View File
@@ -80,6 +80,12 @@ pageClass: routes
<Route author="Maecenas" example="/blogs/paulgraham" path="/blogs/paulgraham"/>
## Phrack Magazine
### 文章
<Route author="CitrusIce" example="/phrack" path="/phrack" />
## WordPress
<Route author="Lonor" example="/blogs/wordpress/lawrence.code.blog" path="/blogs/wordpress/:domain/:https?" :paramsDesc="['WordPress 博客域名', '默认 https 协议。填写 `http`或`https`']"/>
+11
View File
@@ -35,3 +35,14 @@ pageClass: routes
### Discussion
<RouteEn author="nczitzk" example="/lowendtalk/discussion/168480" path="/lowendtalk/discussion/:id?" :paramsDesc="['Discussion id']"/>
## SCBOY forum
### Thread
<RouteEn author="totorowechat" example="/scboy/thread/188673" path="/scboy/thread/:tid" :paramsDesc="['thread tid']" radar="1">
If the url of the thread is <https://www.scboy.com/?thread-188673.htm> then tid would be `1789863`.
When accessing Joeyray's Bar, `SCBOY_BBS_TOKEN` needs to be filled in `environment`. See <https://docs.rsshub.app/en/install/#Deployment> for details. `SCBOY_BBS_TOKEN` is included in cookies with `bbs_token`.
</RouteEn>
+6
View File
@@ -31,3 +31,9 @@ pageClass: routes
### Essays
<RouteEn author="Maecenas" example="/blogs/paulgraham" path="/blogs/paulgraham"/>
## Phrack Magazine
### Article
<RouteEn author="CitrusIce" example="/phrack" path="/phrack" />
+8
View File
@@ -104,6 +104,14 @@ Sorting types, default to `date`:
<RouteEn author="Indexyz" example="/curseforge/files/jei" path="/curseforge/files/:project" :paramsDesc="['Progect shortname or `Project ID`. The short name of the project can be found in the address bar, for exmaple `https://minecraft.curseforge.com/projects/non-update` to `non-update`. `Project ID` can be found in `About This Project` in `Overview`']"/>
### Feed The Beast Modpack Updates
<RouteEn author="gucheen" example="/feed-the-beast/modpack/ftb_presents_direwolf20_1_16" path="/feed-the-beast/modpack/:modpackEntry" :paramsDesc="['entry name of modpack.']">
| 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`. |
</RouteEn>
## Nintendo
### eShop New Game Releases
+30
View File
@@ -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.
+4
View File
@@ -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
<RouteEn author="zphw" example="/technologyreview" path="/technologyreview" />
### Topics
<RouteEn author="laampui" example="/technologyreview/humans-and-technology" path="/technologyreview/:category_name" :paramsDesc="['see below']" />
+21
View File
@@ -67,6 +67,10 @@ Compared to the official one, the RSS feed generated by RSSHub not only has more
## CGTN
### Opinions
<RouteEn author="nczitzk" example="/cgtn/opinions" path="/cgtn/opinions"/>
### Most Read & Most Share
<RouteEn author="nczitzk" example="/cgtn/most/read/day" path="/cgtn/most/:type?/:time?" :paramsDesc="['Type, `read` as most read, `share` as most share, `read` by default', 'Time range, `all` as all the time, `day` as today, `week` as this week, `month` as this month, `year` as this year, `all` by default']"/>
@@ -75,6 +79,10 @@ Compared to the official one, the RSS feed generated by RSSHub not only has more
<RouteEn author="nczitzk" example="/cgtn/top" path="/cgtn/top"/>
### Editors' Pick
<RouteEn author="nczitzk" example="/cgtn/pick" path="/cgtn/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
<RouteEn author="nczitzk" example="/polar/blog" path="/polar/blog"/>
## Quanta Magazine
### Archive
@@ -273,6 +282,12 @@ Compared to the official one, this feed:
</RouteEn>
## Semiconductor Industry Association
### Latest News
<RouteEn author="nczitzk" example="/semiconductors/latest-news" path="/semiconductors/latest-news"/>
## Simons Foundation
### Articles
@@ -335,6 +350,12 @@ Provides a better reading experience (full text articles) over the official one.
</RouteEn>
## VOA News
### Day in Photos
<RouteEn author="nczitzk" example="/voa/day-photos" path="/voa/day-photos"/>
## Vulture
<RouteEn author="loganrockmore" example="/vulture/movies" path="/vulture/:tag/:excludetags?" :paramsDesc="['Tag', 'Comma-delimited list of tags. If an article includes one of these tags, it will be excluded from the RSS feed.']" />
+8
View File
@@ -42,6 +42,10 @@ pageClass: routes
<RouteEn author="FHYunCai" example="/bing" path="/bing" radar="1" rssbud="1"/>
## ComicsKingdom Comic Strips
<RouteEn author="stjohnjohnson" example="/comicskingdom/baby-blues" path="/comicskingdom/:strip" :paramsDesc="['URL path of the strip on comicskingdom.com']" />
## DailyArt
<RouteEn author="zphw" example="/dailyart/en" path="/dailyart/:language?" :paramsDesc="['Support en, es, fr, de, it, zh, jp, etc. English by default.']" />
@@ -50,6 +54,10 @@ pageClass: routes
<RouteEn name="Daily Strip" author="Maecenas" example="/dilbert/strip" path="/dilbert/strip"/>
## GoComics Comic Strips
<RouteEn author="stjohnjohnson" example="/gocomics/foxtrot" path="/gocomics/:strip" :paramsDesc="['URL path of the strip on gocomics.com']" />
## Google Doodles
### Update
+12
View File
@@ -10,6 +10,12 @@ pageClass: routes
<Route author="nczitzk" example="/anki/changes" path="/anki/changes"/>
## AnyTXT
### Release Notes
<Route author="nczitzk" example="/anytxt/release-notes" path="/anytxt/release-notes"/>
## Apkpure
### Versions
@@ -164,6 +170,12 @@ The owner of the official image fills in the library, for example: https://rsshu
<RouteEn author="hoilc" example="/edge/addon/gangkeiaobmjcjokiofpkfpcobpbmnln" path="/edge/addon/:crxid" :paramsDesc="['Addon id, can be found in addon url']"/>
## Microsoft Store
### Updates
<Route author="hellodword" example="/microsoft-store/updates/9WZDNCRFHVN5/CN" path="/microsoft-store/updates/:productid/:market?" :paramsDesc="['`Share` - `Copy Link` in the Store', '`CN` as default']" />
## Minecraft
Refer to [#minecraft](/en/game.html#minecraft)
+6
View File
@@ -36,6 +36,12 @@ Parameter `time` only works when `mostwanted` is chosen as the category.
</RouteEn>
## booth.pm
### Shop
<Route author="KTachibanaM" example="/booth.pm/shop/annn-boc0123" path="/booth.pm/shop/:subdomain" :paramsDesc="['Shop subdomain']" />
## Guiltfree.pl
### Onsale
+10
View File
@@ -34,6 +34,16 @@ pageClass: routes
<RouteEn author="maple3142" example="/facebook/page/SonetPCR" path="/facebook/page/:id" :paramsDesc="['page id']" anticrawler="1"/>
## Gab
### User's Posts
<RouteEn author="zphw" example="/gab/user/realdonaldtrump" path="/gab/user/:username" :paramsDesc="['Username']" />
### Popular Posts
<RouteEn author="zphw" example="/gab/popular/hot" path="/gab/popular/:sort?" :paramsDesc="['Sort by, `hot` to be Hot Posts and `top` to be Top Posts. Default: hot']" />
## Instagram
::: warning
+16
View File
@@ -20,6 +20,10 @@ Site
## AP News
### Top Stories
<RouteEn author="zphw" example="/apnews" path="/apnews" />
### Topics
<RouteEn author="zoenglinghou" example="/apnews/topics/apf-topnews" path="/apnews/topics/:topic" :paramsDesc="['Topic name,can be found in URL. For example: the topic name of AP Top News [https://apnews.com/apf-topnews](https://apnews.com/apf-topnews) is `apf-topnews`']" radar="1" rssbud="1"/>
@@ -149,6 +153,18 @@ Generates full-text feeds that the official feed doesn't provide.
<RouteEn author="oppliate" example="/phoronix/news_topic/Intel" path="/phoronix/:page/:queryOrItem?" :paramsDesc="['Page name', 'For `category` it corresponds to `item`, for other pages it\'s `q`. You may find available parameters from their navigator links. E.g. to subscribe to the category page `https://www.phoronix.com/scan.php?page=category&item=Computers`, fill in the path `/phoronix/category/Computers`']" />
## Radio Free Asia (RFA)
<RouteEn author="zphw" example="/rfa/english" path="/rfa/:language?/:channel?/:subChannel?" :paramsDesc="['language, English by default', 'channel', 'subchannel, where applicable']" />
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
+15
View File
@@ -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 | 交通运输与物流 |
</Route>
## 上海证券交易所
### 本所业务规则
<Route author="nczitzk" example="/sse/sserules" path="/sse/sserules/:slug?" :paramsDesc="['见下文,默认为 latest']">
将目标栏目的网址拆解为 `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`
</Route>
## 世界经济论坛
### 报告
+5 -1
View File
@@ -56,9 +56,13 @@ pageClass: routes
## 停电通知
### 95598 停电查询网
<Route author="mjysci" example="/tingdiantz/95598/hb1/wh/wc/" path="/tingdiantz/95598/:province/:city/:district?" :paramsDesc="['省,2~3位拼音缩写,详情见http://www.sttcq.com/td/','市,同上', '区,同上']"/>
### 南京市
<Route author="ocleo1" example="/tingdiantz/nanjing" path="/tingdiantz/nanjing"/>
<Route author="ocleo1" example="/tingdiantz/nanjing" path="/tingdiantz/nanjing"/>
## 停水通知
+8
View File
@@ -211,6 +211,14 @@ pageClass: routes
<Route author="Indexyz" example="/curseforge/files/jei" path="/curseforge/files/:project" :paramsDesc="['项目的短名或者 `Project ID`. 项目的短名可以在地址栏获取到, 例如地址为 `https://minecraft.curseforge.com/projects/non-update`, 短名就为 `non-update`. `Project ID` 可在 `Overview` 中的 `About This Project` 中找到']"/>
### Feed The Beast (FTB) 模组包更新
<Route author="gucheen" example="/feed-the-beast/modpack/ftb_presents_direwolf20_1_16" path="/feed-the-beast/modpack/:modpackEntry" :paramsDesc="['模组包的短名.']">
| 参数 | 说明 |
| ------| ------------ |
| modpackEntry | 模组包的短名从模组包的页面链接中找到,例如 `https://www.feed-the-beast.com/modpack/ftb_presents_direwolf20_1_16`,短名就是 `ftb_presents_direwolf20_1_16`。 |
</Route>
## Nintendo
### eShop 新发售游戏
+48 -14
View File
@@ -28,6 +28,16 @@ pageClass: routes
</Route>
### 广东省深圳市人民政府
<Route author="laoxua" example="/gov/shenzhen/xxgk/zfxxgj/tzgg" path="/gov/shenzhen/xxgk/zfxxgj/:caty" :paramsDesc="['信息类别']">
| 通知公告 | 政府采购 | 资金信息 | 重大项目 |
| :------: | :------: | :------: | :------: |
| tzgg | zfcg | zjxx | zdxm |
</Route>
## 国家税务总局
### 最新文件
@@ -185,6 +195,18 @@ pageClass: routes
<Route author="Yoge-Code" example="/gov/cnca/zxtz" path="/gov/cnca/zxtz"/>
## 中国农工民主党
### 新闻中心
<Route author="nczitzk" example="/ngd" path="/ngd/:slug?" :paramsDesc="['见下文']">
将目标栏目的网址拆解为 `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`
</Route>
## 中国人大网
<Route author="233yeee" example="/npc/c183" path="/npc/:caty" :paramsDesc="['分类名,支持形如`http://www.npc.gov.cn/npc/*/list.shtml`的网站,传入 npc 之后的参数']">
@@ -280,6 +302,32 @@ pageClass: routes
<Route author="EsuRt" example="/gov/statecouncil/briefing" path="/gov/statecouncil/briefing"/>
## 中国证券监督管理委员会
### 发审委公告
<Route author="chinobing" example="/csrc/fashenwei" path="/csrc/fashenwei"/>
### 证监会消息
<Route author="chinobing LogicJake" example="/csrc/news/zjhxwfb-xwfbh" path="/csrc/news/:suffix?" :paramsDesc="['支持形如`http://www.csrc.gov.cn/pub/newsite/*/*`的网站,将 newsite 后面的两段网址后缀以 - 连接']" />
### 申请事项进度
<Route author="hillerliao" example="/csrc/auditstatus/:apply_id" path="/csrc/auditstatus" :paramsDesc="['事项类别id, `https://neris.csrc.gov.cn/alappl/home/xkDetail` 列表中各地址的 appMatrCde 参数']"/>
## 中国政协网
### 栏目
<Route author="nczitzk" example="/cppcc" path="/cppcc/:slug?" :paramsDesc="['见下文']">
将目标栏目的网址拆解为 `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`
</Route>
### 北京市人民政府
#### 北京教育考试院
@@ -359,20 +407,6 @@ pageClass: routes
</Route>
## 中国证券监督管理委员会
### 发审委公告
<Route author="chinobing" example="/csrc/fashenwei" path="/csrc/fashenwei"/>
### 证监会消息
<Route author="chinobing LogicJake" example="/csrc/news/zjhxwfb-xwfbh" path="/csrc/news/:suffix?" :paramsDesc="['支持形如`http://www.csrc.gov.cn/pub/newsite/*/*`的网站,将 newsite 后面的两段网址后缀以 - 连接']" />
### 申请事项进度
<Route author="hillerliao" example="/csrc/auditstatus/:apply_id" path="/csrc/auditstatus" :paramsDesc="['事项类别id, `https://neris.csrc.gov.cn/alappl/home/xkDetail` 列表中各地址的 appMatrCde 参数']"/>
## 中国驻外使领馆
### 大使馆重要通知
+36 -1
View File
@@ -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. 打开 <https://api.vc.bilibili.com/dynamic_svr/v1/dynamic_svr/dynamic_new?uid=0&type=8>
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` 值.
+1 -1
View File
@@ -22,7 +22,7 @@ pageClass: routes
### 直播分区
<Route author="Qixingchen" example="/bilibili/live/area/143/online" path="/bilibili/live/area/:areaID/:order" :paramsDesc="['分区 ID 分区增删较多, 可通过 [分区列表](https://api.live.bilibili.com/room/v1/Area/getList) 查询', '排序方式, live_time 开播时间, online 人气']">
<Route author="Qixingchen" example="/bilibili/live/area/207/online" path="/bilibili/live/area/:areaID/:order" :paramsDesc="['分区 ID 分区增删较多, 可通过 [分区列表](https://api.live.bilibili.com/room/v1/Area/getList) 查询', '排序方式, live_time 开播时间, online 人气']">
::: warning 注意
+176
View File
@@ -4,6 +4,102 @@ pageClass: routes
# 音视频
## 141JAV
::: tip 提示
官方提供的订阅源不支持 BT 下载订阅,地址为 <https://141jav.com/feeds/>
:::
### 141JAV BT
<Route author="cgkings" example="/141jav/popular/30" path="/141jav/:type/:key?" :paramsDesc="['类型', '关键词']" supportBT="1" radar="1">
**类型**
| 最新 | 热门 | 随机 | 指定演员 | 指定标签 | 指定日期 |
| ---- | ------- | ------ | -------- | -------- | -------- |
| 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` 的格式
</Route>
## 141PPV
::: tip 提示
官方提供的订阅源不支持 BT 下载订阅,地址为 <https://141ppv.com/feeds/>
:::
### 141PPV BT
<Route author="cgkings" example="/141ppv/popular/30" path="/141ppv/:type/:key?" :paramsDesc="['类型', '关键词']" supportBT="1" radar="1">
**类型**
| 最新 | 热门 | 随机 | 指定演员 | 指定标签 | 指定日期 |
| ---- | ------- | ------ | -------- | -------- | -------- |
| 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` 的格式
</Route>
## 2048 核基地
### 论坛更新
@@ -344,6 +440,18 @@ pageClass: routes
<Route author="hoilc" example="/mqube/tag/UTAU" path="/mqube/tag/:tag" :paramsDesc="['标签名称, 可参考`https://mqube.net/search/tag`']" radar="1" rssbud="1"/>
## NEW 字幕组
### 分类
<Route author="nczitzk" example="/newzmz" path="/newzmz/:category?" :paramsDesc="['分类,见下表,默认为最近更新']">
| 最近更新 | 剧集推荐 | 电影推荐 | 纪录片推荐 | 动画推荐 | 真人秀推荐 |
| -------- | -------- | -------- | ---------- | -------- | ---------- |
| 1 | 2 | 3 | 4 | 5 | 6 |
</Route>
## Nyaa
### 搜索结果
@@ -495,6 +603,74 @@ pageClass: routes
<Route author="ranpox" example="/iqiyi/dongman/a_19rrh1sifx" path="/iqiyi/dongman/:id" :paramsDesc="['动漫 id, 可在该动漫主页 URL 中找到(不包括`.html`)']"/>
## 哔嘀影视
### 首页
<Route author="nczitzk" example="/bde4" path="/bde4/:type?/:caty?/:area?/:year?/:order?" :paramsDesc="['资源分类,见下表,默认为 `all` 即不限', '影视类型,见下表,默认为 `all` 即不限','制片地区,见下表,默认为 `all` 即不限','上映时间,此处填写年份不小于2000,默认为 `all` 即不限','影视排序,见下表,默认为更新时间']">
#### 资源分类
| 不限 | 电影 | 电视剧 |
| ---- | ---- | ------ |
| 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 |
</Route>
## 播客 IBC 岩手放送| IBC ラジオ イヤーマイッタマイッタ
### IBC 岩手放送| IBC ラジオ イヤーマイッタマイッタ
+115 -13
View File
@@ -122,6 +122,10 @@ pageClass: routes
## CGTN
### Opinions
<Route author="nczitzk" example="/cgtn/opinions" path="/cgtn/opinions"/>
### Most Read & Most Share
<Route author="nczitzk" example="/cgtn/most/read/day" path="/cgtn/most/:type?/:time?" :paramsDesc="['类型,`read` 指最多阅读,`share` 指最多分享,默认为 `read`', '时间,`all` 指所有时间,`day` 指今天,`week` 指本周,`month` 指本月,`year` 指今年,默认为 `all`']"/>
@@ -130,6 +134,10 @@ pageClass: routes
<Route author="nczitzk" example="/cgtn/top" path="/cgtn/top"/>
### Editors' Pick
<Route author="nczitzk" example="/cgtn/pick" path="/cgtn/pick"/>
## cnBeta
### 最新
@@ -569,6 +577,12 @@ IPFS 网关有可能失效,那时候换成其他网关。
<Route author="kt286" example="/topys/7" path="/topys/:category" :paramsDesc="['分类ID,可在对应页面的 URL 中找到']"/>
## VOA News
### Day in Photos
<Route author="nczitzk" example="/voa/day-photos" path="/voa/day-photos"/>
## Vulture
<Route author="loganrockmore" example="/vulture/movies" path="/vulture/:type/:excludetags?" :paramsDesc="['The sub-site name', '逗号分隔的标签列表。 如果文章包含这些标签之一,则该文章将从RSS feed中排除']">
@@ -1339,13 +1353,67 @@ column 为 third 时可选的 category:
### 首页
<Route author="xyqfer" example="/laosiji/feed" path="/laosiji/feed"/>
### 24小时热门
### 24 小时热门
<Route author="xyqfer" example="/laosiji/hot" path="/laosiji/hot"/>
### 节目
<Route author="xyqfer" example="/laosiji/hotshow/128" path="/laosiji/hotshow/:id" :paramsDesc="['节目 id']"/>
## 留园网
### 分站
<Route author="nczitzk" example="/6park" path="/6park/:id?" :paramsDesc="['分站,见下表,默认为史海钩沉']">
| 婚姻家庭 | 魅力时尚 | 女性频道 | 生活百态 | 美食厨房 | 非常影音 |
| -------- | -------- | -------- | -------- | -------- | -------- |
| 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)
:::
</Route>
### 精华区
<Route author="nczitzk" example="/6park/chan1/gold" path="/6park/:id/gold" :paramsDesc="['分站,见上表']"/>
### 搜索关键字
<Route author="nczitzk" example="/6park/chan1/keywords/都市" path="/6park/:id/keywords/:keyword?" :paramsDesc="['分站,见上表', '关键字']"/>
## 妈咪帮
<Route author="nczitzk" example="/mamibuy" path="/mamibuy/:caty?/:age?/:sort?" :paramsDesc="['分类,见下表,默认为全分類', '岁数,见下表,默认为不限', '排序,见下表,默认为最新']">
@@ -1370,6 +1438,24 @@ column 为 third 时可选的 category:
</Route>
## 美国半导体行业协会
### 新闻
<Route author="nczitzk" example="/semiconductors/latest-news" path="/semiconductors/latest-news"/>
## 美国大学和雇主协会
### 博客
<Route author="nczitzk" example="/nace/blog" path="/nace/blog/:sort?" :paramsDesc="['排序,见下表,默认为 Most Recent']">
| Most Recent | Top Rated | Most Read |
| ----------- | --------- | ------------- |
| | top-blogs | mostreadblogs |
</Route>
## 梅花网
### 作品
@@ -1404,18 +1490,6 @@ column 为 third 时可选的 category:
</Route>
## 美国大学和雇主协会
### 博客
<Route author="nczitzk" example="/nace/blog" path="/nace/blog/:sort?" :paramsDesc="['排序,见下表,默认为 Most Recent']">
| Most Recent | Top Rated | Most Read |
| ----------- | --------- | ------------- |
| | top-blogs | mostreadblogs |
</Route>
## 梅斯医学 MedSci
### 推荐
@@ -2028,6 +2102,22 @@ column 为 third 时可选的 category:
<Route author="nczitzk" example="/interesting-sky/recent-interesting" path="/interesting-sky/recent-interesting"/>
## 游戏葡萄
无文章正文,仅有目录索引。
### 全部文章
<Route author="KotoriK" example="/gamegrape" path="/gamegrape/index"/>
### 分类
例子对应[深度分类](http://youxiputao.com/article/index/id/13)
<Route author="KotoriK" example="/gamegrape/13" path="/gamegrape/:id?"/>
## 鱼塘热榜
<Route author="TheresaQWQ" example="/mofish/2" path="/mofish/:id" :paramsDesc="['分类id,可以在 https://api.tophub.fun/GetAllType 获取']" />
## 遠見
<Route author="laampui" example="/gvm/index/health" path="/gvm/index/:category?" :paramsDesc="['見下表, 默認爲 newest']">
@@ -2086,6 +2176,18 @@ column 为 third 时可选的 category:
<Route author="nczitzk" example="/clb/commentary" path="/clb/commentary/:lang?" :paramsDesc="['语言,默认为简体中文,可选 `en` 即英文']"/>
## 眾新聞
### 眾聞
<Route author="nczitzk" example="/hkcnews/news" path="/hkcnews/news/:category?" :paramsDesc="['分类,见下表,默认为全部']">
| 全部 | 經濟 | 社會 | 生活 | 政治 | 國際 | 台灣 | 人物 | 中國 |
| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- |
| | 13 | 15 | 14 | 12 | 16 | 20 | 21 | 19 |
</Route>
## 装备前线
### 首页最新帖子
+2
View File
@@ -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)
:::
+42
View File
@@ -20,6 +20,12 @@ pageClass: routes
<Route author="nczitzk" example="/anki/changes" path="/anki/changes"/>
## AnyTXT
### Release Notes
<Route author="nczitzk" example="/anytxt/release-notes" path="/anytxt/release-notes"/>
## Apkpure
### Versions
@@ -212,6 +218,12 @@ pageClass: routes
<Route author="hoilc" example="/edge/addon/gangkeiaobmjcjokiofpkfpcobpbmnln" path="/edge/addon/:crxid" :paramsDesc="['扩展 id, 可在扩展页 URL 中找到']" />
## Microsoft Store
### Updates
<Route author="hellodword" example="/microsoft-store/updates/9WZDNCRFHVN5/CN" path="/microsoft-store/updates/:productid/:market?" :paramsDesc="['在 Store 中点击 `分享` - `复制链接` 即可获得', '默认为 `CN`']" />
## Minecraft
见 [#minecraft](/game.html#minecraft)
@@ -310,6 +322,16 @@ pageClass: routes
<Route author="nczitzk" example="/sesame/release_notes" path="/sesame/release_notes"/>
## simpread
### 消息通知
<Route author="zytomorrow" example="/simpread/notice" path="/simpread/notice"/>
### 更新日志
<Route author="zytomorrow" example="/simpread/changelog" path="/simpread/changelog"/>
## sketch.com
### beta 更新
@@ -413,3 +435,23 @@ pageClass: routes
### 金米奖
<Route author="nczitzk" example="/mi/golden" path="/mi/golden"/>
## 猿料
### 标签
<Route author="nczitzk" example="/yuanliao" path="/yuanliao/:tag/:sort?" :paramsDesc="['标签,见下表,默认为 `utools`', '排序,见下表,默认为最新回复']">
标签
| uTools | 插件发布 |
| ------ | -------- |
| utools | plugins |
排序
| 最新回复 | 热门回复 | 新鲜出炉 | 陈年旧贴 |
| -------- | ------------- | ---------- | --------- |
| | -commentCount | -createdAt | createdAt |
</Route>
+1 -1
View File
@@ -34,7 +34,7 @@ pageClass: routes
### TheBatch 周报
<Route author="nczitzk" example="/deeplearning/thebatch" path="/deeplearning/thebatch"/>
<Route author="nczitzk" example="/deeplearningai/thebatch" path="/deeplearningai/thebatch"/>
## Dockone
-4
View File
@@ -190,10 +190,6 @@ count 的取值范围为 1-12,为防止请求次数过多,推荐设置为 5
<Route author="junbaor" example="/enclavebooks/collection/103702" path="/enclavebooks/collection/:uid" :paramsDesc="['用户ID, 自行抓包寻找']"/>
## 观止(每日一文)
<route name="观止" author="Andiedie" example="/guanzhi" path="/guanzhi"/>
## 归档
<Route author="nczitzk" example="/sobooks/date/2020-11" path="/sobooks/date/:date?" :paramsDesc="['日期,见例子,默认为当前年月']"/>
+18
View File
@@ -36,6 +36,12 @@ pageClass: routes
</Route>
## booth.pm
### 店铺
<Route author="KTachibanaM" example="/booth.pm/shop/annn-boc0123" path="/booth.pm/shop/:subdomain" :paramsDesc="['店铺子域名']" />
## Craigslist
### 商品搜索
@@ -166,6 +172,18 @@ For instance, in <https://www.leboncoin.fr/recherche/?**category=10&locations=Pa
<Route author="sanmmm" example="/liwushuo/index" path="/liwushuo/index"/>
## 麦当劳
### 麦当劳活动资讯
<Route author="huyyi" example="/mcdonalds/sales+event" path="/mcdonalds/:category" :paramsDesc="['分类名(可用+连接多个分类)']">
| 全部分类 | 社会责任 | 人员品牌 | 产品故事 | 优惠 | 品牌文化 | 活动速报 |
| --------- | -------------- | -------- | -------- | ----- | -------- | -------- |
| news_list | responsibility | brand | product | sales | culture | event |
</Route>
## 缺书网
### 促销
+29
View File
@@ -320,6 +320,16 @@ Tiny Tiny RSS 会给所有 iframe 元素添加 `sandbox="allow-scripts"` 属性
<Route author="maple3142" example="/facebook/page/SonetPCR" path="/facebook/page/:id" :paramsDesc="['專頁 id']" anticrawler="1"/>
## Gab
### 用戶時間線
<Route author="zphw" example="/gab/user/realdonaldtrump" path="/gab/user/:username" :paramsDesc="['用戶名']" />
### 熱門
<Route author="zphw" example="/gab/popular/hot" path="/gab/popular/:sort?" :paramsDesc="['排序方式, `hot` 為 Hot Posts, `top` 為 Top Posts。默認為 hot']" />
## iCity
### 用户动态
@@ -1114,6 +1124,16 @@ rule
<Route author="DIYgod" example="/zhihu/hotlist" path="/zhihu/hotlist" anticrawler="1" radar="1" rssbud="1"/>
### 知乎分类热榜
<Route author="nczitzk" example="/zhihu/hot" path="/zhihu/hot/:category?" :paramsDesc="['分类,见下表,默认为全站']" anticrawler="1" radar="1" rssbud="1">
| 全站 | 国际 | 科学 | 汽车 | 视频 | 时尚 | 时事 | 数码 | 体育 | 校园 | 影视 |
| ----- | ----- | ------- | ---- | ------ | ------- | ----- | ------- | ----- | ------ | ---- |
| total | focus | science | car | zvideo | fashion | depth | digital | sport | school | film |
</Route>
### 知乎想法热榜
<Route author="xyqfer" example="/zhihu/pin/hotlist" path="/zhihu/pin/hotlist" anticrawler="1" radar="1" rssbud="1"/>
@@ -1141,3 +1161,12 @@ rule
### 知乎书店 - 知乎周刊
<Route author="LogicJake" example="/zhihu/weekly" path="/zhihu/weekly" anticrawler="1" radar="1" rssbud="1"/>
### 用户关注时间线
<Route author="SeanChao" example="/zhihu/timeline" path="/zhihu/timeline" anticrawler="1" selfhost="1"/>
::: warning 注意
用户关注动态需要登录后的 Cookie 值,所以只能自建,详情见部署页面的配置模块。
:::
+12
View File
@@ -388,6 +388,18 @@ pageClass: routes
</Route>
## 阳光高考
### 教育部阳光高考信息公开平台招生政策规定
<Route author="nczitzk" example="/chsi/zszcgd" path="/chsi/zszcgd/:category?" :paramsDesc="['分类,默认为招生政策']">
| 招生政策 | 深化考试招生制度改革 | 教育法律法规 |
| -------- | -------------------- | ------------ |
| dnzszc | zdgg | jyflfg |
</Route>
## 印象识堂
### 印象剪藏
+53
View File
@@ -26,6 +26,10 @@ pageClass: routes
## AP News
### 首页头条
<Route author="zphw" example="/apnews" path="/apnews" />
### 话题
<Route author="zoenglinghou" example="/apnews/topics/apf-topnews" path="/apnews/topics/:topic" :paramsDesc="['话题名称,可在 URL 中找到,例如 AP Top News [https://apnews.com/apf-topnews](https://apnews.com/apf-topnews) 的话题为 `apf-topnews`']" radar="1" rssbud="1"/>
@@ -181,6 +185,23 @@ pageClass: routes
<Route author="oppliate" example="/phoronix/news_topic/Intel" path="/phoronix/:page/:queryOrItem?" :paramsDesc="['页面', '对 `category` 页面是分类项目 `item`,对其它页面是主题 `q`,可以在网站顶部导航栏各项目链接里找出。如 `https://www.phoronix.com/scan.php?page=category&item=Computers` 对应 `/phoronix/category/Computers`']" />
## RTHK 傳媒透視
<Route author="tpnonthealps" example="/mediadigest/latest" path="/mediadigest/:range" :paramsDesc="['时间范围']">
细则:
- `:range` 时间范围参数
(可为 `latest` 或 `四位数字的年份`)
- `latest`: 最新的 50 篇文章
- `2020`: 2020 年的所有文章
- 全文输出转换为简体字: `?opencc=t2s`
(`opencc` 是 RSSHub 的通用参数,详情请参阅 [「中文简繁体转换」](https://docs.rsshub.app/parameter.html#zhong-wen-jian-fan-ti-zhuan-huan))
</Route>
## Solidot
### 最新消息
@@ -247,6 +268,26 @@ Solidot 提供的 feed:
<Route author="emdoe" example="/udn/global/鏡頭背後" path="/udn/global/:tid" :paramsDesc="['標籤名稱,請在轉角國際首頁獲取;如果選擇輸入 `newest` 則輸出最新文章']">
## Voice of America (VOA)
透過提取全文,以獲得更好的閱讀體驗
<Route author="zphw" example="/voa/cantonese/zprtie-ttp" path="/voa/:language/:channel?" :paramsDesc="['語言','頻道,可於官網獲取']">
`语言`
| 粵語 | 中文 | 藏語 |
| --------- | ------- | ------- |
| cantonese | chinese | tibetan |
`频道`
可於各語言官網聚合新聞處 (如 <https://www.voacantonese.com/rssfeeds>) 獲取
例如 `https://www.voacantonese.com/api/zyrtyequty` 將對應 `/voa/cantonese/zyrtyequty`
</Route>
## Yahoo
### 新聞
@@ -965,3 +1006,15 @@ category 对应的关键词有
### 九江新闻
<Route author="jjlzg" example="/fjnews/jjnews" path="/fjnews/jjnews"/>
## 自由亚洲电台
<Route author="zphw" example="/rfa/mandarin" path="/rfa/:language?/:channel?/:subChannel?" :paramsDesc="['语言,默认 English', '频道', '子频道(如存在)']" />
通过指定频道参数,提供比官方源更佳的阅读体验。
参数均可在官网获取,如:
`https://www.rfa.org/cantonese/news` 对应 `/rfa/cantonese/news`
`https://www.rfa.org/cantonese/news/htm` 对应 `/rfa/cantonese/news/htm`
+6
View File
@@ -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();
+110 -6
View File
@@ -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;
+37
View File
@@ -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: `<img src="${itemPicUrl}"/><br/>Time: ${item.find('p.subtitle.is-6 > a').text()}<br/>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(),
};
};
+37
View File
@@ -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: `<img src="${itemPicUrl}"/><br/>Time: ${item.find('p.subtitle.is-6 > a').text()}<br/>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(),
};
};
+58
View File
@@ -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(/<font color="#E6E6DD">6park.com<\/font>/g, '');
return item;
})
)
);
ctx.state.data = {
title: $('title').text(),
link: currentUrl,
item: items,
};
};
+3 -3
View File
@@ -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;
})
+33
View File
@@ -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: `<ol>${item.next().html()}</ol>`,
};
})
.get();
ctx.state.data = {
title: 'Release Notes - AnyTXT',
link: currentUrl,
item: items,
};
};
+54
View File
@@ -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 = `<img src="${featureImageURL}">`;
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,
};
};
+77
View File
@@ -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 += `<div class="item">${downloadLink.downloadCategory.name}: <a href="${downloadLink.url}">${downloadLink.url}</a></div>`;
}
const torrents = content('#download-wrapper').nextAll('.list').eq(0);
item.description = content('.info0').html() + `<div><b>下载地址:</b>${downloadLinks}</div>` + `${torrents.html() ? `<div><b>种子列表:</b>${torrents.html()}</div>` : ''}`;
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,
};
};
+57
View File
@@ -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: `<img src='${itemPreviewUrl}'/>`,
link: itemUrl,
});
}
}
ctx.state.data = {
title: shopName,
link: shopUrl,
description: shopName,
allowEmpty: true,
item: items,
};
};
+51
View File
@@ -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,
};
};
+46
View File
@@ -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,
};
};
+52
View File
@@ -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,
};
};
+62
View File
@@ -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 = `<img src="${image}" />`;
// 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,
};
};
+20 -7
View File
@@ -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}<br> 影片类型:${item.genres.join(' | ')} <br>评分:${item.rating.stars === '00' ? '无' : item.rating.average} <br/> <img src="${item.images.large}">`,
link: item.alt,
})),
item,
};
};
+31
View File
@@ -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}`,
})),
};
};
+50 -7
View File
@@ -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 += `<img src='http://www-mipengine-org.mipcdn.com/i/p5.manhuapan.com/${picurl[picurl.length - 1]}'/><br/>`;
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,
})),
};
};
+31
View File
@@ -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) => `<img src='${item.url}'>`).join('<br>');
const $ = cheerio.load(item.content);
return {
title: $.text() || 'Untitled',
description: item.content + (media && '<br>' + media),
link: item.url || baseURL,
pubDate: new Date(item.created_at).toISOString(),
};
})
);
ctx.state.data = {
title: `Gab - Popular posts`,
link: baseURL,
item: result,
};
};
+32
View File
@@ -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) => `<img src='${item.url}'>`).join('<br>');
const $ = cheerio.load(item.content);
return {
title: $.text() || 'Untitled',
description: item.content + (media && '<br>' + 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,
};
};
+49
View File
@@ -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,
};
};
+64
View File
@@ -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 = `<img src="${image}" />`;
// 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,
};
};
+49
View File
@@ -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>><\/span>(.*)<\/p>/)[1]} - 中国政协网`,
link: currentUrl,
item: items,
};
};
+52
View File
@@ -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,
};
};
+63
View File
@@ -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 <a href="https://docs.rsshub.app/government.html#guang-dong-sheng-jiao-yu-ting">docs</a>');
}
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,
};
};
@@ -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,
+38 -18
View File
@@ -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);
})
);
};
+60
View File
@@ -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,
};
};
+1 -1
View File
@@ -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(),
+2 -9
View File
@@ -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: `<img src='${item.cover_landscape}'><br>${item.content}`,
pubDate: new Date(item.pubdate_timestamp * 1000).toUTCString(),
+8 -5
View File
@@ -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];
+9
View File
@@ -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');
+53
View File
@@ -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,
};
};
+131
View File
@@ -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) => `<b>${author}</b><br>`);
const s_author = author.toArray().join('');
const author_block = `<blockquote><p>${s_author}</p></blockquote>`;
// 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: '<p>Invalid <code>:range</code> input.</p><p>所輸入<code>:range</code>參數有誤。</p><p>所输入<code>:range</code>参数有误。</p>',
},
];
// 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,
};
};
+32
View File
@@ -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}`,
},
],
};
};
+29
View File
@@ -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,
})),
};
};
+22 -44
View File
@@ -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 = `<div style="text-align: center;">${toc}` + s('.CourseCommonDetail_contentItem').first().html() + `</div>`;
return item;
})
)
);
ctx.state.data = {
title: '网易公开课 - 精品课程',
link: url,
item: out.filter((item) => item !== ''),
item,
};
};
+76
View File
@@ -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,
};
};
+1 -1
View File
@@ -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时只获取精华帖
+39
View File
@@ -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, // 指向文章的链接
},
],
};
};
+33
View File
@@ -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(),
};
};
+40
View File
@@ -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(),
};
};
+32
View File
@@ -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(),
};
};
+47
View File
@@ -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,
};
};
+53
View File
@@ -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,
};
};
+48
View File
@@ -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,
};
};
+79
View File
@@ -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('<ul></ul>');
} else {
$(item).prepend(`<b style='color:${text_color[span_class[1]]}'>${text}: </b>`);
}
}
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(),
};
};
+20
View File
@@ -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',
})),
};
};
+50
View File
@@ -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,
};
};
+43
View File
@@ -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,
};
};
+1 -1
View File
@@ -34,7 +34,7 @@ module.exports = async (ctx) => {
title: item.find('.container h1').text(),
description: item.find('.notes-container').text() + '<img src="' + item.find('img').attr('src') + '">',
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(),
+20 -25
View File
@@ -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()}<br><img src="${imgurl}">`,
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 += `<img src="${m.big_pic}">`;
}
}
return {
title: item.title,
description: `<p>${item.content}</p>${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}`,
};
}),
};
};
+46
View File
@@ -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(),
};
};
+24 -43
View File
@@ -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 = /<a[^>]*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 = {
+22 -41
View File
@@ -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 = /<a[^>]*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 = {
+23 -43
View File
@@ -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 = /<a[^>]*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 = {
+3
View File
@@ -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);
+5 -1
View File
@@ -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);
+3
View File
@@ -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);
+5 -1
View File
@@ -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);
+3 -3
View File
@@ -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);
})
+33 -13
View File
@@ -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[^>]*>|<\/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,
};
};
+10 -11
View File
@@ -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',
+55
View File
@@ -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,
};
};
+55
View File
@@ -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,
};
};
+1
View File
@@ -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);
+4 -4
View File
@@ -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 ? '<iframe id="ytplayer" type="text/html" width="640" height="360" src="https://www.youtube.com/embed/' + videoId + '" frameborder="0" allowfullscreen></iframe>' : ''
}${utils.formatDescription(snippet.description)}<img src="${img.url}">`,
embed ? '<iframe id="ytplayer" type="text/html" width="640" height="360" src="https://www.youtube.com/embed/' + videoId + '" frameborder="0" allowfullscreen></iframe>' : '<img src="' + img.url + '">'
}${utils.formatDescription(snippet.description)}`,
pubDate: new Date(snippet.publishedAt).toUTCString(),
link: `https://www.youtube.com/watch?v=${videoId}`,
};
+4 -4
View File
@@ -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 ? '<iframe id="ytplayer" type="text/html" width="640" height="360" src="https://www.youtube.com/embed/' + videoId + '" frameborder="0" allowfullscreen></iframe>' : ''}
${utils.formatDescription(snippet.description)}<img src="${img.url}">`,
description: `${embed ? '<iframe id="ytplayer" type="text/html" width="640" height="360" src="https://www.youtube.com/embed/' + videoId + '" frameborder="0" allowfullscreen></iframe>' : '<img src="' + img.url + '">'}
${utils.formatDescription(snippet.description)}`,
pubDate: new Date(snippet.publishedAt).toUTCString(),
link: `https://www.youtube.com/watch?v=${videoId}`,
author: authors[index].snippet.channelTitle,

Some files were not shown because too many files have changed in this diff Show More