summaryrefslogtreecommitdiff
path: root/parser
diff options
context:
space:
mode:
Diffstat (limited to 'parser')
-rw-r--r--parser/artoftea.fnl8
-rw-r--r--parser/chaekshop.fnl4
-rw-r--r--parser/clubcha.fnl1
-rw-r--r--parser/parser.fnl2
4 files changed, 7 insertions, 8 deletions
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 "</span>") :price)))))
+ (parser.anywhere
+ (parser.tag :p {:class "price"}
+ (parser.tag :span {:id "*"}
+ (peg.Cg (parser.till "</span>") :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]