Skip to content

Instantly share code, notes, and snippets.

@dbridges
Last active May 13, 2019 17:48
Show Gist options
  • Save dbridges/3be611de68465fd9202d3005db0a157e to your computer and use it in GitHub Desktop.
Save dbridges/3be611de68465fd9202d3005db0a157e to your computer and use it in GitHub Desktop.
func main() {
// Fetch and filter the feeds
feeds := fetchFeeds(feedURLs)
feeds = filterFeeds(feeds)
if len(feeds) == 0 {
return
}
// Render the feeds to an HTML string
t := loadTemplate()
writer := &strings.Builder{}
err := t.Execute(writer, feeds)
if err != nil {
log.Fatalln(err)
}
// Email the HTML out
err = mail(writer.String())
if err != nil {
log.Fatalln(err)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment