Documentation
¶
Index ¶
Constants ¶
const ( ErrNilReceiver = erorr.Error("nil receiver") ErrPubDateUnparsable = erorr.Error("RSS pubDate unparsable") )
const MediaType = "application/rss+xml"
MediaType is the RSS (specific) media-type.
One might want to use it with the HTTP "Accept" request header, or the HTTP "Content-Type" response header.
Note that, prior to the adoption of the "application/rss+xml", non-RSS specific media-types were often used with RSS. For example:
- "application/xml"
- "text/xml"
- "text/plain"
It is NOT recommended to use these other media-types with RSS. And to instead use "application/rss+xml".
The rss.MediaType constant exists to make that easier.
Variables ¶
This section is empty.
Functions ¶
func HTTPGet ¶
HTTPGet makes an HTTP GET request to a URL with the HTTP "Accept" request header set to "application/rss+xml" (the RSS media-type).
Example usage:
bytes, err := rss.HTTPGet(url)
See also: HTTPGetAndUnmarshal
func HTTPGetAndUnmarshal ¶
HTTPGetAndMarshal makes an HTTP GET request to a URL with the HTTP "Accept" request header set to "application/rss+xml" (the RSS media-type), and then unmarshals the body of the resulting HTTP response into RSS.
Example usage:
var rss2 rss.RSS2 err := rss.HTTPGetAndUnmarshal(url, &rss2)
See also: HTTPGet
Types ¶
type Description ¶
type Description struct {
Value string `xml:",chardata"`
}
func (*Description) HTML ¶
func (receiver *Description) HTML() string