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:
parent
2b6dc03ede
commit
2c67b94a04
5 changed files with 135 additions and 5 deletions
2
rss.go
2
rss.go
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue