Skip to content

Commit

Permalink
Use lynx if present in the PATH to display HTML article content
Browse files Browse the repository at this point in the history
  • Loading branch information
giulianopz committed Mar 30, 2023
1 parent 4e8f375 commit 010b2e1
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions pkg/display/display.go
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,27 @@ func (d *Display) LoadArticlesList(url string) {

func (d *Display) LoadArticleText(url string) {

log.Default().Println("here")
if _, err := exec.LookPath("lynx"); err == nil {

cmd := exec.Command("lynx", url)
cmd.Stdin = os.Stdin
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr

if err = cmd.Start(); err != nil {
log.Default().Println(err)
}

if err = cmd.Wait(); err != nil {
log.Default().Println(err)
}

return
} else {
log.Default().Println(err)
}

for _, cachedFeed := range d.cache.GetFeeds() {
if cachedFeed.Url == d.currentFeedUrl {

Expand Down

0 comments on commit 010b2e1

Please sign in to comment.