Files
RSSHub/lib/v2/bellroy/new-releases.js
T
Evan 7035c394ec feat(route): Bellroy new releases (#12038)
* 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

---------
2023-03-05 20:26:44 +08:00

27 lines
894 B
JavaScript

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,
})),
};
};