get rss link when atom link is present

found in: https://rss.nytimes.com/services/xml/rss/nyt/Arts.xml

when both rss and atom link elements are present, xml parser returns
empty string. provide default namespace to capture rss link properly.
This commit is contained in:
Nazar Kanaev 2022-05-03 15:35:57 +01:00
parent 8e9da86f83
commit ee2a825cf0

View File

@ -22,7 +22,7 @@ type rssFeed struct {
type rssItem struct { type rssItem struct {
GUID string `xml:"guid"` GUID string `xml:"guid"`
Title string `xml:"title"` Title string `xml:"title"`
Link string `xml:"link"` Link string `xml:"rss link"`
Description string `xml:"rss description"` Description string `xml:"rss description"`
PubDate string `xml:"pubDate"` PubDate string `xml:"pubDate"`
Enclosures []rssEnclosure `xml:"enclosure"` Enclosures []rssEnclosure `xml:"enclosure"`