Merge remote-tracking branch 'origin/master'
j3s j3s@c3f.net
Tue, 23 Feb 2021 18:05:02 -0600
1 files changed,
25 insertions(+),
0 deletions(-)
jump to
M
main.go
→
main.go
@@ -34,14 +34,21 @@
for _, f := range scrapedFeeds { feed, err = getFeed(f) if err != nil { +<<<<<<< HEAD // break loop in case of // feed fetching failure err = fmt.Errorf("%s<br>%s", f, err) fetchFailures = append(fetchFailures, err) +======= + // in the case that a feed fails + // to be fetched, skip it. + log.Println(err) +>>>>>>> origin/master continue } feeds = append(feeds, *feed) } +<<<<<<< HEAD consolidatedFeed := consolidateFeeds(feeds) // sort posts by date, most recent first@@ -87,6 +94,24 @@ post.Custom = make(map[string]string)
post.Custom["feed-title"] = feed.Title omegaFeed.Items = append(omegaFeed.Items, post) } +======= + beegFeed := gofeed.Feed{} + for _, p := range posts { + for _, i := range p.Items { + // 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) +>>>>>>> origin/master } return omegaFeed }