Make rss module more verbose.

This commit is contained in:
Andreas Neue 2016-01-24 13:26:52 +01:00
parent a3b72a22b1
commit 0b07b44aea
1 changed files with 2 additions and 3 deletions

View File

@ -31,7 +31,6 @@ func Init(ch chan string, path string) {
}
defer file.Close()
scanner := bufio.NewScanner(file)
<-time.After(60 * time.Second)
for scanner.Scan() {
go PollFeed(scanner.Text(), 5, charsetReader)
}
@ -48,7 +47,7 @@ func PollFeed(uri string, timeout int, cr xmlx.CharsetFunc) {
log.Printf("Polling feed: %s", uri)
if err := feed.Fetch(uri, cr); err != nil {
log.Printf("[e] %s: %s", "*", uri, err)
//sayCh <- fmt.Sprintf("%s\n[e] %s: %s", "*", uri, err)
sayCh <- fmt.Sprintf("%s\n*** [RSS] Error %s: %s", "*", uri, err)
return
}
<-time.After(time.Duration(feed.SecondsTillUpdate() * 1e9))
@ -56,7 +55,7 @@ func PollFeed(uri string, timeout int, cr xmlx.CharsetFunc) {
}
func chanHandler(feed *gorss.Feed, newchannels []*gorss.Channel) {
//sayCh <- fmt.Sprintf("%s\n%d new channel(s) in %s", "*", len(newchannels), feed.Url)
sayCh <- fmt.Sprintf("%s\n*** [RSS] %d new channel(s) in %s", "*", len(newchannels), feed.Url)
}
func itemHandler(feed *gorss.Feed, ch *gorss.Channel, newitems []*gorss.Item) {