1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-26 18:21:01 +00:00

Add scraper rules

This commit is contained in:
Frédéric Guillot 2017-12-10 20:51:04 -08:00
parent 7a35c58f53
commit 87ccad5c7f
16 changed files with 140 additions and 34 deletions

View file

@ -40,18 +40,14 @@ func (c *Controller) FetchContent(ctx *core.Context, request *core.Request, resp
return
}
content, err := scraper.Fetch(entry.URL)
content, err := scraper.Fetch(entry.URL, entry.Feed.ScraperRules)
if err != nil {
response.JSON().ServerError(err)
return
}
if len(content) > len(entry.Content) {
entry.Content = content
c.store.UpdateEntryContent(entry)
} else {
content = entry.Content
}
entry.Content = content
c.store.UpdateEntryContent(entry)
response.JSON().Created(map[string]string{"content": content})
}