mirror of
https://codeberg.org/librarian/feeds
synced 2024-12-06 19:16:24 +01:00
enabling xml unmarshaling rss and atom feeds
This commit is contained in:
committed by
Kamil Kisiel
parent
762f7414cb
commit
412106c6b2
@@ -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 {
|
||||
|
||||
@@ -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/",
|
||||
|
||||
Reference in New Issue
Block a user