mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-09 06:30:40 +08:00
feat: chrome web store - extensions update
This commit is contained in:
@@ -36,6 +36,12 @@ pageClass: routes
|
|||||||
|
|
||||||
<RouteEn author="woodgear" example="/chocolatey/software/GoogleChrome" path="/chocolatey/software"/>
|
<RouteEn author="woodgear" example="/chocolatey/software/GoogleChrome" path="/chocolatey/software"/>
|
||||||
|
|
||||||
|
## Chrome Web Store
|
||||||
|
|
||||||
|
### Extensions Update
|
||||||
|
|
||||||
|
<Route author="DIYgod" example="/chrome/webstore/extensions/kefjpfngnndepjbopdmoebkipbgkggaa" path="/chrome/webstore/extensions/:id" :paramsDesc="['Extension id, can be found in extension url']/>
|
||||||
|
|
||||||
## CurseForge
|
## CurseForge
|
||||||
|
|
||||||
### File Update
|
### File Update
|
||||||
|
|||||||
@@ -56,6 +56,12 @@ pageClass: routes
|
|||||||
|
|
||||||
<Route author="woodgear" example="/chocolatey/software/GoogleChrome" path="/chocolatey/software"/>
|
<Route author="woodgear" example="/chocolatey/software/GoogleChrome" path="/chocolatey/software"/>
|
||||||
|
|
||||||
|
## Chrome 网上应用店
|
||||||
|
|
||||||
|
### 扩展程序更新
|
||||||
|
|
||||||
|
<Route author="DIYgod" example="/chrome/webstore/extensions/kefjpfngnndepjbopdmoebkipbgkggaa" path="/chrome/webstore/extensions/:id" :paramsDesc="['应用 id, 可在应用页 URL 中找到']/>
|
||||||
|
|
||||||
## CurseForge
|
## CurseForge
|
||||||
|
|
||||||
### 文件更新
|
### 文件更新
|
||||||
|
|||||||
@@ -2094,4 +2094,7 @@ router.get('/producthunt/today', require('./routes/producthunt/today'));
|
|||||||
router.get('/mlog-club/topics/:node', require('./routes/mlog-club/topics'));
|
router.get('/mlog-club/topics/:node', require('./routes/mlog-club/topics'));
|
||||||
router.get('/mlog-club/projects', require('./routes/mlog-club/projects'));
|
router.get('/mlog-club/projects', require('./routes/mlog-club/projects'));
|
||||||
|
|
||||||
|
// Chrome 网上应用店
|
||||||
|
router.get('/chrome/webstore/extensions/:id', require('./routes/chrome/extensions'));
|
||||||
|
|
||||||
module.exports = router;
|
module.exports = router;
|
||||||
|
|||||||
32
lib/routes/chrome/extensions.js
Normal file
32
lib/routes/chrome/extensions.js
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
const got = require('@/utils/got');
|
||||||
|
const cheerio = require('cheerio');
|
||||||
|
|
||||||
|
module.exports = async (ctx) => {
|
||||||
|
const id = ctx.params.id;
|
||||||
|
|
||||||
|
const response = await got({
|
||||||
|
method: 'get',
|
||||||
|
url: `https://chrome.google.com/webstore/detail/${id}`,
|
||||||
|
});
|
||||||
|
const data = cheerio
|
||||||
|
.load(response.data)('noscript')
|
||||||
|
.text();
|
||||||
|
const $ = cheerio.load(data);
|
||||||
|
|
||||||
|
const version = 'v' + $('.h-C-b-p-D-md').text();
|
||||||
|
|
||||||
|
ctx.state.data = {
|
||||||
|
title: $('.e-f-w').text() + ' 扩展程序更新 - Chrome',
|
||||||
|
link: `https://chrome.google.com/webstore/detail/${id}`,
|
||||||
|
item: [
|
||||||
|
{
|
||||||
|
title: version,
|
||||||
|
description: $('.C-b-p-D-J').html(),
|
||||||
|
link: `https://chrome.google.com/webstore/detail/${id}`,
|
||||||
|
pubDate: new Date($('.h-C-b-p-D-xh-hh').text()).toUTCString(),
|
||||||
|
guid: version,
|
||||||
|
author: $('.C-b-p-rc-D-R').text(),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user