Přechody mezi stavy Pizza Day
This commit is contained in:
@@ -5,6 +5,7 @@ import fs from 'fs';
|
||||
import axios from 'axios';
|
||||
|
||||
type PizzaSize = {
|
||||
varId: number,
|
||||
size: string,
|
||||
pizzaPrice: number,
|
||||
boxPrice: number,
|
||||
@@ -67,9 +68,10 @@ const downloadPizzy = async () => {
|
||||
const sizes: PizzaSize[] = [];
|
||||
const a = $('.varianty > li > a', pizzaHtml);
|
||||
a.each((i, elm) => {
|
||||
const varId = Number.parseInt(elm.attribs.href.split('?varianta=')[1].trim());
|
||||
const size = $($(elm).contents().get(0)).text().trim();
|
||||
const price = Number.parseInt($($(elm).contents().get(1)).text().trim().split(" Kč")[0]);
|
||||
sizes.push({ size: size, pizzaPrice: price, boxPrice: boxPrices[size], price: price + boxPrices[size] });
|
||||
sizes.push({ varId, size, pizzaPrice: price, boxPrice: boxPrices[size], price: price + boxPrices[size] });
|
||||
})
|
||||
result.push({
|
||||
name: name,
|
||||
|
||||
Reference in New Issue
Block a user