feat: add xposed module changelog (#4624)
This commit is contained in:
parent
ef86f5b105
commit
00ae4b5495
|
|
@ -220,6 +220,10 @@ pageClass: routes
|
|||
|
||||
<Route author="maple3142" example="/xiaomieu/releases" path="/xiaomieu/releases"/>
|
||||
|
||||
## Xposed Module
|
||||
|
||||
<Route author="nczitzk" example="/xposed/module/com.ext.star.wars" path="/xposed/module/:mod" :paramsDesc="['模块包名, 模块页中的 Package 字段']"/>
|
||||
|
||||
## 怪物猎人世界
|
||||
|
||||
### 更新
|
||||
|
|
|
|||
|
|
@ -2616,6 +2616,9 @@ router.get('/digic-pictures/:menu/:tags?', require('./routes/digic-pictures/inde
|
|||
// cve.mitre.org
|
||||
router.get('/cve/search/:keyword', require('./routes/cve/search'));
|
||||
|
||||
// Xposed Module Repository
|
||||
router.get('/xposed/module/:mod', require('./routes/xposed/module'));
|
||||
|
||||
// Microsoft Edge
|
||||
router.get('/edge/addon/:crxid', require('./routes/edge/addon'));
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,34 @@
|
|||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const link = `https://repo.xposed.info/module/${ctx.params.mod}`;
|
||||
const response = await got({
|
||||
method: 'get',
|
||||
url: link,
|
||||
});
|
||||
|
||||
const data = response.data;
|
||||
|
||||
const $ = cheerio.load(data);
|
||||
const title = $('#page-title').text();
|
||||
const list = $('div.field-collection-view');
|
||||
|
||||
ctx.state.data = {
|
||||
title: `${title}(${ctx.params.mod})`,
|
||||
link: link,
|
||||
item:
|
||||
list &&
|
||||
list
|
||||
.map((_, item) => {
|
||||
item = $(item);
|
||||
return {
|
||||
title: item.find('div.field-name-field-version-number div.even').text(),
|
||||
description: item.find('div.field-name-field-changes').html(),
|
||||
link: link,
|
||||
pubDate: item.find('span.date-display-single').html().replace('- ', ''),
|
||||
};
|
||||
})
|
||||
.get(),
|
||||
};
|
||||
};
|
||||
Loading…
Reference in New Issue