diff options
| author | unwox <me@unwox.com> | 2025-03-05 23:27:59 +0600 |
|---|---|---|
| committer | unwox <me@unwox.com> | 2025-03-05 23:27:59 +0600 |
| commit | e7200ff8c6d745ed1e17e865932ea973dd71db41 (patch) | |
| tree | ad5a07c52b3ff5c37c61c3e980908d0bbaf9f48d /parser | |
| parent | 3a162d92d34c0396ddbca64444b8c2044cc88df9 (diff) | |
small improvements
Diffstat (limited to 'parser')
| -rw-r--r-- | parser/kolokolnikovchai.fnl | 15 | ||||
| -rw-r--r-- | parser/ozchai.fnl | 3 | ||||
| -rw-r--r-- | parser/tea108.fnl | 4 |
3 files changed, 11 insertions, 11 deletions
diff --git a/parser/kolokolnikovchai.fnl b/parser/kolokolnikovchai.fnl index cc5d723..acf52c5 100644 --- a/parser/kolokolnikovchai.fnl +++ b/parser/kolokolnikovchai.fnl @@ -65,14 +65,13 @@ {:path "990406163191" :tags ["Зеленый чай"]} {:path "451142994821" :tags ["Улун"]} {:path "770906787081" :tags ["Габа"]} - {:path "909586139961" :tags ["Посуда"]} ;; чайники - {:path "351075619951" :tags ["Посуда"]} ;; гайвани - {:path "874916565001" :tags ["Посуда"]} ;; пиалы - {:path "927453990401" :tags ["Посуда"]} ;; чахаи - {:path "242398612931" :tags ["Посуда"]} ;; чайные доски - {:path "208270710991" :tags ["Посуда"]} ;; чайные аксессуары - {:path "542771614531" :tags ["Посуда"]} ;; заварники - ] + {:path "909586139961" :tags ["Посуда" "Чайник"]} + {:path "351075619951" :tags ["Посуда" "Гайвань"]} + {:path "874916565001" :tags ["Посуда" "Пиала"]} + {:path "927453990401" :tags ["Посуда" "Чахай"]} + {:path "242398612931" :tags ["Посуда" "Чабань"]} + {:path "208270710991" :tags ["Посуда" "Аксессуар"]} + {:path "542771614531" :tags ["Посуда" "Заварник"]}] format-url destruct-response normalize)) diff --git a/parser/ozchai.fnl b/parser/ozchai.fnl index 1d4c4f3..e59ddf0 100644 --- a/parser/ozchai.fnl +++ b/parser/ozchai.fnl @@ -22,7 +22,8 @@ (fn normalize [product] (local gallery (json.decode product.gallery)) - (local weight (number.string->number (. product.editions 1 :Вес))) + (local weight (or (parser.guess-weight (. product.editions 1 :Вес)) + (number.string->number (. product.editions 1 :Вес)))) (local price (number.string->number (. product.editions 1 :price))) (var volume nil) (each [_ c (ipairs product.characteristics)] diff --git a/parser/tea108.fnl b/parser/tea108.fnl index 2fd013f..6a61f34 100644 --- a/parser/tea108.fnl +++ b/parser/tea108.fnl @@ -46,8 +46,8 @@ :volume (parser.guess-volume product.title) :category product.category :price-per (if (and price weight (< 0 weight)) - (/ (math.ceil (* (/ price weight) 10)) 10) - nil)}) + (/ (math.ceil (* (/ price weight) 10)) 10) + nil)}) (fn products [] (fetcher.from-html |
