mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-09 14:40:23 +08:00
feat: 添加对sketch.com 的beta版本更新支持 (#3028)
This commit is contained in:
@@ -140,6 +140,12 @@ pageClass: routes
|
|||||||
|
|
||||||
<Route author="DIYgod" example="/xclient/app/sketch" path="/xclient/app/:name" :paramsDesc="['应用名, 可在应用页 URL 中找到']"/>
|
<Route author="DIYgod" example="/xclient/app/sketch" path="/xclient/app/:name" :paramsDesc="['应用名, 可在应用页 URL 中找到']"/>
|
||||||
|
|
||||||
|
## sketch.com
|
||||||
|
|
||||||
|
### beta 更新
|
||||||
|
|
||||||
|
<Route author="Jeason0228" example="/sketch/beta" path="/sketch/beta" />
|
||||||
|
|
||||||
## Xiaomi.eu
|
## Xiaomi.eu
|
||||||
|
|
||||||
### ROM Releases
|
### ROM Releases
|
||||||
|
|||||||
@@ -1106,7 +1106,8 @@ router.get('/nowcoder/discuss/:type/:order', require('./routes/nowcoder/discuss'
|
|||||||
|
|
||||||
// Xiaomi.eu
|
// Xiaomi.eu
|
||||||
router.get('/xiaomieu/releases', require('./routes/xiaomieu/releases'));
|
router.get('/xiaomieu/releases', require('./routes/xiaomieu/releases'));
|
||||||
|
// sketch.com
|
||||||
|
router.get('/sketch/beta', require('./routes/sketch/beta'));
|
||||||
// 每日安全
|
// 每日安全
|
||||||
router.get('/security/pulses', require('./routes/security/pulses'));
|
router.get('/security/pulses', require('./routes/security/pulses'));
|
||||||
|
|
||||||
|
|||||||
23
lib/routes/sketch/beta.js
Normal file
23
lib/routes/sketch/beta.js
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
const got = require('@/utils/got');
|
||||||
|
const cheerio = require('cheerio');
|
||||||
|
|
||||||
|
module.exports = async (ctx) => {
|
||||||
|
const response = await got({
|
||||||
|
method: 'get',
|
||||||
|
url: 'https://www.sketch.com/beta/',
|
||||||
|
});
|
||||||
|
const data = response.data;
|
||||||
|
const $ = cheerio.load(data);
|
||||||
|
const titledata = $('.update-details h4')
|
||||||
|
.first()
|
||||||
|
.html();
|
||||||
|
// const versiondata=Number(titledata.substr(-2));
|
||||||
|
const content = $('.update-details').html();
|
||||||
|
|
||||||
|
ctx.state.data = {
|
||||||
|
title: titledata,
|
||||||
|
link: response.url,
|
||||||
|
description: content,
|
||||||
|
allowEmpty: true,
|
||||||
|
};
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user