mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-06 05:03:44 +08:00
feat(route): add MacWk (#7833)
This commit is contained in:
@@ -3041,6 +3041,17 @@
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
'macwk.com': {
|
||||||
|
_name: 'MacWk',
|
||||||
|
'.': [
|
||||||
|
{
|
||||||
|
title: '应用更新',
|
||||||
|
docs: 'https://docs.rsshub.app/program-update.html#macwk',
|
||||||
|
source: '/soft/:name',
|
||||||
|
target: '/macwk/soft/:name' ,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
'zyshow.net': {
|
'zyshow.net': {
|
||||||
www: [
|
www: [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -236,6 +236,12 @@ pageClass: routes
|
|||||||
|
|
||||||
<Route author="HXHL" example="/macked/app/cleanmymac-x" path="/macked/app/:name" :paramsDesc="['应用名, 可在应用页 URL 中找到']"/>
|
<Route author="HXHL" example="/macked/app/cleanmymac-x" path="/macked/app/:name" :paramsDesc="['应用名, 可在应用页 URL 中找到']"/>
|
||||||
|
|
||||||
|
## MacWk
|
||||||
|
|
||||||
|
### 应用更新
|
||||||
|
|
||||||
|
<Route author="f48vj" example="/macwk/soft/sublime-text" path="/macwk/soft/:name" :paramsDesc="['应用名, 可在应用页 URL 中找到']" radar="1" rssbud="1"/>
|
||||||
|
|
||||||
## ManicTime
|
## ManicTime
|
||||||
|
|
||||||
<Route author="nczitzk" example="/manictime/releases" path="/manictime/releases"/>
|
<Route author="nczitzk" example="/manictime/releases" path="/manictime/releases"/>
|
||||||
|
|||||||
@@ -4140,6 +4140,9 @@ router.get('/caus/:category?', require('./routes/caus'));
|
|||||||
// 摩点
|
// 摩点
|
||||||
router.get('/modian/zhongchou/:category?/:sort?/:status?', require('./routes/modian/zhongchou'));
|
router.get('/modian/zhongchou/:category?/:sort?/:status?', require('./routes/modian/zhongchou'));
|
||||||
|
|
||||||
|
// MacWk
|
||||||
|
router.get('/macwk/soft/:name', require('./routes/macwk/soft'));
|
||||||
|
|
||||||
// 世界计划 多彩舞台 feat.初音未来 (ProjectSekai)
|
// 世界计划 多彩舞台 feat.初音未来 (ProjectSekai)
|
||||||
router.get('/pjsk/news', require('./routes/pjsk/news'));
|
router.get('/pjsk/news', require('./routes/pjsk/news'));
|
||||||
|
|
||||||
@@ -4155,4 +4158,5 @@ router.get('/tanchinese/:category?', require('./routes/tanchinese'));
|
|||||||
// Harvard
|
// Harvard
|
||||||
router.get('/harvard/health/blog', require('./routes/universities/harvard/health/blog'));
|
router.get('/harvard/health/blog', require('./routes/universities/harvard/health/blog'));
|
||||||
|
|
||||||
|
|
||||||
module.exports = router;
|
module.exports = router;
|
||||||
|
|||||||
32
lib/routes/macwk/soft.js
Normal file
32
lib/routes/macwk/soft.js
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
const got = require('@/utils/got');
|
||||||
|
const queryString = require('query-string');
|
||||||
|
const { parseDate } = require('@/utils/parse-date');
|
||||||
|
|
||||||
|
module.exports = async (ctx) => {
|
||||||
|
const name = ctx.params.name;
|
||||||
|
const url = `https://api.macwk.com/api/items/soft?${queryString.stringify({
|
||||||
|
'filter[slug][eq]': name,
|
||||||
|
fields: 'id,title,description',
|
||||||
|
})}`;
|
||||||
|
const res = await got.get(url);
|
||||||
|
const data = res.data.data[0];
|
||||||
|
const versionsRes = await got.get(
|
||||||
|
`https://api.macwk.com/api/items/soft_version?${queryString.stringify({
|
||||||
|
'filter[softid][eq]': data.id,
|
||||||
|
})}`
|
||||||
|
);
|
||||||
|
const items = versionsRes.data.data.map((item) => ({
|
||||||
|
title: `${data.title} ${item.version}`,
|
||||||
|
pubDate: parseDate(item.created_on, 'YYYY/MM/DD HH:mm:ss'),
|
||||||
|
description: item.download.reduce((desc, download) => `${desc}<a href="${download.url}">${download.name}</a>${download.password ? `<p>密码:${download.password}</p>` : ''}<br>`, ''),
|
||||||
|
link: `https://macwk.com/soft/${name}`,
|
||||||
|
guid: `${name} ${item.version}`,
|
||||||
|
}));
|
||||||
|
|
||||||
|
ctx.state.data = {
|
||||||
|
title: `${data.title} 的软件更新`,
|
||||||
|
link: `https://macwk.com/soft/${name}`,
|
||||||
|
description: data.description,
|
||||||
|
item: items,
|
||||||
|
};
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user