Merge pull request #15 from mattn/try_items
Try items in outside of channel node
This commit is contained in:
commit
3ee2213eae
12
rss.go
12
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"),
|
||||
|
@ -185,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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue