Revert "memory hack: remove Image/Summary/Categories" This reverts commit 32969b8932d4244e76fcefe6b54e0ed626d8696b.
Jes Olson j3s@c3f.net
Thu, 01 Aug 2024 08:08:07 -0400
4 files changed,
16 insertions(+),
0 deletions(-)
M
rss/atom.go
→
rss/atom.go
@@ -27,6 +27,7 @@ out.Link = link.Href
break } } + out.Image = feed.Image.Image() out.Refresh = time.Now().Add(DefaultRefreshInterval) out.Items = make([]*Item, 0, len(feed.Items))@@ -42,6 +43,7 @@ }
next := new(Item) next.Title = item.Title + next.Summary = item.Summary if item.Published != "" { next.Date, err = parseTime(item.Published) if err == nil {
M
rss/rss.go
→
rss/rss.go
@@ -92,6 +92,7 @@ Author string `json:"author"`
Description string `json:"description"` Link string `json:"link"` // Link to the creator's website. UpdateURL string `json:"updateurl"` // URL of the feed itself. + Image *Image `json:"image"` // Feed icon. Categories []string `json:"categories"` Items []*Item `json:"items"` ItemMap map[string]struct{} `json:"itemmap"` // Used in checking whether an item has been seen before.@@ -194,6 +195,7 @@ fmt.Fprintf(w, "\xff\t\xffTitle:\t%q\n", f.Title)
fmt.Fprintf(w, "\xff\t\xffDescription:\t%q\n", f.Description) fmt.Fprintf(w, "\xff\t\xffLink:\t%q\n", f.Link) fmt.Fprintf(w, "\xff\t\xffUpdateURL:\t%q\n", f.UpdateURL) + fmt.Fprintf(w, "\xff\t\xffImage:\t%q (%s)\n", f.Image.Title, f.Image.URL) fmt.Fprintf(w, "\xff\t\xffRefresh:\t%s\n", f.Refresh.Format(DATE)) fmt.Fprintf(w, "\xff\t\xffUnread:\t%d\n", f.Unread) fmt.Fprintf(w, "\xff\t\xffItems:\t(%d) {\n", len(f.Items))@@ -207,6 +209,7 @@ w := buf
fmt.Fprintf(w, "Feed %q\n", f.Title) fmt.Fprintf(w, "\t%q\n", f.Description) fmt.Fprintf(w, "\t%q\n", f.Link) + fmt.Fprintf(w, "\t%s\n", f.Image) fmt.Fprintf(w, "\tRefresh at %s\n", f.Refresh.Format(DATE)) fmt.Fprintf(w, "\tUnread: %d\n", f.Unread) fmt.Fprintf(w, "\tItems:\n")@@ -220,8 +223,11 @@
// Item represents a single story. type Item struct { Title string `json:"title"` + Summary string `json:"summary"` + Categories []string `json:"category"` Link string `json:"link"` Date time.Time `json:"date"` + Image *Image `json:"image"` DateValid bool ID string `json:"id"` Enclosures []*Enclosure `json:"enclosures"`@@ -241,6 +247,8 @@ if debug {
w := tabwriter.NewWriter(buf, 0, 8, 0, '\t', tabwriter.StripEscape) fmt.Fprintf(w, "\xff%s\xffItem {\n", single) fmt.Fprintf(w, "\xff%s\xffTitle:\t%q\n", double, i.Title) + fmt.Fprintf(w, "\xff%s\xffSummary:\t%q\n", double, i.Summary) + fmt.Fprintf(w, "\xff%s\xffCategories:\t%q\n", double, i.Categories) fmt.Fprintf(w, "\xff%s\xffLink:\t%s\n", double, i.Link) fmt.Fprintf(w, "\xff%s\xffDate:\t%s\n", double, i.Date.Format(DATE)) fmt.Fprintf(w, "\xff%s\xffID:\t%s\n", double, i.ID)
M
rss/rss_1.0.go
→
rss/rss_1.0.go
@@ -29,6 +29,7 @@ out := new(Feed)
out.Title = channel.Title out.Description = channel.Description out.Link = channel.Link + out.Image = channel.Image.Image() if channel.MinsToLive != 0 { sort.Ints(channel.SkipHours) next := time.Now().Add(time.Duration(channel.MinsToLive) * time.Minute)@@ -81,6 +82,7 @@ }
next := new(Item) next.Title = item.Title + next.Summary = item.Description next.Link = item.Link if item.Date != "" { next.Date, err = parseTime(item.Date)
M
rss/rss_2.0.go
→
rss/rss_2.0.go
@@ -37,6 +37,7 @@ out.Link = link.Chardata
break } } + out.Image = channel.Image.Image() if channel.MinsToLive != 0 { sort.Ints(channel.SkipHours) next := time.Now().Add(time.Duration(channel.MinsToLive) * time.Minute)@@ -89,7 +90,10 @@ }
next := new(Item) next.Title = item.Title + next.Summary = item.Description + next.Categories = item.Categories next.Link = item.Link + next.Image = item.Image.Image() if item.Date != "" { next.Date, err = parseTime(item.Date) if err == nil {