Skip to content

Commit

Permalink
chore: added more URLs and categories
Browse files Browse the repository at this point in the history
  • Loading branch information
TypicalAM committed Jan 3, 2023
1 parent 5648fc6 commit 36dfdb3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ Here are the things that I've not yet implemented
- [X] Waiting for the window size message before adding the first tab
- [ ] Deleting, adding and removing items
- [ ] Help interface with the key bindings
- [ ] Adding and removing categories and feeds
- [ ] A main category where all the feeds are aggregated

## 📸 Here is a demo of what it looks like:
Expand Down
1 change: 1 addition & 0 deletions internal/backend/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ func New() backend.Backend {

// Save the cache if it doesn't exist (crate the file)
if err := cache.Load(); err != nil {
// TODO: Logging
fmt.Println("Cache doesn't exist")
}

Expand Down
18 changes: 17 additions & 1 deletion internal/rss/rss.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ type Feed struct {
var ErrNotFound = errors.New("not found")

// New will create a new Rss structure, it fills it with basic items for now
// TODO: AddCategory and AddFeed methods
func New(filePath string) Rss {
rss := Rss{filePath: "rss.yml"}
err := rss.loadFromFile()
Expand All @@ -48,12 +47,29 @@ func New(filePath string) Rss {
Description: "News from around the world",
})

rss.Categories = append(rss.Categories, Category{
Name: "Tech",
Description: "Tech news",
})

rss.Categories[0].Subscriptions = append(rss.Categories[0].Subscriptions, Feed{
Name: "BBC",
Description: "News from the BBC",
URL: "http://feeds.bbci.co.uk/news/rss.xml",
})

rss.Categories[1].Subscriptions = append(rss.Categories[1].Subscriptions, Feed{
Name: "Hacker News",
Description: "News from Hacker News",
URL: "https://news.ycombinator.com/rss",
})

rss.Categories[1].Subscriptions = append(rss.Categories[1].Subscriptions, Feed{
Name: "Golang subreddit",
Description: "News from the Golang subreddit",
URL: "https://www.reddit.com/r/golang/.rss",
})

return rss
}

Expand Down

0 comments on commit 36dfdb3

Please sign in to comment.