summaryrefslogtreecommitdiff
path: root/rss.go
diff options
context:
space:
mode:
Diffstat (limited to 'rss.go')
-rw-r--r--rss.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/rss.go b/rss.go
index a445054..d14db94 100644
--- a/rss.go
+++ b/rss.go
@@ -9,18 +9,18 @@ import (
"dim13.org/rss"
)
-type Feed struct {
+type feed struct {
Name string
URL string
Every time.Duration
}
-type News struct {
- Feed
+type news struct {
+ feed
rss.Item
}
-func (n News) String() string {
+func (n news) String() string {
s := fmt.Sprintf("%v: %v", n.Name, n.Title)
if n.Author != "" {
s += fmt.Sprintf(" (%v) ", n.Author)
@@ -31,7 +31,7 @@ func (n News) String() string {
return s
}
-func (f Feed) watch(w io.Writer) {
+func (f feed) watch(w io.Writer) {
ticker := time.NewTicker(f.Every)
defer ticker.Stop()
for t := range ticker.C {
@@ -43,13 +43,13 @@ func (f Feed) watch(w io.Writer) {
last := t.Add(-f.Every)
for _, i := range r.Channel.Items {
if i.PubDate.After(last) {
- fmt.Fprint(w, News{f, i})
+ fmt.Fprint(w, news{f, i})
}
}
}
}
-func Watch(w io.Writer, feeds []Feed) {
+func watch(w io.Writer, feeds []feed) {
for _, feed := range feeds {
go feed.watch(w)
}