small pixel drawing of a pufferfish vore

Add another date pattern, add published to atom feeds
Jes Olson j3s@c3f.net
Sat, 08 Jul 2023 01:21:26 -0500
commit

c5dfb6a24b368c476b55230dee856d0460ad74fd

parent

8362165070eda7b8dc5a97596b7dbde6b35e04b3

2 files changed, 7 insertions(+), 0 deletions(-)

jump to
M rss/atom.gorss/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.gorss/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) {