From 2b7c578a3489435dfb55778de06a46c04d66f14b Mon Sep 17 00:00:00 2001 From: Aaron Fischer Date: Mon, 11 Mar 2024 22:10:46 +0100 Subject: [PATCH] fix regex to parse new URLs --- src/bdm.go | 2 +- templates/book.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bdm.go b/src/bdm.go index f1c3c7e..194e865 100644 --- a/src/bdm.go +++ b/src/bdm.go @@ -87,7 +87,7 @@ func getItems(filename string) []Item { currentYear := "" currentMonth := 0 - re := regexp.MustCompile(`^[^[]+ \[(?P[^"]+)"(?P[^"]+)"]\([^=]+=(?P<isbn>[0-9]+).*$`) + re := regexp.MustCompile(`^[^[]+ \[(?P<author>[^"]+)"(?P<title>[^"]+)"]\(.+buchhandel\.de\/buch\/(?P<isbn>[0-9]+).*$`) yearRe := regexp.MustCompile(`^## (?P<year>20[0-9]{2})$`) var yearBucket []Item diff --git a/templates/book.html b/templates/book.html index b61a4a1..845fc32 100644 --- a/templates/book.html +++ b/templates/book.html @@ -24,7 +24,7 @@ <div id="covers"> {{ range .Items }} <div class="cover-item"> - <a target="_blank" href="https://www.buchhandel.de/buch/{{ .ISBN }}"><img src="/covers/{{ .ISBN }}.jpg" alt="{{ .Author | html }} - {{ .Title | html }}" title="zu yourbook.shop" /></a> + <a target="_blank" href="https://www.buchhandel.de/buch/{{ .ISBN }}"><img src="/covers/{{ .ISBN }}.jpg" alt="{{ .Author | html }} - {{ .Title | html }}" title="zu buchhandel.de" /></a> </div> {{ end }} </div>