From ed51885f158d5f0db2f12a5433aa5c1d39c92bd6 Mon Sep 17 00:00:00 2001 From: mattn Date: Fri, 10 May 2013 19:44:35 +0900 Subject: [PATCH 1/2] Try items in outside of channel node --- rss.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rss.go b/rss.go index 155128d..0e76e36 100644 --- a/rss.go +++ b/rss.go @@ -134,6 +134,9 @@ func (this *Feed) readRss2(doc *xmlx.Document) (err error) { itemcount := len(ch.Items) list = node.SelectNodes(ns, "item") + if len(list) == 0 { + list = doc.SelectNodes(ns, "item") + } for _, item := range list { if haveItem(ch, item.S(ns, "pubDate"), From 833b57154ff7568714c48b4a1d04e7c04cf3eafb Mon Sep 17 00:00:00 2001 From: mattn Date: Fri, 10 May 2013 04:55:33 -0700 Subject: [PATCH 2/2] Handle content:encoded --- rss.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/rss.go b/rss.go index 0e76e36..0de511c 100644 --- a/rss.go +++ b/rss.go @@ -188,6 +188,15 @@ func (this *Feed) readRss2(doc *xmlx.Document) (err error) { i.Source.Text = src.Value } + tl = item.SelectNodes("http://purl.org/rss/1.0/modules/content/", "*") + for _, lv := range tl { + if lv.Name.Local == "encoded" { + i.Content = new(Content) + i.Content.Text = lv.String() + break + } + } + ch.Items = append(ch.Items, i) }