Skip to content

Commit

Permalink
Merge branch 'release/3.0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
allohamora committed Feb 28, 2022
2 parents 916dd6d + 131f72a commit da20f75
Show file tree
Hide file tree
Showing 5 changed files with 487 additions and 88 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [3.0.2](https://github.com/Allohamora/chepi-back/compare/v3.0.1...v3.0.2) (2022-02-28)

### Features

- **pizzas.json:** update pizzas.json ([ec03f97](https://github.com/Allohamora/chepi-back/commits/ec03f979ca38a6e76ea90d8396a64e704ccb869e))

### Bug Fixes

- **pizza-parser:** fix invalid pizza-it image ([b756670](https://github.com/Allohamora/chepi-back/commits/b756670b64fae6d7667f66befd67bbfdcab96aba))

### [3.0.1](https://github.com/Allohamora/chepi-back/compare/v3.0.0...v3.0.1) (2022-02-28)

### Features
Expand Down
13 changes: 11 additions & 2 deletions libs/pizza-parser/ukraine/chernivtsi/pizza-it/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ const BASE_URL = 'https://pizza-it.com/';
const PAGE_URL = join(BASE_URL, '/famiglia-grande');
const WHITELIST = [/^піца/];

interface GalleryItem {
src: string;
thumb: string;
subHtml: string;
}

type Gallery = GalleryItem[];

export class PizzaIt extends ChernivtsiPizzasParser {
private async getPageHtml(pageLink = PAGE_URL) {
return await getText(pageLink);
Expand Down Expand Up @@ -56,9 +64,10 @@ export class PizzaIt extends ChernivtsiPizzasParser {
}

private getImage($: CheerioAPI) {
const imageSrc = $('.product-img > img').attr('src');
const galleryJson = $('.lightgallery.lightgallery-product-images').attr('data-images');
const gallery = JSON.parse(galleryJson) as Gallery;

return join(BASE_URL, imageSrc);
return gallery[0].src;
}

private getPricesAndSizes($: CheerioAPI, basePrice: number) {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "chepi-back",
"version": "3.0.1",
"version": "3.0.2",
"description": "Backend for chepi",
"author": "https://github.com/Allohamora",
"license": "MIT",
Expand Down
Loading

0 comments on commit da20f75

Please sign in to comment.