shout

package module
v0.0.0-...-d1b8e3a Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: MIT Imports: 17 Imported by: 1

README

===== shout ====================================================================

shout is an aggregation library for syndicated data.

===== profiles =================================================================

shout takes a "Profile" as an input, containing A. feed metadata from the Atom
format, B. an SDL collection (see /sdl) containing feeds to aggregate, and C.
optionally an algorithm to describe how data is sorted.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Aggregate

func Aggregate(fs []feeds.Feed, p *Profile) (out feeds.Feed, err error)

Aggregate combines feeds into one megafeed based on a profile.

func Exec

func Exec(p *Profile, o Opts) (feed feeds.Feed, err error)

func FetchCollection

func FetchCollection(c *sdl.Collection) (fs []feeds.Feed, err error)

func FetchFeed

func FetchFeed(f *sdl.Feed) (feed feeds.Feed, err error)

func ParamForId

func ParamForId[T any](aps AlgParams[T], id string) T

Types

type AlgParam

type AlgParam[T any] struct {
	ForId string `xml:"if_id,attr,omitempty"`
	Value T      `xml:",chardata"`
}

type AlgParams

type AlgParams[T any] []AlgParam[T]

type Algorithm

type Algorithm struct {
	XMLName         xml.Name          `xml:"shout algorithm"`
	GlobalNamespace string            `xml:"xmlns,attr,omitempty"`
	Pins            AlgParams[string] `xml:"shout pin"`
	AgeMax          AlgParams[string] `xml:"shout age_max"`
	Limit           AlgParams[int64]  `xml:"shout limit"`
	Weights         *Weights          `xml:"shout weights,omitempty"`
}

type Opts

type Opts struct {
	PageNum, PageCt int
}

type Profile

type Profile struct {
	XMLName xml.Name `xml:"shout profile"`
	atom.FeedMeta
	GlobalNamespace string          `xml:"xmlns,attr,omitempty"`
	Collection      *sdl.Collection `xml:"sdl collection,omitempty"`
	Algorithm       *Algorithm      `xml:"shout algorithm"`
}

func ReadProfile

func ReadProfile(href string) (p *Profile, err error)

func (*Profile) Hash

func (p *Profile) Hash() (hash string)

type Weights

type Weights struct {
	Age int `xml:"shout age,omitempty"`
}

Directories

Path Synopsis
rss

Jump to

Keyboard shortcuts

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