feed

package
v3.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2023 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ValidFeedContentType = regexp.MustCompile(`^(application|text)/(\w+\+)?xml`)

ValidFeedContentType is a REGEXP used to validate valid feed Content-Type

Functions

func ExtractFeedLinks(content io.Reader, base string) (links []string, err error)

ExtractFeedLinks extract feed links from HTML content

func GetFeedID

func GetFeedID(url string) string

GetFeedID converts URL to feed ID (HASH)

func GetFeedTags

func GetFeedTags(tags *string) []string

GetFeedTags extracts tags from a comma separated list of tags

func JoinTags

func JoinTags(tags ...string) string

JoinTags join tags in a comma separated string

func NewArticle

func NewArticle(feed *model.FeedDef, item *gofeed.Item) *model.Article

NewArticle creates a new article from a feed item

func NewArticles

func NewArticles(feed *model.FeedDef, items []*gofeed.Item) []*model.Article

NewArticles creates a new array of articles from an array of feed item

func NewFeed

func NewFeed(url string, tags *string) (*model.FeedDef, error)

NewFeed creates new Feed DTO

func NewFeedResponseFromDef

func NewFeedResponseFromDef(def *model.FeedDef) *app.FeedResponse

NewFeedResponseFromDef creates new Feed response from a definition

Types

type CustomAtomTranslator

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

CustomAtomTranslator is a custom GoFeed Atom translator created to extract Hub link.

func NewCustomAtomTranslator

func NewCustomAtomTranslator() *CustomAtomTranslator

NewCustomAtomTranslator creates nes custom GoFeed Atom translator.

func (*CustomAtomTranslator) Translate

func (ct *CustomAtomTranslator) Translate(feed interface{}) (*gofeed.Feed, error)

Translate Atom feed into generic feed and extract Hub link if present.

type CustomRSSTranslator

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

CustomRSSTranslator is a custom GoFeed RSS translator created to extract Hub link.

func NewCustomRSSTranslator

func NewCustomRSSTranslator() *CustomRSSTranslator

NewCustomRSSTranslator creates nes custom GoFeed RSS translator.

func (*CustomRSSTranslator) Translate

func (ct *CustomRSSTranslator) Translate(feed interface{}) (*gofeed.Feed, error)

Translate RSS feed into generic feed and extract Hub link if present.

Jump to

Keyboard shortcuts

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