Skip to content

Commit

Permalink
feat(route): Bellroy new releases (DIYgod#12038)
Browse files Browse the repository at this point in the history
* feat(route): bellroy new releases

* feat: add rader file

* fix: RouteEn

* fix: radar source

`https://bellroy.com/new-releases` does not exist
`https://bellroy.com/collection/new-releases` does

---------
  • Loading branch information
EthanWng97 authored Mar 5, 2023
1 parent d00d13a commit 7035c39
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 16 deletions.
38 changes: 22 additions & 16 deletions docs/en/shopping.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ Parameter `time` only works when `mostwanted` is chosen as the category.

</RouteEn>

## Bellroy

### New Releases

<RouteEn author="NavePnow" example="/bellroy/new-releases" path="/bellroy/new-releases" />

## booth.pm

### Shop
Expand Down Expand Up @@ -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 | 中文 |

</RouteEn>

Expand Down
6 changes: 6 additions & 0 deletions docs/shopping.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ pageClass: routes

</Route>

## Bellroy

### 新发布

<Route author="NavePnow" example="/bellroy/new-releases" path="/bellroy/new-releases" />

## booth.pm

### 店铺
Expand Down
3 changes: 3 additions & 0 deletions lib/v2/bellroy/maintainer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
'/new-releases': ['NavePnow'],
};
26 changes: 26 additions & 0 deletions lib/v2/bellroy/new-releases.js
Original file line number Diff line number Diff line change
@@ -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,
})),
};
};
13 changes: 13 additions & 0 deletions lib/v2/bellroy/radar.js
Original file line number Diff line number Diff line change
@@ -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',
},
],
},
};
3 changes: 3 additions & 0 deletions lib/v2/bellroy/router.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = function (router) {
router.get('/new-releases', require('./new-releases'));
};

0 comments on commit 7035c39

Please sign in to comment.