From ddc11ff1cc31f17ff46523a649917940357825b5 Mon Sep 17 00:00:00 2001 From: unwox Date: Wed, 9 Oct 2024 10:49:36 +0600 Subject: small fixes in parsers --- parser/artoftea.fnl | 8 ++++---- parser/chaekshop.fnl | 4 ++-- parser/clubcha.fnl | 1 - parser/parser.fnl | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) (limited to 'parser') diff --git a/parser/artoftea.fnl b/parser/artoftea.fnl index b1a8c72..1b8b6e1 100644 --- a/parser/artoftea.fnl +++ b/parser/artoftea.fnl @@ -30,10 +30,10 @@ (parser.tag :option {:value "*" :selected "selected"} (* (peg.Cg parser.pegs.number :weight) (+ (peg.P "г") " гр") parser.pegs.spaces))) - (parser.anywhere - (parser.tag :p {:class "price"} - (parser.tag :span {:id "*"} - (peg.Cg (parser.till "") :price))))) + (parser.anywhere + (parser.tag :p {:class "price"} + (parser.tag :span {:id "*"} + (peg.Cg (parser.till "") :price))))) (parser.anywhere (parser.tag :p {:class "price"} (parser.tag :span {:id "*"} diff --git a/parser/chaekshop.fnl b/parser/chaekshop.fnl index b1e4b4e..b6e012a 100644 --- a/parser/chaekshop.fnl +++ b/parser/chaekshop.fnl @@ -38,9 +38,9 @@ (parser.guess-weight product.title))) (local price (number.string->number (string.gsub product.price "," "."))) {:site "chaekshop" - :id (.. "https://chaekshop.ru/" product.url) + :id (.. "https://chaekshop.ru" product.url) :title product.title - :url (.. "https://chaekshop.ru/" product.url) + :url (.. "https://chaekshop.ru" product.url) :description "" :image (.. "https://chaekshop.ru" product.image) :year (parser.guess-year product.title) diff --git a/parser/clubcha.fnl b/parser/clubcha.fnl index c935236..e260fd1 100644 --- a/parser/clubcha.fnl +++ b/parser/clubcha.fnl @@ -90,7 +90,6 @@ ;; does not contain all the products {:path "gaivan" :category "Посуда"} {:path "chashka" :category "Посуда"} - {:path "chashka" :category "Посуда"} {:path "chaynyi-nabor" :category "Посуда"} {:path "chaynik" :category "Посуда"} {:path "glina-farfor" :category "Посуда"} diff --git a/parser/parser.fnl b/parser/parser.fnl index c9c6b69..d5baafa 100644 --- a/parser/parser.fnl +++ b/parser/parser.fnl @@ -129,7 +129,7 @@ (: (anywhere (* (peg.C (^ (peg.R "09") 4)) (maybe " ") - (- "г" (peg.P "гр")))) + (- (+ (peg.P "г") "год") (peg.P "гр")))) :match title))) (fn guess-weight [title] -- cgit v1.2.3