1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-01 17:38:37 +00:00

Add the possibility to add rules during feed creation

This commit is contained in:
Frédéric Guillot 2019-11-29 11:17:14 -08:00
parent 8028cc764f
commit 69aa650203
13 changed files with 74 additions and 32 deletions

View file

@ -13,12 +13,14 @@ import (
// SubscriptionForm represents the subscription form.
type SubscriptionForm struct {
URL string
CategoryID int64
Crawler bool
UserAgent string
Username string
Password string
URL string
CategoryID int64
Crawler bool
UserAgent string
Username string
Password string
ScraperRules string
RewriteRules string
}
// Validate makes sure the form values are valid.
@ -38,11 +40,13 @@ func NewSubscriptionForm(r *http.Request) *SubscriptionForm {
}
return &SubscriptionForm{
URL: r.FormValue("url"),
Crawler: r.FormValue("crawler") == "1",
CategoryID: int64(categoryID),
UserAgent: r.FormValue("user_agent"),
Username: r.FormValue("feed_username"),
Password: r.FormValue("feed_password"),
URL: r.FormValue("url"),
Crawler: r.FormValue("crawler") == "1",
CategoryID: int64(categoryID),
UserAgent: r.FormValue("user_agent"),
Username: r.FormValue("feed_username"),
Password: r.FormValue("feed_password"),
ScraperRules: r.FormValue("scraper_rules"),
RewriteRules: r.FormValue("rewrite_rules"),
}
}