feat: add qttabbar change log (#6370)

This commit is contained in:
Ethan Shen 2020-12-08 19:22:10 +08:00 committed by GitHub
parent 30009679b9
commit 8c6d1a52c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 48 additions and 0 deletions

View File

@ -177,6 +177,12 @@ Refer to [#minecraft](/en/game.html#minecraft)
</RouteEn>
## QTTabBar
### Change Log
<RouteEn author="nczitzk" example="/qttabbar/change-log" path="/qttabbar/change-log"/>
## RescueTime
### Release Notes

View File

@ -234,6 +234,12 @@ pageClass: routes
</Route>
## QTTabBar
### Change Log
<Route author="nczitzk" example="/qttabbar/change-log" path="/qttabbar/change-log"/>
## Quicker
### 版本更新

View File

@ -3661,4 +3661,7 @@ router.get('/tesla', require('./routes/tesla/update'));
// 复旦大学继续教育学院
router.get('/fudan/cce', require('./routes/universities/fudan/cce'));
// QTTabBar
router.get('/qttabbar/change-log', require('./routes/qttabbar/change-log'));
module.exports = router;

View File

@ -0,0 +1,33 @@
const got = require('@/utils/got');
const cheerio = require('cheerio');
module.exports = async (ctx) => {
const rootUrl = 'http://qttabbar.wikidot.com/change-log';
const response = await got({
method: 'get',
url: rootUrl,
});
const $ = cheerio.load(response.data);
$('p strong a').parent().parent().remove();
const items = $('#page-content')
.children('p')
.map((_, item) => {
item = $(item);
return {
link: rootUrl,
title: item.text(),
description: item.next().html(),
pubDate: new Date(item.text().match(/\((.*)\)/)).toUTCString(),
};
})
.get();
ctx.state.data = {
title: 'Change Log - QTTabBar',
link: rootUrl,
item: items,
};
};