Skip to content

Commit

Permalink
Minor comment updates
Browse files Browse the repository at this point in the history
  • Loading branch information
skx committed Nov 6, 2024
1 parent 1bf2803 commit 6c8bae0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion cmd_rss.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,19 @@ is used in the format-string.
// Process each specified feed.
func (r *rssCommand) processFeed(url string) error {

// Create the parser with defaults
fp := gofeed.NewParser()

// Parse the feed
feed, err := fp.ParseURL(url)
if err != nil {
return err
}

// For each entry
for _, ent := range feed.Items {

// Get a piece of text, using our format-string
txt := os.Expand(
r.format,
func(s string) string {
Expand All @@ -91,9 +97,12 @@ func (r *rssCommand) processFeed(url string) error {
},
)

// Now show it
fmt.Println(txt)
}
return err

// All good.
return nil
}

// Execute is invoked if the user specifies `rss` as the subcommand.
Expand Down

0 comments on commit 6c8bae0

Please sign in to comment.