diff --git a/docs/en/program-update.md b/docs/en/program-update.md index 9ae52221e..4174c952e 100644 --- a/docs/en/program-update.md +++ b/docs/en/program-update.md @@ -62,6 +62,16 @@ The parameters can be extracted from the Release page URL: `https://install.appc +## ASUS + +### BIOS + + + +### GPU Tweak + + + ## Bandisoft ### History diff --git a/docs/program-update.md b/docs/program-update.md index 034ede492..0184f51c9 100644 --- a/docs/program-update.md +++ b/docs/program-update.md @@ -577,6 +577,10 @@ pageClass: routes +### GPU Tweak + + + ## 蒲公英应用分发 ### app 更新 diff --git a/lib/v2/asus/gpu-tweak.js b/lib/v2/asus/gpu-tweak.js new file mode 100644 index 000000000..9bd4e277d --- /dev/null +++ b/lib/v2/asus/gpu-tweak.js @@ -0,0 +1,31 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); +const pageUrl = 'https://www.asus.com/campaign/GPU-Tweak-III/tw/index.php'; + +module.exports = async (ctx) => { + const response = await got(pageUrl); + const $ = cheerio.load(response.data); + + const items = $('section div.inner div.item') + .toArray() + .map((item) => { + item = $(item); + item.find('.last').remove(); + return { + title: item.find('.ver h6').text().trim(), + description: item.find('.btnbox a.open_patch_lightbox').attr('data-info'), + pubDate: parseDate(item.find('.ti').text()), + link: item.find('.btnbox a[download=]').attr('href'), + }; + }); + + ctx.state.data = { + title: $('head title').text(), + description: $('meta[name=description]').attr('content'), + image: new URL($('head link[rel="shortcut icon"]').attr('href'), pageUrl).href, + link: pageUrl, + item: items, + language: $('html').attr('lang'), + }; +}; diff --git a/lib/v2/asus/maintainer.js b/lib/v2/asus/maintainer.js index 45440b15a..0181d491f 100644 --- a/lib/v2/asus/maintainer.js +++ b/lib/v2/asus/maintainer.js @@ -1,3 +1,4 @@ module.exports = { '/bios/:model': ['Fatpandac'], + '/gpu-tweak': ['TonyRL'], }; diff --git a/lib/v2/asus/radar.js b/lib/v2/asus/radar.js index 636df00ac..6034dcd01 100644 --- a/lib/v2/asus/radar.js +++ b/lib/v2/asus/radar.js @@ -6,7 +6,18 @@ module.exports = { title: '固件', docs: 'https://docs.rsshub.app/program-update.html#hua-shuo', source: ['/'], - target: '/bios/:model', + target: '/asus/bios/:model', + }, + ], + }, + 'asus.com': { + _name: 'ASUS', + '.': [ + { + title: 'GPU Tweak', + docs: 'https://docs.rsshub.app/program-update.html#hua-shuo', + source: ['/campaign/GPU-Tweak-III/*', '/'], + target: '/asus/gpu-tweak', }, ], }, diff --git a/lib/v2/asus/router.js b/lib/v2/asus/router.js index e95103000..abb63ebea 100644 --- a/lib/v2/asus/router.js +++ b/lib/v2/asus/router.js @@ -1,3 +1,4 @@ module.exports = function (router) { router.get('/bios/:model', require('./bios')); + router.get('/gpu-tweak', require('./gpu-tweak')); };