feat: add qttabbar change log (#6370)
This commit is contained in:
parent
30009679b9
commit
8c6d1a52c8
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -234,6 +234,12 @@ pageClass: routes
|
|||
|
||||
</Route>
|
||||
|
||||
## QTTabBar
|
||||
|
||||
### Change Log
|
||||
|
||||
<Route author="nczitzk" example="/qttabbar/change-log" path="/qttabbar/change-log"/>
|
||||
|
||||
## Quicker
|
||||
|
||||
### 版本更新
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
};
|
||||
};
|
||||
Loading…
Reference in New Issue