From 412106c6b29fce54e826b80fb4c5f7d95d23ca5f Mon Sep 17 00:00:00 2001 From: Max Redmond Date: Sun, 28 Oct 2018 09:51:03 -0400 Subject: [PATCH] enabling xml unmarshaling rss and atom feeds --- atom.go | 2 +- rss.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/atom.go b/atom.go index 5f483fe..9a4885b 100644 --- a/atom.go +++ b/atom.go @@ -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 { diff --git a/rss.go b/rss.go index 39fe84b..aaadbdb 100644 --- a/rss.go +++ b/rss.go @@ -11,7 +11,7 @@ import ( ) // private wrapper around the RssFeed which gives us the .. 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/",