summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorunwox <me@unwox.com>2024-10-07 20:19:12 +0600
committerunwox <me@unwox.com>2024-10-08 14:06:42 +0600
commit47af967213c48565adadc68d43fc572159c31ed9 (patch)
tree4b123a8557754fda7b5e3532513acccff56b26b2 /bin
parent0f4599c4df2291fe982a36d5df07983c860b89f9 (diff)
add clubcha parser
Diffstat (limited to 'bin')
-rw-r--r--bin/fetch.fnl2
-rw-r--r--bin/serve.fnl14
2 files changed, 13 insertions, 3 deletions
diff --git a/bin/fetch.fnl b/bin/fetch.fnl
index 5df2849..c51d0f9 100644
--- a/bin/fetch.fnl
+++ b/bin/fetch.fnl
@@ -6,6 +6,7 @@
(local ozchai (require :parser.ozchai))
(local ipuer (require :parser.ipuer))
(local artoftea (require :parser.artoftea))
+(local clubcha (require :parser.clubcha))
(local db (luna.db.open "file:var/db.sqlite?_journal=WAL&_sync=NORMAL"))
(luna.db.exec db "
@@ -71,6 +72,7 @@
FROM products;" [])
(luna.db.commit tx))
+(store-products (clubcha.products))
(store-products (artoftea.products))
(store-products (ipuer.products))
(store-products (ozchai.products))
diff --git a/bin/serve.fnl b/bin/serve.fnl
index 67c3d7d..f98a5ff 100644
--- a/bin/serve.fnl
+++ b/bin/serve.fnl
@@ -37,17 +37,25 @@
(fn site-name-template [name]
(if
(= name "ipuer")
- [:a {:class "site-icon" :href "https://ipuer.ru"}
+ [:a {:class "site-icon" :href "https://ipuer.ru"
+ :alt "Логотип Институт чай пуэр"}
[:img {:src "/static/ipuer.jpg"}]
"Институт чая пуэр"]
(= name "artoftea")
- [:a {:class "site-icon" :href "https://artoftea.ru"}
+ [:a {:class "site-icon" :href "https://artoftea.ru"
+ :alt "Логотип Art of tea"}
[:img {:src "/static/artoftea.png"}]
"Art of tea"]
(= name "ozchai")
- [:a {:class "site-icon" :href "https://ozchai.ru"}
+ [:a {:class "site-icon" :href "https://ozchai.ru"
+ :alt "Логотип #OZCHAI"}
[:img {:src "/static/ozchai.ico"}]
"Чайная #OZCHAI"]
+ (= name "clubcha")
+ [:a {:class "site-icon" :href "https://clubcha.ru"
+ :alt "Логотип Железный Феникс"}
+ [:img {:src "/static/clubcha.png"}]
+ "Железный Феникс"]
""))
(fn item-template [product]