feeds

package
v0.0.0-...-87a6b9e Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2022 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPrices

func GetPrices() string

func StoreNewContent

func StoreNewContent(store Store, source Source)

Maybe this just take a harvester which contains the source and the store and the processing logic

Types

type Avg

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

type Casts

type Casts struct {
	Misc  Misc
	Feeds []RssFeed
}

type Channel

type Channel struct {
	Title       string    `xml:"title"`
	Link        string    `xml:"link"`
	Description string    `xml:"description"`
	Items       []RssItem `xml:"item"`
}

type Enclosure

type Enclosure struct {
	Url string `xml:"url,attr"`
}

type GoldMoney

type GoldMoney struct {
	Rate Rates
}

type Misc

type Misc struct {
	User      string
	CreatedOn string
}

type Quort

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

type Rates

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

type Rss

type Rss struct {
	Channel Channel `xml:"channel"`
}

type RssFeed

type RssFeed struct {
	Name string
	Desc string
	Url  string
	Date string
	Dir  string
}

type RssItem

type RssItem struct {
	Title       string    `xml:"title"`
	Link        string    `xml:"link"`
	Description string    `xml:"description"`
	Enclosure   Enclosure `xml:"enclosure"`
}

type RssResult

type RssResult struct {
	Name        string
	Date        time.Time
	Item        RssItem
	Link        string
	AlreadyHave bool
	Failed      bool
	MessageSent bool
	FailReason  string
	Message     string
}

func Leach

func Leach(feed RssFeed, store Store, src Source, howmany int) []RssResult

type Source

type Source interface {
	GetRSS(feedURL string) *Rss
	DetectContentType(data []byte) string
	Get(url string) (resp *http.Response, err error)
}

type Spot

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

type Store

type Store interface {
	GetLast(i int, name string) []RssResult
	GetToMessage() []RssResult
	AlreadyHave(itemLink string, name string) bool
	Save(rssResult RssResult, link string, name string)
}

Jump to

Keyboard shortcuts

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