Explorar o código

Add scraper rules for version2.dk and ing.dk

Frédéric Guillot %!s(int64=8) %!d(string=hai) anos
pai
achega
c454f67037
Modificáronse 2 ficheiros con 3 adicións e 1 borrados
  1. 1 1
      http/client.go
  2. 2 0
      reader/scraper/rules.go

+ 1 - 1
http/client.go

@@ -129,7 +129,7 @@ func (c *Client) buildClient() http.Client {
 func (c *Client) buildHeaders() http.Header {
 	headers := make(http.Header)
 	headers.Add("User-Agent", userAgent)
-	headers.Add("Accept", "text/html,application/xhtml+xml,application/xml,application/json,image/*")
+	headers.Add("Accept", "*/*")
 
 	if c.etagHeader != "" {
 		headers.Add("If-None-Match", c.etagHeader)

+ 2 - 0
reader/scraper/rules.go

@@ -10,6 +10,7 @@ var predefinedRules = map[string]string{
 	"cbc.ca":            ".story-content",
 	"github.com":        "article.entry-content",
 	"igen.fr":           "section.corps",
+	"ing.dk":            "section.body",
 	"lapresse.ca":       ".amorce, .entry",
 	"lemonde.fr":        "div#articleBody",
 	"lesjoiesducode.fr": ".blog-post-content img",
@@ -20,5 +21,6 @@ var predefinedRules = map[string]string{
 	"phoronix.com":      "div.content",
 	"techcrunch.com":    "div.article-entry",
 	"theregister.co.uk": "#body",
+	"version2.dk":       "section.body",
 	"wired.com":         "main figure, article",
 }