Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SaveStates ¶
SaveStates writes current states to io.Writer.
func SaveStatesFile ¶
SaveStatesFile save current states into JSON file.
Types ¶
type Crawler ¶
type Crawler struct { Subscriptions []Subscription States States NumWorkers int Parser *gofeed.Parser }
Crawler is a crawler for RSS and Atom feeds.
type EnhancedAtomTranslator ¶
type EnhancedAtomTranslator struct {
// contains filtered or unexported fields
}
func NewEnhancedAtomTranslator ¶
func NewEnhancedAtomTranslator() *EnhancedAtomTranslator
type Feed ¶
type Feed struct { ID string `toml:"id"` URI string `toml:"uri"` TitleFilter string `toml:"title_filter,omitempty"` DescriptionFilter string `toml:"description_filter,omitempty"` ContentFilter string `toml:"content_filter,omitempty"` AuthorFilter string `toml:"author_filter,omitempty"` CategoryFilter string `toml:"category_filter,omitempty"` }
Feed is a feed configuration to be subscribed.
func LoadFeedsFile ¶
LoadFeedsFile loads feeds from file.
func (*Feed) Subscription ¶
func (f *Feed) Subscription() (Subscription, error)
Subscription returns a Subscription.
type Result ¶
type Result struct { Subscription Subscription Feed *gofeed.Feed NewItems []*gofeed.Item Err error }
Result is a result of a feed crawling.
type SimpleSubscription ¶
type SimpleSubscription struct { FeedID FeedID FeedURI string TitleFilter *regexp.Regexp DescriptionFilter *regexp.Regexp ContentFilter *regexp.Regexp AuthorFilter *regexp.Regexp CategoryFilter *regexp.Regexp FilterFunc func(*gofeed.Item) bool }
SimpleSubscription is a feed configuration to be subscribed.
func (*SimpleSubscription) Filter ¶
func (s *SimpleSubscription) Filter(item *gofeed.Item) bool
Filter returns true if the item is acceptable.
func (*SimpleSubscription) URI ¶
func (s *SimpleSubscription) URI() string
URI returns the feed URI.
type State ¶
type State struct { CrawledAt time.Time `json:"crawled_at,omitempty"` UpdatedAt time.Time `json:"updated_at,omitempty"` }
State is feed's crawling state.
type States ¶
States is a list of State.
func LoadStates ¶
LoadStates loads states from io.Reader.
func LoadStatesFile ¶
LoadStatesFile loads states from JSON file.
func (States) UpdateState ¶
UpdateState updates states by the result.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.