Add another date pattern, add published to atom feeds
Jes Olson j3s@c3f.net
Sat, 08 Jul 2023 01:21:26 -0500
2 files changed,
7 insertions(+),
0 deletions(-)
M
rss/atom.go
→
rss/atom.go
@@ -44,6 +44,9 @@
next := new(Item) next.Title = item.Title next.Summary = item.Summary + if item.Date == "" { + item.Date = item.Published + } if item.Date != "" { next.Date, err = parseTime(item.Date) if err == nil {@@ -110,6 +113,7 @@ Title string `xml:"title"`
Summary string `xml:"summary"` Links []atomLink `xml:"link"` Date string `xml:"updated"` + Published string `xml:"published"` DateValid bool ID string `xml:"id"` }
M
rss/time.go
→
rss/time.go
@@ -68,6 +68,9 @@ "Jan 2, 2006 15:04 PM -0700 MST",
"Jan 2, 2006 15:04 PM MST -0700", "Jan 2, 06 15:04 PM MST -0700", "Jan 2, 06 15:04 PM -0700 MST", + + // j3s additions + "2006-01-02T15:04:05-0700", } func parseTime(s string) (time.Time, error) {