Add some commentz
j3s j3s@c3f.net
Mon, 22 Feb 2021 19:53:54 -0600
1 files changed,
9 insertions(+),
4 deletions(-)
jump to
M
main.go
→
main.go
@@ -24,8 +24,8 @@ var gottenFeed *gofeed.Feed
for _, f := range feeds { gottenFeed, err = getFeed(f) if err != nil { - // break loop in case of - // feed fetching failure + // in the case that a feed fails + // to be fetched, skip it. log.Println(err) continue }@@ -34,14 +34,19 @@ }
beegFeed := gofeed.Feed{} for _, p := range posts { for _, i := range p.Items { - // Overriding description to the blog title + // descriptions are sometimes set to the entire + // content of blog posts. set it to title because + // i don't really care about descriptions + // maybe revisit this later and cut large + // descriptions down to a reasonable size i.Description = p.Title beegFeed.Items = append(beegFeed.Items, i) } } sort.Sort(sort.Reverse(beegFeed)) for _, i := range beegFeed.Items { - fmt.Fprintf(w, "<p>%s: <a href=\"%s\">%s</a></p>", i.Description, i.Link, i.Title) + fmt.Fprintf(w, "<p>%s: <a href=\"%s\">%s</a></p>", + i.Description, i.Link, i.Title) } }