remove author column from articles

This commit is contained in:
2025-01-07 11:59:10 +01:00
parent b16ebb9572
commit ce10e1e62b
4 changed files with 74 additions and 57 deletions

View File

@@ -59,7 +59,7 @@ func (c *Collector) ExtractSpiegel(url string, body []byte) error {
whitespace := regexp.MustCompile(`\s+`)
var exists bool
var pagetype, title, content, datestr, author string
var pagetype, title, content, datestr string
var tag *goquery.Selection
var date time.Time
@@ -113,13 +113,6 @@ func (c *Collector) ExtractSpiegel(url string, body []byte) error {
return err
}
// get author
tag = doc.Find("meta[name='author']")
author, exists = tag.Attr("content")
if !exists {
return errors.New("unable to extract article, no author tag")
}
// get content
tag = doc.Find("main[id='Inhalt'] div > p")
@@ -139,7 +132,6 @@ func (c *Collector) ExtractSpiegel(url string, body []byte) error {
FetchDate: time.Now(),
Title: title,
Content: content,
Author: author,
}
err = c.Articles.Insert(&article)