diff --git a/docs/en/program-update.md b/docs/en/program-update.md index 84c3c9e983..f86246dbc3 100644 --- a/docs/en/program-update.md +++ b/docs/en/program-update.md @@ -36,6 +36,44 @@ pageClass: routes +## Bandisoft + +### History + + + +Software id + +| Bandizip (Win) | Bandizip (Mac) | Honeycam | Honeyview | +| -------------- | -------------- | -------- | --------- | +| bandizip | bandizip.mac | honeycam | honeyview | + +Language + +| English | en | +| 中文 (简体) | cn | +| 中文 (繁體) | tw | +| 日本語 | jp | +| Русский | ru | +| Español | es | +| Français | fr | +| Deutsch | de | +| Italiano | it | +| Slovenčina | sk | +| Українська | uk | +| Беларуская | be | +| Dansk | da | +| Polski | pl | +| Português Brasileiro | br | +| Čeština | cs | +| Nederlands | nl | +| Slovenščina| sl | +| Türkçe| tr | +| ภาษาไทย | th | +| 한국어 | kr | + + + ## Chocolatey ### Software Update diff --git a/docs/program-update.md b/docs/program-update.md index 99ae5632ee..135fae45ab 100644 --- a/docs/program-update.md +++ b/docs/program-update.md @@ -54,6 +54,44 @@ pageClass: routes +## Bandisoft + +### 更新记录 + + + +软件 id + +| Bandizip (Win) | Bandizip (Mac) | Honeycam | Honeyview | +| -------------- | -------------- | -------- | --------- | +| bandizip | bandizip.mac | honeycam | honeyview | + +语言 + +| English | en | +| 中文 (简体) | cn | +| 中文 (繁體) | tw | +| 日本語 | jp | +| Русский | ru | +| Español | es | +| Français | fr | +| Deutsch | de | +| Italiano | it | +| Slovenčina | sk | +| Українська | uk | +| Беларуская | be | +| Dansk | da | +| Polski | pl | +| Português Brasileiro | br | +| Čeština | cs | +| Nederlands | nl | +| Slovenščina| sl | +| Türkçe| tr | +| ภาษาไทย | th | +| 한국어 | kr | + + + ## Bugly SDK ### 更新日志 diff --git a/lib/router.js b/lib/router.js index b971f87f89..3c84a87d75 100644 --- a/lib/router.js +++ b/lib/router.js @@ -3676,4 +3676,7 @@ router.get('/cool18/:id?/:type?/:keyword?', require('./routes/cool18/index')); // 美国贸易代表办公室 router.get('/ustr/press-releases/:year?/:month?', require('./routes/us/ustr/press-releases')); +// Bandisoft +router.get('/bandisoft/:id?/:lang?', require('./routes/bandisoft/index')); + module.exports = router; diff --git a/lib/routes/bandisoft/index.js b/lib/routes/bandisoft/index.js new file mode 100644 index 0000000000..7ce535e3a9 --- /dev/null +++ b/lib/routes/bandisoft/index.js @@ -0,0 +1,38 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + const lang = ctx.params.lang || 'en'; + const id = ctx.params.id || 'bandizip'; + + const rootUrl = `https://${lang}.bandisoft.com`; + const currentUrl = `${rootUrl}/${id}/history/`; + const response = await got({ + method: 'get', + url: currentUrl, + }); + + const $ = cheerio.load(response.data); + + const items = $('h2') + .map((_, item) => { + item = $(item); + + const title = item.text(); + item.children('font').remove(); + + return { + title, + link: currentUrl, + description: item.next().html(), + pubDate: new Date(item.text()).toUTCString(), + }; + }) + .get(); + + ctx.state.data = { + title: $('title').text(), + link: currentUrl, + item: items, + }; +};