Skip to content

Commit

Permalink
feat: add ldlc-italy and fixes ollo/hardware-planet (#2903)
Browse files Browse the repository at this point in the history
Resolves #2867
  • Loading branch information
Martazza authored Feb 1, 2022
1 parent 19afe41 commit d4f4076
Show file tree
Hide file tree
Showing 5 changed files with 111 additions and 10 deletions.
1 change: 1 addition & 0 deletions docs/reference/filter.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ Used with the `STORES` variable.
| Landmark Computers | AU | `landmark-computers`|
| Ldlc | FR | `ldlc`|
| Ldlc | ES | `ldlc-es`|
| Ldlc | IT | `ldlc-it`|
| Mediamarkt | DE | `mediamarkt`|
| Mediamarkt | AT | `mediamarkt-at`|
| Medimax | DE | `medimax`|
Expand Down
34 changes: 25 additions & 9 deletions src/store/model/hardware-planet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const HardwarePlanet: Store = {
text: ['Aggiungi al carrello'],
},
maxPrice: {
container: '.product-price',
container: '..current-price > span',
euroFormat: true,
},
outOfStock: {
Expand All @@ -23,7 +23,7 @@ export const HardwarePlanet: Store = {
brand: 'test:brand',
model: 'test:model',
series: 'test:series',
url: 'https://www.hardware-planet.it/mouse/2929-vendita-mouse-logitech-mouse-m185-optical-swift-grey-910-002238-5099206027282.html',
url: 'https://www.hardware-planet.it/cavi-per-ventole/74819-vendita-cavi-per-ventole-inline-cavo-alimentazione-6x-ventola-3pin-da-1x-3pin-femmina-35mainboard-supporta-6-ventole-offerta-del-mese-33436-4043718149780.html',
},
{
brand: 'amd',
Expand All @@ -46,22 +46,38 @@ export const HardwarePlanet: Store = {
],
linksBuilder: {
builder: getProductLinksBuilder({
productsSelector: '.js-product-miniature-wrapper',
productsSelector: '.horizontal_mode .js-product-miniature',
sitePrefix: 'https://www.hardware-planet.it',
titleSelector: '.product-title > a',
titleSelector: '.product_name > a',
}),
urls: [
{
series: '3060ti',
url: 'https://www.hardware-planet.it/module/iqitsearch/searchiqit?s=rtx+3060',
url: 'https://www.hardware-planet.it/55-schede-video-nvidia?q=Processore+grafico-GeForce+RTX+3060+Ti',
},
{
series: '3070',
url: 'https://www.hardware-planet.it/module/iqitsearch/searchiqit?s=rtx+3070',
series: '3080',
url: 'https://www.hardware-planet.it/55-schede-video-nvidia?q=Processore+grafico-GeForce+RTX+3080',
},
{
series: '3080',
url: 'https://www.hardware-planet.it/module/iqitsearch/searchiqit?s=rtx+3080',
series: '3080ti',
url: 'https://www.hardware-planet.it/55-schede-video-nvidia?q=Processore+grafico-GeForce+RTX+3080+Ti',
},
{
series: '3090',
url: 'https://www.hardware-planet.it/55-schede-video-nvidia?q=Processore+grafico-GeForce+RTX+3090',
},
{
series: 'rx6700xt',
url: 'https://www.hardware-planet.it/54-schede-video-ati-amd?q=Processore+grafico-Radeon+RX+6700+XT',
},
{
series: 'rx6800xt',
url: 'https://www.hardware-planet.it/54-schede-video-ati-amd?q=Processore+grafico-Radeon+RX+6800+XT',
},
{
series: 'rx6900xt',
url: 'https://www.hardware-planet.it/54-schede-video-ati-amd?q=Processore+grafico-Radeon+RX+6900+XT',
},
],
},
Expand Down
2 changes: 2 additions & 0 deletions src/store/model/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ import {JohnLewis} from './johnlewis';
import {Kabum} from './kabum';
import {KomplettNO} from './komplett-no';
import {LandmarkComputers} from './lmc';
import {LDLCItaly} from './ldlc-italy';
import {Mediamarkt} from './mediamarkt';
import {MediamarktAt} from './mediamarkt-at';
import {Medimax} from './medimax';
Expand Down Expand Up @@ -262,6 +263,7 @@ export const storeList = new Map([
[Kabum.name, Kabum],
[KomplettNO.name, KomplettNO],
[LandmarkComputers.name, LandmarkComputers],
[LDLCItaly.name, LDLCItaly],
[Mediamarkt.name, Mediamarkt],
[MediamarktAt.name, MediamarktAt],
[Medimax.name, Medimax],
Expand Down
82 changes: 82 additions & 0 deletions src/store/model/ldlc-italy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
import {Store} from './store';
import {getProductLinksBuilder} from './helpers/card';

export const LDLCItaly: Store = {
currency: '€',
labels: {
inStock: {
container: '.stock',
text: ['Disponibile'],
},
maxPrice: {
container: '.price',
euroFormat: true,
},
outOfStock: {
container: '.stock',
text: ['Rottura'],
},
},
links: [
{
brand: 'test:brand',
model: 'test:model',
series: 'test:series',
url: 'https://www.ldlc.com/it-it/scheda/PB00098129.html',
},
{
brand: 'microsoft',
model: 'xbox series x',
series: 'xboxsx',
url: 'https://www.ldlc.com/it-it/scheda/PB00390450.html',
},
{
brand: 'microsoft',
model: 'xbox series s',
series: 'xboxss',
url: 'https://www.ldlc.com/it-it/scheda/PB00390458.html',
},
],
linksBuilder: {
builder: getProductLinksBuilder({
productsSelector: '.pdt-item',
sitePrefix: 'https://www.ldlc.com',
titleSelector: '.title-3 > a[href]',
}),
urls: [
{
series: '3060',
url: 'https://www.ldlc.com/it-it/informatica/componenti/scheda-video/c4684/+fv1026-5801+fv121-19509.html',
},
{
series: '3060ti',
url: 'https://www.ldlc.com/it-it/informatica/componenti/scheda-video/c4684/+fv1026-5801+fv121-19365.html',
},
{
series: '3070',
url: 'https://www.ldlc.com/it-it/informatica/componenti/scheda-video/c4684/+fv1026-5801+fv121-19184.html',
},
{
series: '3080',
url: 'https://www.ldlc.com/it-it/informatica/componenti/scheda-video/c4684/+fv1026-5801+fv121-19183.html',
},
{
series: '3090',
url: 'https://www.ldlc.com/it-it/informatica/componenti/scheda-video/c4684/+fv1026-5801+fv121-19185.html',
},
{
series: 'rx6800',
url: 'https://www.ldlc.com/it-it/informatica/componenti/scheda-video/c4684/+fv1026-5800+fv121-19339.html',
},
{
series: 'rx6800xt',
url: 'https://www.ldlc.com/it-it/informatica/componenti/scheda-video/c4684/+fv1026-5800+fv121-19340.html',
},
{
series: 'rx6900xt',
url: 'https://www.ldlc.com/it-it/informatica/componenti/scheda-video/c4684/+fv1026-5800+fv121-19367.html',
},
],
},
name: 'ldlc-italy',
};
2 changes: 1 addition & 1 deletion src/store/model/ollo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const Ollo: Store = {
brand: 'test:brand',
model: 'test:model',
series: 'test:series',
url: 'https://www.ollo.it/apple-airpods-2nd-generation-bluetooth-stereofonico-bianco/p_759688',
url: 'https://www.ollo.it/trevi-dr-437-sa-lettore-mp3-8-gb-grigio/p_811410',
},
{
brand: 'gainward',
Expand Down

0 comments on commit d4f4076

Please sign in to comment.