Time parsing.

Rather than just using a string for PubDate, we attempt to parse it.
This includes a couple of crazy non-standard time formats that I've seen
in the wild.

Breaking change: Item.PubDate is no longer a string, it is time.Time.
This commit is contained in:
Sean Schulte 2014-03-24 21:54:15 -05:00
parent 2b6dc03ede
commit 2c67b94a04
5 changed files with 135 additions and 5 deletions

2
rss.go
View file

@ -162,7 +162,7 @@ func (this *Feed) readRss2(doc *xmlx.Document) (err error) {
i.Guid = &guid
}
i.PubDate = item.S(ns, "pubDate")
i.PubDate, _ = parseTime(item.S(ns, "pubDate"))
tl = item.SelectNodes(ns, "category")
for _, lv := range tl {