diff options
author | Dimitri Sokolyuk <demon@dim13.org> | 2016-12-20 23:58:49 +0100 |
---|---|---|
committer | Dimitri Sokolyuk <demon@dim13.org> | 2016-12-20 23:58:49 +0100 |
commit | 44b2a071555235d8e7c1d64d85541ade50527e3b (patch) | |
tree | 5f53d6bc722ccddcb3483ba814facfb5ab85171b /rss.go | |
parent | c2eaea7276945057ac18b31d06b79a6326932b57 (diff) |
news watcher
Diffstat (limited to 'rss.go')
-rw-r--r-- | rss.go | 11 |
1 files changed, 4 insertions, 7 deletions
@@ -6,7 +6,6 @@ import ( "time" "dim13.org/rss" - irc "github.com/fluffle/goirc/client" ) type Feed struct { @@ -107,14 +106,12 @@ func (f Feed) Watch(news chan News) { } } -func WatchNews(conn *irc.Conn, room string) { +func watchNews(msg chan string) { news := make(chan News) - - for _, f := range Feeds { - go f.Watch(news) + for _, feed := range Feeds { + go feed.Watch(news) } - for n := range news { - conn.Notice(room, n.String()) + msg <- fmt.Sprint(n) } } |