Generic attributes (#120)

* fix #117: use a generic attribute parser, still support fixed attrs
This commit is contained in:
T.v.Dein
2025-02-10 18:20:54 +01:00
committed by GitHub
parent 09948a6b39
commit 46be48af38
8 changed files with 118 additions and 45 deletions

View File

@@ -34,11 +34,19 @@ import (
)
const (
VERSION string = "0.3.15"
VERSION string = "0.3.16"
Baseuri string = "https://www.kleinanzeigen.de"
Listuri string = "/s-bestandsliste.html"
Defaultdir string = "."
/*
Also possible: loop through .Attributes:
DefaultTemplate string = "Title: {{.Title}}\nPrice: {{.Price}}\nId: {{.ID}}\n" +
"Category: {{.Category}}\n{{ range $key,$val := .Attributes }}{{ $key }}: {{ $val }}\n{{ end }}" +
"Created: {{.Created}}\nExpire: {{.Expire}}\n\n{{.Text}}\n"
*/
DefaultTemplate string = "Title: {{.Title}}\nPrice: {{.Price}}\nId: {{.ID}}\n" +
"Category: {{.Category}}\nCondition: {{.Condition}}\nType: {{.Type}}\nColor: {{.Color}}\n" +
"Created: {{.Created}}\nExpire: {{.Expire}}\n\n{{.Text}}\n"