diff options
Diffstat (limited to 'parser/suhexuan.fnl')
| -rw-r--r-- | parser/suhexuan.fnl | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/parser/suhexuan.fnl b/parser/suhexuan.fnl index 8592294..4eeee53 100644 --- a/parser/suhexuan.fnl +++ b/parser/suhexuan.fnl @@ -25,22 +25,23 @@ (local weight (parser.guess-weight product.title ["г"])) (local price (number.string->number product.price)) - {:site "suhexuan" - :url product.url - :title product.title - :description product.text - ;; FIXME: parse all editions into different products - :image (if (< 0 (# gallery)) - (. gallery 1 :img) - "") - :weight weight - :volume (or (parser.guess-volume product.text) - (parser.guess-volume product.title)) - :price price - :price-per (if (and price weight (< 0 weight)) - (/ (math.ceil (* (/ price weight) 10)) 10) - nil) - :characteristics product.characteristics}) + (when (~= product.quantity "0") + {:site "suhexuan" + :url product.url + :title product.title + :description product.text + ;; FIXME: parse all editions into different products + :image (if (< 0 (# gallery)) + (. gallery 1 :img) + "") + :weight weight + :volume (or (parser.guess-volume product.text) + (parser.guess-volume product.title)) + :price price + :price-per (if (and price weight (< 0 weight)) + (/ (math.ceil (* (/ price weight) 10)) 10) + nil) + :characteristics product.characteristics})) (fn products [] (fetcher.from-json |
