feat: add bandisoft history (#6392)

This commit is contained in:
Ethan Shen
2020-12-10 14:01:30 +00:00
committed by GitHub
parent b66076197a
commit 3b8e72b0a1
4 changed files with 117 additions and 0 deletions
+38
View File
@@ -36,6 +36,44 @@ pageClass: routes
<RouteEn author="HenryQW" example="/aptonic/action" path="/aptonic/action/:untested?" :paramsDesc="['Set any value to include untested actions.']"/>
## Bandisoft
### History
<RouteEn author="nczitzk" example="/bandisoft/bandizip" path="/bandisoft/:id?/:lang?" :paramsDesc="['Software id, see below, Bandizip by default', 'Language, see below, English by default']">
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 |
</RouteEn>
## Chocolatey
### Software Update
+38
View File
@@ -54,6 +54,44 @@ pageClass: routes
<Route author="HenryQW" example="/aptonic/action" path="/aptonic/action/:untested?" :paramsDesc="['填写任意值,将会同时包括非官方的 Dropzone 动作']"/>
## Bandisoft
### 更新记录
<Route author="nczitzk" example="/bandisoft/bandizip" path="/bandisoft/:id?/:lang?" :paramsDesc="['软件 id,见下表,默认为 Bandizip', '语言,见下表,默认为英语']">
软件 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 |
</Route>
## Bugly SDK
### 更新日志
+3
View File
@@ -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;
+38
View File
@@ -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,
};
};