Make rss module more verbose.
This commit is contained in:
parent
a3b72a22b1
commit
0b07b44aea
|
@ -31,7 +31,6 @@ func Init(ch chan string, path string) {
|
||||||
}
|
}
|
||||||
defer file.Close()
|
defer file.Close()
|
||||||
scanner := bufio.NewScanner(file)
|
scanner := bufio.NewScanner(file)
|
||||||
<-time.After(60 * time.Second)
|
|
||||||
for scanner.Scan() {
|
for scanner.Scan() {
|
||||||
go PollFeed(scanner.Text(), 5, charsetReader)
|
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)
|
log.Printf("Polling feed: %s", uri)
|
||||||
if err := feed.Fetch(uri, cr); err != nil {
|
if err := feed.Fetch(uri, cr); err != nil {
|
||||||
log.Printf("[e] %s: %s", "*", uri, err)
|
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
|
return
|
||||||
}
|
}
|
||||||
<-time.After(time.Duration(feed.SecondsTillUpdate() * 1e9))
|
<-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) {
|
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) {
|
func itemHandler(feed *gorss.Feed, ch *gorss.Channel, newitems []*gorss.Item) {
|
||||||
|
|
Loading…
Reference in New Issue