diff --git a/docs/en/shopping.md b/docs/en/shopping.md index ff10fa365..248a787ba 100644 --- a/docs/en/shopping.md +++ b/docs/en/shopping.md @@ -36,6 +36,12 @@ Parameter `time` only works when `mostwanted` is chosen as the category. +## Bellroy + +### New Releases + + + ## booth.pm ### Shop @@ -129,22 +135,22 @@ Category Language -| Id | Language | -| -- | ---------- | -| | en | -| de | Deutsch | -| es | Español | -| fi | Suomeksi | -| fr | Français | -| it | Italiano | -| ja | 日本語 | -| nl | Nederlands | -| no | Norsk | -| pl | Polski | -| pt | Português | -| ru | Русский | -| sv | Svenska | -| zh | 中文 | +| Id | Language | +| --- | ---------- | +| | en | +| de | Deutsch | +| es | Español | +| fi | Suomeksi | +| fr | Français | +| it | Italiano | +| ja | 日本語 | +| nl | Nederlands | +| no | Norsk | +| pl | Polski | +| pt | Português | +| ru | Русский | +| sv | Svenska | +| zh | 中文 | diff --git a/docs/shopping.md b/docs/shopping.md index 64f21d2fa..2cb24e10d 100644 --- a/docs/shopping.md +++ b/docs/shopping.md @@ -48,6 +48,12 @@ pageClass: routes +## Bellroy + +### 新发布 + + + ## booth.pm ### 店铺 diff --git a/lib/v2/bellroy/maintainer.js b/lib/v2/bellroy/maintainer.js new file mode 100644 index 000000000..844916e7c --- /dev/null +++ b/lib/v2/bellroy/maintainer.js @@ -0,0 +1,3 @@ +module.exports = { + '/new-releases': ['NavePnow'], +}; diff --git a/lib/v2/bellroy/new-releases.js b/lib/v2/bellroy/new-releases.js new file mode 100644 index 000000000..1a459e8bd --- /dev/null +++ b/lib/v2/bellroy/new-releases.js @@ -0,0 +1,26 @@ +const got = require('@/utils/got'); + +module.exports = async (ctx) => { + const host = 'https://bellroy.com'; + const url = 'https://production.products.boobook-services.com/products'; + const response = await got({ + method: 'get', + url, + searchParams: { + currency_identifier: '1abe985632a1392e6a94b885fe193d5943b7c213', + price_group: 'bellroy.com', + 'filter[dimensions][web_new_release]': 'new_style', + }, + }); + const data = response.data.products; + + ctx.state.data = { + title: 'Bellroy - New Releases', + link: 'https://bellroy.com/collection/new-releases', + description: 'Bellroy - New Releases', + item: data.map((item) => ({ + title: item.attributes.name + ' - ' + item.attributes.dimensions.color, + link: host + item.attributes.canonical_uri, + })), + }; +}; diff --git a/lib/v2/bellroy/radar.js b/lib/v2/bellroy/radar.js new file mode 100644 index 000000000..218813888 --- /dev/null +++ b/lib/v2/bellroy/radar.js @@ -0,0 +1,13 @@ +module.exports = { + 'bellroy.com': { + _name: 'Bellroy', + '.': [ + { + title: '新发布', + docs: 'https://docs.rsshub.app/shopping.html#bellroy', + source: ['/collection/new-releases', '/'], + target: '/bellroy/new-releases', + }, + ], + }, +}; diff --git a/lib/v2/bellroy/router.js b/lib/v2/bellroy/router.js new file mode 100644 index 000000000..82ed7d7bb --- /dev/null +++ b/lib/v2/bellroy/router.js @@ -0,0 +1,3 @@ +module.exports = function (router) { + router.get('/new-releases', require('./new-releases')); +};