feat(route):add 政采云前端小报和博客 (#9379)

* feat(route):add 政采云前端小报和博客

* fix:因为使用了空值合并操作符??,所有node的版本必须大于等于14

* feat(route):add 政采云前端小报和博客

* fix:因为使用了空值合并操作符??,所有node的版本必须大于等于14

* docs:新增英文说明

* docs:调整位置

* feat: Modify Backquotes

* fix:remove duplicate rssbud and add zooTeam

* fix: add a close tag

* docs: fix docs tags and attrs

* fix:add timezone
This commit is contained in:
Humble 2022-03-25 20:47:06 +08:00 committed by GitHub
parent d1cda2a2be
commit c91a4cdd1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 134 additions and 12 deletions

View File

@ -70,11 +70,11 @@ Category
### Commits
<RouteEn author="AuroraDysis" example="/bitbucket/commits/blaze-lib/blaze" path="/bitbucket/commits/:workspace/:repo_slug" :paramsDesc="['Workspace', 'Repository']" rssbud="1" rssbud="1"/>
<RouteEn author="AuroraDysis" example="/bitbucket/commits/blaze-lib/blaze" path="/bitbucket/commits/:workspace/:repo_slug" :paramsDesc="['Workspace', 'Repository']" radar="1" rssbud="1" />
### Tags
<RouteEn author="AuroraDysis" example="/bitbucket/tags/blaze-lib/blaze" path="/bitbucket/tags/:workspace/:repo_slug" :paramsDesc="['Workspace', 'Repository']" rssbud="1" rssbud="1"/>
<RouteEn author="AuroraDysis" example="/bitbucket/tags/blaze-lib/blaze" path="/bitbucket/tags/:workspace/:repo_slug" :paramsDesc="['Workspace', 'Repository']" radar="1" rssbud="1" />
## Bitmovin
@ -125,15 +125,15 @@ GitHub provides some official RSS feeds:
<RouteEn author="queensferryme" example="/github/topics/framework" path="/github/topics/:name/:qs?" :paramsDesc="['Topic name, which can be found in the URL of the corresponding [Topics Page](https://github.com/topics/framework)', 'Query string, like `l=php&o=desc&s=stars`. Details listed as follows:']" radar="1" rssbud="1">
| Parameter | Description | Values |
| ---- | ---- | ---- |
| `l` | Language | For instance `php`, which can be found in the URL of the corresponding [Topics page](https://github.com/topics/framework?l=php) |
| `o` | Sorting Order | `asc`, `desc` |
| `s` | Sorting Criteria | `stars`, `forks`, `updated` |
| Parameter | Description | Values |
| --------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `l` | Language | For instance `php`, which can be found in the URL of the corresponding [Topics page](https://github.com/topics/framework?l=php) |
| `o` | Sorting Order | `asc`, `desc` |
| `s` | Sorting Criteria | `stars`, `forks`, `updated` |
For instance, the `/github/topics/framework/l=php&o=desc&s=stars` route will generate the RSS feed corresponding to this [page](https://github.com/topics/framework?l=php&o=desc&s=stars).
</Route>
</RouteEn>
### Repo Issues
@ -174,7 +174,7 @@ For instance, the `/github/topics/framework/l=php&o=desc&s=stars` route will gen
### Search Result
<RouteEn author="LogicJake" example="/github/search/RSSHub/bestmatch/desc" path="/github/search/:query/:sort?/:order?" :paramsDesc="['search keyword', 'Sort options (default to bestmatch)','Sort order, desc and asc (desc descending by default)']"/>
<RouteEn author="LogicJake" example="/github/search/RSSHub/bestmatch/desc" path="/github/search/:query/:sort?/:order?" :paramsDesc="['search keyword', 'Sort options (default to bestmatch)','Sort order, desc and asc (desc descending by default)']">
| Sort options | sort |
| ---------------- | --------- |
@ -183,6 +183,8 @@ For instance, the `/github/topics/framework/l=php&o=desc&s=stars` route will gen
| Most forks | forks |
| Recently updated | updated |
</RouteEn>
### User Starred Repositories
<RouteEn author="LanceZhu" example="/github/starred_repos/DIYgod" path="/github/starred_repos/:user" :paramsDesc="['User name']" radar="1" rssbud="1"/>
@ -375,3 +377,13 @@ Subscribe to the updates (threads and submission) from a paritcular Hacker News
| featured | trending | trending_m | trending_d | popular | new |
</RouteEn>
## zooTeam
### blog
<RouteEn author="Pulset" example="/zooTeam/blog" path="/zooTeam/blog" radar="1" rssbud="1"/>
### weekly
<RouteEn author="Pulset" example="/zooTeam/weekly" path="/zooTeam/weekly" radar="1" rssbud="1"/>

View File

@ -84,11 +84,11 @@ Rated 对象
### Commits
<Route author="AuroraDysis" example="/bitbucket/commits/blaze-lib/blaze" path="/bitbucket/commits/:workspace/:repo_slug" :paramsDesc="['Workspace', 'Repository']" rssbud="1" rssbud="1"/>
<Route author="AuroraDysis" example="/bitbucket/commits/blaze-lib/blaze" path="/bitbucket/commits/:workspace/:repo_slug" :paramsDesc="['Workspace', 'Repository']" radar="1" rssbud="1" />
### Tags
<Route author="AuroraDysis" example="/bitbucket/tags/blaze-lib/blaze" path="/bitbucket/tags/:workspace/:repo_slug" :paramsDesc="['Workspace', 'Repository']" rssbud="1" rssbud="1"/>
<Route author="AuroraDysis" example="/bitbucket/tags/blaze-lib/blaze" path="/bitbucket/tags/:workspace/:repo_slug" :paramsDesc="['Workspace', 'Repository']" radar="1" rssbud="1" />
## Bitmovin
@ -252,7 +252,7 @@ GitHub 官方也提供了一些 RSS:
### 搜索结果
<Route author="LogicJake" example="/github/search/RSSHub/bestmatch/desc" path="/github/search/:query/:sort?/:order?" :paramsDesc="['搜索关键词', '排序选项默认为bestmatch','排序顺序desc和asc默认desc降序']"/>
<Route author="LogicJake" example="/github/search/RSSHub/bestmatch/desc" path="/github/search/:query/:sort?/:order?" :paramsDesc="['搜索关键词', '排序选项默认为bestmatch','排序顺序desc和asc默认desc降序']">
| 排序选项 | sort |
| ------------ | --------- |
@ -261,6 +261,8 @@ GitHub 官方也提供了一些 RSS:
| 根据 fork 数量排序 | forks |
| 根据更新时间排序 | updated |
</Route>
### 用户 Star 的仓库
<Route author="LanceZhu" example="/github/starred_repos/DIYgod" path="/github/starred_repos/:user" :paramsDesc="['用户名']" radar="1" rssbud="1"/>
@ -1006,6 +1008,16 @@ GitHub 官方也提供了一些 RSS:
<Route author="daijinru" example="/docschina/jsweekly" path="/docschina/jsweekly"/>
## 政采云前端技术团队
### 博客
<Route author="Pulset" example="/zooTeam/blog" path="/zooTeam/blog" radar="1" rssbud="1"/>
### 小报
<Route author="Pulset" example="/zooTeam/weekly" path="/zooTeam/weekly" radar="1" rssbud="1"/>
## 知晓程序
### 文章

32
lib/v2/zooTeam/blog.js Normal file
View File

@ -0,0 +1,32 @@
const got = require('@/utils/got');
const timezone = require('@/utils/timezone');
const { parseDate } = require('@/utils/parse-date');
module.exports = async (ctx) => {
const response = await got({
method: 'get',
url: 'https://www.zoo.team/api/articles',
});
const data = response.data.data.articles;
ctx.state.data = {
// 源标题
title: '政采云前端博客',
// 源链接
link: 'https://www.zoo.team',
// 源说明
description: '政采云前端博客',
// 遍历此前获取的数据
item: data.map((item) => ({
// 文章标题
title: item.title,
// 文章正文
description: `${item.desc}<br><img src="${item.cover}">`,
// 文章发布时间
pubDate: timezone(parseDate(item.created_at), +8),
// 文章链接
link: `https://zoo.team/article/${item.path}`,
// 分类
category: item.category,
})),
};
};

View File

@ -0,0 +1,4 @@
module.exports = {
'/zooTeam/blog': ['Pulset'],
'/zooTeam/weekly': ['Pulset'],
};

21
lib/v2/zooTeam/radar.js Normal file
View File

@ -0,0 +1,21 @@
module.exports = {
'zoo.team': {
_name: '政采云前端技术团队',
weekly: [
{
title: '小报',
docs: 'https://docs.rsshub.app/blog.html#zheng-cai-yun-qian-duan-ji-shu-tuan-dui',
source: '/',
target: '/zooTeam/weekly',
},
],
www: [
{
title: '博客',
docs: 'https://docs.rsshub.app/blog.html#zheng-cai-yun-qian-duan-ji-shu-tuan-dui',
source: '/',
target: '/zooTeam/blog',
},
],
},
};

4
lib/v2/zooTeam/router.js Normal file
View File

@ -0,0 +1,4 @@
module.exports = function (router) {
router.get('/blog', require('./blog'));
router.get('/weekly', require('./weekly'));
};

34
lib/v2/zooTeam/weekly.js Normal file
View File

@ -0,0 +1,34 @@
const got = require('@/utils/got');
const timezone = require('@/utils/timezone');
const { parseDate } = require('@/utils/parse-date');
module.exports = async (ctx) => {
const response = await got({
method: 'get',
url: 'https://weekly.zoo.team:3030/api/lastest/list',
});
const data = response.data.data;
ctx.state.data = {
// 源标题
title: '政采云前端小报',
// 源链接
link: 'https://weekly.zoo.team/',
// 源说明
description: '政采云前端小报',
// 有可能接口返回为空
allowEmpty: true,
// 遍历此前获取的数据
item: data.map((item) => ({
// 文章标题
title: item.title,
// 文章正文
description: item.description,
// 文章发布时间
pubDate: timezone(parseDate(item.timestamp * 1000), +8),
// 文章链接
link: item.link,
// 分类
category: item.category,
})),
};
};

View File

@ -158,5 +158,8 @@
},
"nodemonConfig": {
"ext": "art,js,mjs,json"
},
"engines": {
"node": ">=14"
}
}