feeds

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2024 License: MIT Imports: 38 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoRecentArticles = errors.New("no recent articles")

Functions

func NewConfigSite

func NewConfigSite() *shared.ConfigSite

func StartApiServer

func StartApiServer()

func StartSshServer added in v1.8.1

func StartSshServer()

Types

type DigestFeed

type DigestFeed struct {
	Feeds   []*Feed
	Options DigestOptions
}

type DigestOptions added in v1.1.3

type DigestOptions struct {
	InlineContent bool
}

type Feed

type Feed struct {
	Title       string
	Link        string
	Description string
	Items       []*FeedItemTmpl
	FeedItems   []*gofeed.Item
}

type FeedHooks

type FeedHooks struct {
	Cfg *shared.ConfigSite
	Db  db.DB
}

func (*FeedHooks) FileMeta

func (p *FeedHooks) FileMeta(s ssh.Session, data *filehandlers.PostMetaData) error

func (*FeedHooks) FileValidate

func (p *FeedHooks) FileValidate(s ssh.Session, data *filehandlers.PostMetaData) (bool, error)

type FeedItemTmpl added in v1.1.5

type FeedItemTmpl struct {
	GUID        string
	Title       string
	Link        string
	PublishedAt *time.Time
	Content     html.HTML
	Description html.HTML
}

type Fetcher

type Fetcher struct {
	// contains filtered or unexported fields
}

func NewFetcher

func NewFetcher(dbpool db.DB, cfg *shared.ConfigSite) *Fetcher

func (*Fetcher) Fetch

func (f *Fetcher) Fetch(fp *gofeed.Parser, url string, feedItems []*db.FeedItem) (*Feed, error)

func (*Fetcher) FetchAll

func (f *Fetcher) FetchAll(urls []string, inlineContent bool, postID string) (*MsgBody, error)

func (*Fetcher) Loop

func (f *Fetcher) Loop()

func (*Fetcher) ParseURL added in v1.1.3

func (f *Fetcher) ParseURL(fp *gofeed.Parser, url string) (*gofeed.Feed, error)

func (*Fetcher) PrintHtml added in v1.1.3

func (f *Fetcher) PrintHtml(feedTmpl *DigestFeed) (string, error)

func (*Fetcher) PrintText added in v1.1.3

func (f *Fetcher) PrintText(feedTmpl *DigestFeed) (string, error)

func (*Fetcher) Run

func (f *Fetcher) Run() error

func (*Fetcher) RunPost

func (f *Fetcher) RunPost(user *db.User, post *db.Post) error

func (*Fetcher) RunUser

func (f *Fetcher) RunUser(user *db.User) error

func (*Fetcher) SendEmail

func (f *Fetcher) SendEmail(username, email string, subject string, msg *MsgBody) error

func (*Fetcher) Validate

func (f *Fetcher) Validate(lastDigest *time.Time, parsed *shared.ListParsedText) error

type MsgBody added in v1.1.3

type MsgBody struct {
	Html string
	Text string
}

type SSHServer added in v1.8.1

type SSHServer struct{}

type UserAgentTransport added in v1.1.3

type UserAgentTransport struct {
	http.RoundTripper
}

func (*UserAgentTransport) RoundTrip added in v1.1.3

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