Documentation
¶
Index ¶
- func ConvertToUTF8(str string, origEncoding string) string
- func HumanTimeParse(d string) time.Time
- func TimeParse(layout, dateStr string) time.Time
- type Author
- type Document
- type Enclosure
- type Feed
- type Filters
- type FindOnPage
- type Item
- type Link
- type ParseResult
- type Selection
- type Site2RSS
- func (s *Site2RSS) AbsoluteURL(rpath string) string
- func (s *Site2RSS) FilterItems(filters Filters) *Site2RSS
- func (s *Site2RSS) GetAtom() (string, error)
- func (s *Site2RSS) GetItemsFromLinks(f itemCallback) *Site2RSS
- func (s *Site2RSS) GetItemsFromQuery(docPattern string, f queryCallback) *Site2RSS
- func (s *Site2RSS) GetItemsFromSourcePage(f pageCallback) *Site2RSS
- func (s *Site2RSS) GetLinks(linkPattern string) *Site2RSS
- func (s *Site2RSS) GetRSS() (string, error)
- func (s *Site2RSS) MakeAllLinksAbsolute(doc *Document)
- func (s *Site2RSS) SetMaxFeedItems(max int) *Site2RSS
- func (s *Site2RSS) SetParseOptions(opts *FindOnPage) *Site2RSS
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertToUTF8 ¶
ConvertToUTF8 string from any encoding
Types ¶
type Filters ¶
type Filters struct {
// Skip item with the following words in the description
Description []string
// Remove the following selectors from content
Selector []string
// Remove blocks of text that contain the following words
Text []string
// Skip items with the following words in the title
Title []string
}
Filters for item cleaning
type FindOnPage ¶
type FindOnPage struct {
Author string
Date string
DateFormat string
Description string
Image string
Title string
URL string
}
FindOnPage settings for parse page to feed item
type Item ¶
Item proxy type
func ParseItem ¶
func ParseItem(doc *Document, opts *FindOnPage) *Item
ParseItem is default function for parsing items from remote page
func ParseQuery ¶
func ParseQuery(sel *Selection, opts *FindOnPage) *Item
ParseQuery is default function for parsing items from a query by single page
type ParseResult ¶
type ParseResult struct {
Authors []string
Dates []string
Descriptions []string
Images []string
Titles []string
}
ParseResult return results of parsing single page
func ParsePage ¶
func ParsePage(doc *Document, opts *FindOnPage) *ParseResult
ParsePage is default function for parsing items from single page
type Site2RSS ¶
type Site2RSS struct {
Feed *Feed
Links []string
MaxFeedItems int
SourceURL *url.URL
// contains filtered or unexported fields
}
Site2RSS object
func (*Site2RSS) AbsoluteURL ¶
AbsoluteURL makes the relative URL absolute
func (*Site2RSS) FilterItems ¶
FilterItems for clean items
func (*Site2RSS) GetItemsFromLinks ¶
GetItemsFromLinks extracts details from remote links using a user-defined function
func (*Site2RSS) GetItemsFromQuery ¶
GetItemsFromQuery extracts feed items from a query by source page
func (*Site2RSS) GetItemsFromSourcePage ¶
GetItemsFromSourcePage extracts feed items from source page
func (*Site2RSS) MakeAllLinksAbsolute ¶
MakeAllLinksAbsolute makes all links absolute in document
func (*Site2RSS) SetMaxFeedItems ¶
SetMaxFeedItems set max feed items
func (*Site2RSS) SetParseOptions ¶
func (s *Site2RSS) SetParseOptions(opts *FindOnPage) *Site2RSS
SetParseOptions for parse page