feedwatcher

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 28, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorMarkdownTemplate = `**[{{.Subscription.ID}}]({{.Subscription.URI}})**

` + "```" + `
{{.Err.Error}}
` + "```"
View Source
var NewItemsMarkdownTemplate = `**[{{.Feed.Title}}]({{.Feed.Link}})**

{{range .NewItems -}}
- [{{.Title}}]({{.Link}})
{{end}}`

Functions

func NewFeedJob

func NewFeedJob(schedule string, config *Config) (rocketbot.CronJob, error)

NewFeedJob creates feed watcher job.

Types

type Config

type Config struct {
	FeedsFile  string `toml:"feeds_file"`
	StatesFile string `toml:"states_file,omitempty"`
	NumWorkers int    `toml:"workers"`
	Channel    string `toml:"channel,omitempty"`
	Title      string `toml:"title,omitempty"`
}

type FeedJob

type FeedJob struct {
	Schedule string
	Config   *Config
	// contains filtered or unexported fields
}

func (*FeedJob) JobSchedule

func (j *FeedJob) JobSchedule() string

func (*FeedJob) Run

func (j *FeedJob) Run(bot *rocketbot.Robot) error

type Result

type Result struct {
	feedcrawler.Result
}

func (*Result) Markdown

func (r *Result) Markdown() (string, error)

type Watcher

type Watcher struct {
	feedcrawler.Crawler
	// contains filtered or unexported fields
}

func New

func New(config *Config) *Watcher

func (*Watcher) ReloadFeeds

func (fw *Watcher) ReloadFeeds() error

func (*Watcher) ReloadStates added in v0.2.0

func (fw *Watcher) ReloadStates() error

func (*Watcher) SaveStates added in v0.2.0

func (fw *Watcher) SaveStates() error

func (*Watcher) Watch added in v0.2.0

func (fw *Watcher) Watch(f func(Result)) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL