Dedect Unimarkt Bio Products

should dedect about 99% of unimarkt bio products
This commit is contained in:
Markus Tiefenbacher 2023-05-29 09:55:51 +02:00
parent 1fa31bdf7c
commit 7012e246fd

View File

@ -8,6 +8,7 @@ exports.getCanonical = function (item, today) {
price: item.price,
priceHistory: [{ date: today, price: item.price }],
unit: item.unit,
bio: item.name.toLowerCase().includes('bio'),
url: `https://shop.unimarkt.at${item.canonicalUrl}`,
};
};
@ -28,7 +29,7 @@ exports.fetchData = async function () {
for (let category of UNIMARKT_MAIN_CATEGORIES) {
var res = await axios.get(UNIMARKT_BASE_URL + category, {
validateStatus: function (status) {
return (status >= 200 && status < 300) || status == 429;
return (status >= 200 && status < 300);
},
});