From 20112cd93a6fb41a88c6a369d50be62972ff00b6 Mon Sep 17 00:00:00 2001 From: Kevin Date: Sun, 12 Aug 2018 23:51:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=85=BE=E8=AE=AF=E4=BA=91?= =?UTF-8?q?=E7=9B=B4=E6=92=AD=20SDK=20=E6=9B=B4=E6=96=B0=E6=97=A5=E5=BF=97?= =?UTF-8?q?=20(#449)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 ++ docs/README.md | 10 ++++++++++ router.js | 3 +++ routes/qcloud/mlvb/changelog.js | 34 +++++++++++++++++++++++++++++++++ 4 files changed, 49 insertions(+) create mode 100644 routes/qcloud/mlvb/changelog.js diff --git a/README.md b/README.md index 587e553612..439871cbca 100644 --- a/README.md +++ b/README.md @@ -220,6 +220,8 @@ RSSHub 是一个轻量、易于扩展的 RSS 生成器,可以给任何奇奇 - 博文 - 开源中国 - 资讯 +- 腾讯云 + - 移动直播 SDK 更新日志 diff --git a/docs/README.md b/docs/README.md index 590ab29734..639ca4be7d 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1764,3 +1764,13 @@ id,可选,分区或标签的 ID,对应 URL 中的 `sid` 或 `tid` 路由: `/oschina/news` 参数:无 + +## 腾讯云 + +### 移动直播 SDK 更新日志 + +举例: [https://rsshub.app/qcloud/mlvb/changelog](https://rsshub.app/qcloud/mlvb/changelog) + +路由: `/qcloud/mlvb/changelog` + +参数:无 diff --git a/router.js b/router.js index dafad880da..02bddcef38 100755 --- a/router.js +++ b/router.js @@ -399,4 +399,7 @@ router.get('/linkedkeeper/:type/:id?', require('./routes/linkedkeeper/index')); // 开源中国 router.get('/oschina/news', require('./routes/oschina/news')); +// 腾讯视频 SDK +router.get('/qcloud/mlvb/changelog', require('./routes/qcloud/mlvb/changelog')); + module.exports = router; diff --git a/routes/qcloud/mlvb/changelog.js b/routes/qcloud/mlvb/changelog.js new file mode 100644 index 0000000000..57f3ac657a --- /dev/null +++ b/routes/qcloud/mlvb/changelog.js @@ -0,0 +1,34 @@ +const axios = require('../../../utils/axios'); +const cheerio = require('cheerio'); +const config = require('../../../config'); + +module.exports = async (ctx) => { + const url = 'https://cloud.tencent.com/document/product/454/7878'; + + const res = await axios({ + method: 'get', + url: url, + headers: { + 'User-Agent': config.ua, + }, + }); + const data = res.data; + const $ = cheerio.load(data); + + const resultItem = []; + $('#docArticleContent h3').each(function() { + const item = {}; + item.title = $(this).text(); + item.description = $(this) + .nextUntil('h3') + .text(); + item.link = url; + resultItem.push(item); + }); + + ctx.state.data = { + title: '腾讯移动直播 SDK 更新日志', + link: url, + item: resultItem, + }; +};