feedreader

package
v0.0.0-...-6cf3b9a Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Feed

type Feed struct {
	URL   string      `json:"url"`
	Items []*FeedItem `json:"items"`
}

Feed represent an RSS/Atom feed

type FeedItem

type FeedItem struct {
	Title     string    `json:"title"`
	Content   string    `json:"content"`
	URL       string    `json:"url"`
	Published time.Time `json:"published"`
	GUID      string    `json:"guid"`
}

FeedItem stores info of feed entry

type FeedReader

type FeedReader struct {
	Sources     []string
	Feeds       []Feed
	FailedFeeds []string
	Day         *time.Time
	Verbose     bool
}

func New

func New(feedsFile string) (FeedReader, error)

New creates a feedreader

func (*FeedReader) Fetch

func (fr *FeedReader) Fetch()

Fetch feed items

func (*FeedReader) FetchSerial

func (fr *FeedReader) FetchSerial()

func (*FeedReader) LogFailures

func (fr *FeedReader) LogFailures(dir string, dayTime *time.Time) error

LogFailures stores all failed feed downloads

func (*FeedReader) Store

func (fr *FeedReader) Store(dir string, dayTime *time.Time) (string, error)

Store all downloaded feeds into a JSON file

type UserAgentTransport

type UserAgentTransport struct {
	http.RoundTripper
}

func (*UserAgentTransport) RoundTrip

func (c *UserAgentTransport) RoundTrip(r *http.Request) (*http.Response, error)

Jump to

Keyboard shortcuts

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