sikkom: tags

This commit is contained in:
Peter Kleiweg
2026-07-24 14:58:33 +02:00
parent 16843570e2
commit 1de42635d0
3 changed files with 58 additions and 9 deletions

View File

@@ -27,13 +27,14 @@ type Rss struct {
}
type ItemT struct {
Title string `xml:"title"`
PubDate string `xml:"pubDate"`
UnixTime int64 `xml:"unixTime"`
Guid string `xml:"guid"`
Link string `xml:"https://www.rssboard.org/rss-specification link"` // i.p.v. atom:link
Premium bool `xml:"premium"`
Data []byte `xml:",innerxml"`
Title string `xml:"title"`
PubDate string `xml:"pubDate"`
UnixTime int64 `xml:"unixTime"`
Guid string `xml:"guid"`
Link string `xml:"https://www.rssboard.org/rss-specification link"` // i.p.v. atom:link
Premium bool `xml:"premium"`
Tags []string `xml:"category"`
Data []byte `xml:",innerxml"`
}
type LdJson struct {
@@ -143,12 +144,12 @@ func main() {
p(fp.WriteString("</item>\n"))
p(fp.Close())
p(os.Chtimes(filename+".xml", t, t))
ok = doArticle(filename, item.Link, item.Title, t, needUpdate)
ok = doArticle(filename, item.Link, item.Title, item.Tags, t, needUpdate)
}()
}
}
func doArticle(filename string, url string, title string, timestamp time.Time, needUpdate bool) bool {
func doArticle(filename string, url string, title string, tags []string, timestamp time.Time, needUpdate bool) bool {
if exists(filename + ".skip") {
return true
}
@@ -295,6 +296,19 @@ func doArticle(filename string, url string, title string, timestamp time.Time, n
fp, err := os.Create(filename + ".txt")
p(err)
found = false
for _, tag := range tags {
if tag == "Actueel" || tag == "Nieuws" {
continue
}
p(fmt.Fprintln(fp, "##META text tag =", tag))
found = true
}
if !found {
p(fp.WriteString("##META text tag =\n"))
}
for _, t := range text {
p(fp.WriteString(u.AddEnd(u.FixSpace(t))))
}