Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // UserAgent is the string which the `User-Agent` request header will be set to for underlying requests to fetch // feeds and content. UserAgent = config.AppName + "/" + config.Version + " (+https://foragd.app/policies/bot)" // DefaultHTTPRequestTimeout is the maximum time allowed for a background HTTP request to execute. DefaultHTTPRequestTimeout = 45 * time.Second // DefaultRequestRetries is the default number of retries for API requests. DefaultRequestRetries = 3 )
Functions ¶
func ExtractMainContent ¶ added in v0.111.0
ExtractMainContent extracts the main content from the page at the given URL, using the readability package.
Types ¶
type HeadReader ¶
type HeadReader struct {
// contains filtered or unexported fields
}
HeadReader wraps a reader and stops after the </head> tag or a byte limit. This avoids downloading the entire page body.
func NewHeadReader ¶
func NewHeadReader(r io.Reader, maxBytes int) *HeadReader
Click to show internal directories.
Click to hide internal directories.