Documentation
¶
Overview ¶
Package rss ...
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UpdatePodcast ¶
UpdatePodcast fetches the feed URL for the given podcast, parses it and updates all of the episodes we have stored for the podcast. This method updates the passed-in store.Podcast with the latest details.
To keep memory usage managable, we use the xml.Decoder interface to decode the XML file in a streaming fashion.
If force is false, then we assume the podcast only has the latest handful of episodes -- anything older than the oldest episode we have already stored is ignored (if there's no existing episode then we assume this is a new podcast and load everything).
If flags contains ForceUpdate, then we ignore existing episodes and re-store all episodes in the RSS file. If it contains IconOnly, we skip updating episodes and just update the icon.
Types ¶
type Channel ¶
type Channel struct {
Title string `xml:"title"`
Link AtomLink `xml:"http://www.w3.org/2005/Atom link"`
Language string `xml:"language"`
Copyright string `xml:"copright"`
Description string `xml:"description"`
Image Image `xml:"image"`
Items []Item `xml:"item"`
}
Channel ...
type Image ¶
type Image struct {
URL string `xml:"url"`
Href string `xml:"href,attr"`
Title string `xml:"title"`
Link string `xml:"link"`
}
Image ...
type Item ¶
type Item struct {
Title string `xml:"title"`
Description string `xml:"description"`
EncodedDescription string `xml:"http://purl.org/rss/1.0/modules/content/ encoded"`
PubDate string `xml:"pubDate"`
GUID string `xml:"guid"`
Media Media `xml:"enclosure"`
}
Item ...
type Media ¶
type Media struct {
URL string `xml:"url,attr"`
Length int `xml:"length,attr"`
Type string `xml:"type,attr"`
}
Media ...
type UpdatePodcastFlags ¶
type UpdatePodcastFlags int
const ( ForceUpdate UpdatePodcastFlags = 1 << iota IconOnly )