From 0ea9ddc67a4e771c57189b9bec721dd30df5f315 Mon Sep 17 00:00:00 2001 From: unwox Date: Fri, 27 Sep 2024 16:48:20 +0600 Subject: refactor json fetcher a bit --- parser/artoftea.fnl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'parser/artoftea.fnl') diff --git a/parser/artoftea.fnl b/parser/artoftea.fnl index 1f03ed1..205d5d0 100644 --- a/parser/artoftea.fnl +++ b/parser/artoftea.fnl @@ -8,7 +8,7 @@ (local number (require :lib.number)) (local fetcher (require :fetcher)) -(fn url-formatter [path page] +(fn format-url [path page] (.. "https://artoftea.ru/" path "/?page=" page)) (local product-peg @@ -50,6 +50,7 @@ (local price (number.string->number product.price)) {:site "artoftea" :id product.id + :title product.title :url product.url :description product.description :image product.image @@ -64,7 +65,7 @@ (fetcher.from-html [{:path "redtea" :category "Красный чай"} {:path "greentea" :category "Зеленый чай"}] - url-formatter + format-url product-peg normalize)) -- cgit v1.2.3