From 41ad7d65b5b43ba7c8292e102aff238f9da47537 Mon Sep 17 00:00:00 2001 From: Matthew Dawson Date: Sun, 7 Jul 2013 11:49:28 -0400 Subject: [PATCH] Fix parsing authors in RSS feeds. In RSS feeds, the author of an item was always overwritten by a non-standard creator tag. Change this so that creator is only used when it actually appears. Otherwise use the previous value of Author, whatever that is. --- rss.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rss.go b/rss.go index 0de511c..1e1e462 100644 --- a/rss.go +++ b/rss.go @@ -159,7 +159,9 @@ func (this *Feed) readRss2(doc *xmlx.Document) (err error) { i.Author = Author{} i.Author.Name = n.Value } - i.Author.Name = item.S(ns, "creator") + if n = item.SelectNode(ns, "creator"); n != nil { + i.Author = Author{ Name: n.Value } + } i.Comments = item.S(ns, "comments") i.Guid = item.S(ns, "guid")