Documentation ¶
Overview ¶
Package rss provides helper function for interacting with RSS, RDF, and Atom feeds. Primarily this surrounds building and reading/parsing.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteFeedXML ¶
WriteFeedXML takes a Feed and generates and writes an XML file.
This function generates RSS 2.0.1.
See http://www.rssboard.org/rss-specification
You can validate the output files using: http://www.rssboard.org/rss-validator
Overall the XML structure is: <rss><channel><item></item><item></item>...</channel></rss>
A note on timestamps: The RSS spec says we should use RFC 822, but the time.RFC1123Z format looks closest to their examples, so I use that.
Types ¶
type Config ¶
type Config struct { // Control whether we have verbose output (or not). Verbose bool }
Config controls package wide settings.
type Feed ¶
type Feed struct { Title string Link string Description string PubDate time.Time Items []Item Type string }
Feed contains information about a feed.
func ParseFeedXML ¶
ParseFeedXML takes a feed's raw XML and returns a struct describing the feed.
We support various formats: RSS, RDF, Atom. We try our best to decode the feed in one of them.