From d3a445ad7270e788812dd16e19a2820fc70a91b6 Mon Sep 17 00:00:00 2001 From: unwox Date: Thu, 12 Dec 2024 13:45:02 +0600 Subject: implement gorkovchay.ru parser --- bin/fetch.fnl | 4 +++- bin/serve.fnl | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/fetch.fnl b/bin/fetch.fnl index 006cbea..0551d76 100644 --- a/bin/fetch.fnl +++ b/bin/fetch.fnl @@ -6,6 +6,7 @@ (local array (require :lib.array)) (local cache (require :lib.cache)) +(local gorkovchay (require :parser.gorkovchay)) (local moychay (require :parser.moychay)) (local ozchai (require :parser.ozchai)) (local ipuer (require :parser.ipuer)) @@ -151,7 +152,8 @@ ;; replace with with-tx (local tx (must (luna.db.begin db))) (must (luna.db.exec-tx tx "DELETE FROM product_tags;" [])) -(each [_ parser (pairs [chaekshop clubcha artoftea ipuer ozchai moychay])] +(each [_ parser (pairs [ozchai gorkovchay chaekshop clubcha artoftea ipuer + moychay])] (store-products tx (parser.products))) (cache.clear-tx tx "page:") (must (luna.db.commit tx)) diff --git a/bin/serve.fnl b/bin/serve.fnl index ea75edd..68dea35 100644 --- a/bin/serve.fnl +++ b/bin/serve.fnl @@ -36,7 +36,7 @@ (tset package :loaded module old)))))) (local db - (must (luna.db.open "file:var/db.sqlite?_journal=WAL&_sync=NORMAL&mode=ro"))) + (must (luna.db.open "file:var/db.sqlite?_journal=WAL&_sync=NORMAL"))) (local query-synonyms { "шэн" "шен" -- cgit v1.2.3