feat: add manictime releases (#6059)

Co-authored-by: Henry Wang <hi@henry.wang>
This commit is contained in:
Ethan Shen 2020-10-31 00:31:13 +08:00 committed by GitHub
parent 6de46e59cb
commit b21ca45fa1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 42 additions and 0 deletions

View File

@ -104,6 +104,10 @@ The owner of the official image fills in the library, for example: https://rsshu
<RouteEn author="Jeason0228" example="/ipsw/index/ipsws/iPhone11,8" path="/ipsw/index/:ptype/:pname/" :paramsDesc="['Fill in ipsws or otas to get different versions of firmware','Product name, `http://rsshub.app/ipsw/index/ipsws/iPod`, if you fill in the iPad, follow the entire iPad series(ptype default to ipsws).`http://rsshub.app/ipsw/index/ipsws/iPhone11,8`, if you fill in the specific iPhone11,8, submit to the ipsws firmware information of this model']"/>
## ManicTime
<RouteEn author="nczitzk" example="/manictime/releases" path="/manictime/releases"/>
## Microsoft Edge
### Addons Update

View File

@ -156,6 +156,10 @@ pageClass: routes
<Route author="Jeason0228" example="/ipsw/index/ipsws/iPhone11,8" path="/ipsw/index/:ptype/:pname/" :paramsDesc="['填写ipsws或otas,得到不同版本的固件','产品名, `http://rsshub.app/ipsw/index/ipsws/iPod`如填写iPad则关注iPad整个系列(ptype选填为ipsws).`http://rsshub.app/ipsw/index/ipsws/iPhone11,8`如果填写具体的iPhone11,8则关注这个机型的ipsws固件信息']"/>
## ManicTime
<Route author="nczitzk" example="/manictime/releases" path="/manictime/releases"/>
## Microsoft Edge
### 外接程序更新

View File

@ -3404,6 +3404,9 @@ router.get('/dev.to/top/:period', require('./routes/dev.to/top'));
router.get('/gameres/hot', require('./routes/gameres/hot'));
router.get('/gameres/list/:id', require('./routes/gameres/list'));
// ManicTime
router.get('/manictime/releases', require('./routes/manictime/releases'));
// Deutsche Welle 德国之声
router.get('/dw/:lang?/:caty?', require('./routes/dw/index'));

View File

@ -0,0 +1,31 @@
const got = require('@/utils/got');
const cheerio = require('cheerio');
module.exports = async (ctx) => {
const rootUrl = 'https://www.manictime.com/Releases';
const response = await got({
method: 'get',
url: rootUrl,
});
const $ = cheerio.load(response.data);
const items = $('.col-md-4')
.slice(0, 10)
.map((_, item) => {
item = $(item);
return {
link: rootUrl,
title: item.find('h2').text(),
description: item.next().html(),
pubDate: new Date(item.find('p').eq(0).text().replace('Release date - ', '')).toUTCString(),
};
})
.get();
ctx.state.data = {
title: 'ManicTime releases',
link: rootUrl,
item: items,
};
};