From 44b2a071555235d8e7c1d64d85541ade50527e3b Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Tue, 20 Dec 2016 23:58:49 +0100 Subject: news watcher --- rss.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'rss.go') diff --git a/rss.go b/rss.go index f79efe7..741b81d 100644 --- a/rss.go +++ b/rss.go @@ -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) } } -- cgit v1.2.3