Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
giulianopz committed Apr 14, 2023
2 parents 8ff6433 + e14c4ee commit a624a14
Show file tree
Hide file tree
Showing 13 changed files with 322 additions and 253 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Build from source:

Or download the latest pre-compiled binary from [GitHub](https://github.com/giulianopz/newscanoe/releases) and then install it in your PATH.

[![asciicast](https://asciinema.org/a/jYCL3CFDmPES9dsptTxwj8IEk.svg)](https://asciinema.org/a/jYCL3CFDmPES9dsptTxwj8IEk)
[![asciicast](https://asciinema.org/a/YV9BmyBk9zNRPxYMjimEaAT59.svg)](https://asciinema.org/a/YV9BmyBk9zNRPxYMjimEaAT59)

### Development

Expand Down
2 changes: 1 addition & 1 deletion Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ tasks:
- go build -o newscanoe cmd/newscanoe/main.go
install:
cmds:
- cp ./newscanoe /usr/local/bin
- cp ./newscanoe ~/bin/
debug:
cmds:
- go run cmd/newscanoe/main.go -d 2> log
2 changes: 1 addition & 1 deletion cmd/newscanoe/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func main() {
}
}()

for {
for !d.Quitting {
d.RefreshScreen()
d.ProcessKeyStroke(os.Stdin.Fd(), quitC)
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/JohannesKaufmann/html-to-markdown v1.3.7
github.com/mmcdole/gofeed v1.2.1
golang.org/x/exp v0.0.0-20230321023759-10a507213a29
golang.org/x/sys v0.6.0
golang.org/x/sys v0.7.0
)

require (
Expand Down
3 changes: 2 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU=
golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
Expand Down
11 changes: 11 additions & 0 deletions pkg/ascii/code.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package ascii

/*
see: https://theasciicode.com.ar/
*/

const (
ENTER = 13
BACKSPACE = 127
ESC = '\x1b'
)
5 changes: 4 additions & 1 deletion pkg/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,13 @@ func (c *Cache) AddFeed(parsedFeed *gofeed.Feed, url string) error {
if cachedFeed.Url == url {

cachedFeed.Title = title
cachedFeed.Items = make([]*Item, 0)

for _, parsedItem := range parsedFeed.Items {
cachedItem := NewItem(parsedItem.Title, parsedItem.Link, *parsedItem.PublishedParsed)
cachedFeed.Items = append(cachedFeed.Items, cachedItem)
}
log.Default().Printf("cached feed with url: %s\n", url)
log.Default().Printf("refreshed cached feed with url: %s\n", url)
return nil
}
}
Expand All @@ -144,6 +146,7 @@ func (c *Cache) AddFeed(parsedFeed *gofeed.Feed, url string) error {
newFeed.Items = append(newFeed.Items, cachedItem)
}
c.feeds = append(c.feeds, newFeed)
log.Default().Printf("cached a new feed with url: %s\n", url)

return nil
}
Expand Down
Loading

0 comments on commit a624a14

Please sign in to comment.