enabling xml unmarshaling rss and atom feeds

This commit is contained in:
Max Redmond
2018-10-28 09:51:03 -04:00
committed by Kamil Kisiel
parent 762f7414cb
commit 412106c6b2
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -80,7 +80,7 @@ type AtomFeed struct {
Link *AtomLink
Author *AtomAuthor `xml:"author,omitempty"`
Contributor *AtomContributor
Entries []*AtomEntry
Entries []*AtomEntry `xml:"entry"`
}
type Atom struct {
+3 -3
View File
@@ -11,7 +11,7 @@ import (
)
// private wrapper around the RssFeed which gives us the <rss>..</rss> xml
type rssFeedXml struct {
type RssFeedXml struct {
XMLName xml.Name `xml:"rss"`
Version string `xml:"version,attr"`
ContentNamespace string `xml:"xmlns:content,attr"`
@@ -61,7 +61,7 @@ type RssFeed struct {
SkipDays string `xml:"skipDays,omitempty"`
Image *RssImage
TextInput *RssTextInput
Items []*RssItem
Items []*RssItem `xml:"item"`
}
type RssItem struct {
@@ -160,7 +160,7 @@ func (r *Rss) FeedXml() interface{} {
// return an XML-ready object for an RssFeed object
func (r *RssFeed) FeedXml() interface{} {
return &rssFeedXml{
return &RssFeedXml{
Version: "2.0",
Channel: r,
ContentNamespace: "http://purl.org/rss/1.0/modules/content/",