Documentation
¶
Overview ¶
Package rss provides functions to parse RSS 2.0 feeds.
Index ¶
Constants ¶
This section is empty.
Variables ¶
CommonDateLayouts is an array of commonly used date formats
Functions ¶
func FilterItems ¶ added in v1.1.0
FilterItems filters items through fn
Types ¶
type Channel ¶
type Channel struct { Items []Item `xml:"item"` Description string `xml:"description"` Title string `xml:"title"` Link string `xml:"link"` PubDate string `xml:"pubDate"` Language string `xml:"language"` Copyright string `xml:"copyright"` }
Channel is an RSS 2.0 Channel
type DateSorter ¶ added in v1.1.0
type DateSorter []Item
DateSorter sorts a list of items by date
func (DateSorter) Len ¶ added in v1.1.0
func (s DateSorter) Len() int
func (DateSorter) Less ¶ added in v1.1.0
func (s DateSorter) Less(i, j int) bool
func (DateSorter) Swap ¶ added in v1.1.0
func (s DateSorter) Swap(i, j int)
type Enclosure ¶
type Enclosure struct { URL string `xml:"url,attr" json:"URL"` Type string `xml:"type,attr" json:"Type,omitempty"` }
Enclosure is an RSS 2.0 Enclosure
type Feed ¶
type Feed struct { XMLName xml.Name `xml:"rss"` Version string `xml:"version,attr"` Media string `xml:"xmlns:media,attr"` Channel Channel `xml:"channel"` }
Feed is the RSS 2.0 root
type Item ¶
type Item struct { PubDate PubDate `xml:"pubDate" json:"PubDate"` Description string `xml:"description" json:"Description"` GUID string `xml:"guid" json:"GUID"` Link string `xml:"link" json:"Link"` Creator string `xml:"creator" json:"Creator"` Category []string `xml:"category" json:"Category"` Content MediaContent `xml:"content" json:"Content"` Enclosure Enclosure `xml:"enclosure" json:"Enclosure"` Title string `xml:"title" json:"Title"` Source Source `xml:"source" json:"Source"` }
Item is an RSS 2.0 Item
type MediaContent ¶
type MediaContent struct { URL string `xml:"url,attr" json:"URL,omitempty"` Width string `xml:"width,attr" json:"Width,omitempty"` Height string `xml:"height,attr" json:"Height,omitempty"` Medium string `xml:"medium,attr" json:"Medium,omitempty"` }
MediaContent is the Yahoo Media RSS
type PubDate ¶ added in v1.2.2
func (PubDate) MarshalJSON ¶ added in v1.2.2
MarshalJSON marshals RSS Pubdate to JSON
func (*PubDate) UnmarshalXML ¶ added in v1.2.2
UnmarshalXML unmarshals RSS dates
Click to show internal directories.
Click to hide internal directories.