From c91a4cdd1d5ec3f51774c35ed37caeb6357d257e Mon Sep 17 00:00:00 2001 From: Humble <745653239@qq.com> Date: Fri, 25 Mar 2022 20:47:06 +0800 Subject: [PATCH] =?UTF-8?q?feat(route):add=20=E6=94=BF=E9=87=87=E4=BA=91?= =?UTF-8?q?=E5=89=8D=E7=AB=AF=E5=B0=8F=E6=8A=A5=E5=92=8C=E5=8D=9A=E5=AE=A2?= =?UTF-8?q?=20(#9379)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 --- docs/en/programming.md | 30 +++++++++++++++++++++--------- docs/programming.md | 18 +++++++++++++++--- lib/v2/zooTeam/blog.js | 32 ++++++++++++++++++++++++++++++++ lib/v2/zooTeam/maintainer.js | 4 ++++ lib/v2/zooTeam/radar.js | 21 +++++++++++++++++++++ lib/v2/zooTeam/router.js | 4 ++++ lib/v2/zooTeam/weekly.js | 34 ++++++++++++++++++++++++++++++++++ package.json | 3 +++ 8 files changed, 134 insertions(+), 12 deletions(-) create mode 100644 lib/v2/zooTeam/blog.js create mode 100644 lib/v2/zooTeam/maintainer.js create mode 100644 lib/v2/zooTeam/radar.js create mode 100644 lib/v2/zooTeam/router.js create mode 100644 lib/v2/zooTeam/weekly.js diff --git a/docs/en/programming.md b/docs/en/programming.md index d705226d0..da7d0281b 100644 --- a/docs/en/programming.md +++ b/docs/en/programming.md @@ -70,11 +70,11 @@ Category ### Commits - + ### Tags - + ## Bitmovin @@ -125,15 +125,15 @@ GitHub provides some official RSS feeds: -| 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). - + ### Repo Issues @@ -174,7 +174,7 @@ For instance, the `/github/topics/framework/l=php&o=desc&s=stars` route will gen ### Search Result - + | 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 | + + ### User Starred Repositories @@ -375,3 +377,13 @@ Subscribe to the updates (threads and submission) from a paritcular Hacker News | featured | trending | trending_m | trending_d | popular | new | + +## zooTeam + +### blog + + + +### weekly + + diff --git a/docs/programming.md b/docs/programming.md index c4671fea6..8f0cb9097 100644 --- a/docs/programming.md +++ b/docs/programming.md @@ -84,11 +84,11 @@ Rated 对象 ### Commits - + ### Tags - + ## Bitmovin @@ -252,7 +252,7 @@ GitHub 官方也提供了一些 RSS: ### 搜索结果 - + | 排序选项 | sort | | ------------ | --------- | @@ -261,6 +261,8 @@ GitHub 官方也提供了一些 RSS: | 根据 fork 数量排序 | forks | | 根据更新时间排序 | updated | + + ### 用户 Star 的仓库 @@ -1006,6 +1008,16 @@ GitHub 官方也提供了一些 RSS: +## 政采云前端技术团队 + +### 博客 + + + +### 小报 + + + ## 知晓程序 ### 文章 diff --git a/lib/v2/zooTeam/blog.js b/lib/v2/zooTeam/blog.js new file mode 100644 index 000000000..bbfe71ad4 --- /dev/null +++ b/lib/v2/zooTeam/blog.js @@ -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}
`, + // 文章发布时间 + pubDate: timezone(parseDate(item.created_at), +8), + // 文章链接 + link: `https://zoo.team/article/${item.path}`, + // 分类 + category: item.category, + })), + }; +}; diff --git a/lib/v2/zooTeam/maintainer.js b/lib/v2/zooTeam/maintainer.js new file mode 100644 index 000000000..358e9170a --- /dev/null +++ b/lib/v2/zooTeam/maintainer.js @@ -0,0 +1,4 @@ +module.exports = { + '/zooTeam/blog': ['Pulset'], + '/zooTeam/weekly': ['Pulset'], +}; diff --git a/lib/v2/zooTeam/radar.js b/lib/v2/zooTeam/radar.js new file mode 100644 index 000000000..d42ae0feb --- /dev/null +++ b/lib/v2/zooTeam/radar.js @@ -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', + }, + ], + }, +}; diff --git a/lib/v2/zooTeam/router.js b/lib/v2/zooTeam/router.js new file mode 100644 index 000000000..75a52c6e8 --- /dev/null +++ b/lib/v2/zooTeam/router.js @@ -0,0 +1,4 @@ +module.exports = function (router) { + router.get('/blog', require('./blog')); + router.get('/weekly', require('./weekly')); +}; diff --git a/lib/v2/zooTeam/weekly.js b/lib/v2/zooTeam/weekly.js new file mode 100644 index 000000000..ba651aeaf --- /dev/null +++ b/lib/v2/zooTeam/weekly.js @@ -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, + })), + }; +}; diff --git a/package.json b/package.json index 042b9f228..ab68d8aa3 100644 --- a/package.json +++ b/package.json @@ -158,5 +158,8 @@ }, "nodemonConfig": { "ext": "art,js,mjs,json" + }, + "engines": { + "node": ">=14" } }