Replace github.com/jteeuwen/... with own mirrors

This commit is contained in:
an 2018-02-21 21:39:01 +01:00
parent 3c7b7e5727
commit 816bb5df1d
1 changed files with 5 additions and 6 deletions

View File

@ -15,10 +15,9 @@ import (
"os" "os"
"time" "time"
"git.dnix.de/an/rss"
"git.dnix.de/an/xlog" "git.dnix.de/an/xlog"
"git.dnix.de/an/xmlx"
gorss "github.com/jteeuwen/go-pkg-rss"
"github.com/jteeuwen/go-pkg-xmlx"
) )
var hideOutput = true var hideOutput = true
@ -54,7 +53,7 @@ func rssHandleMessage(m *Message) {
} }
func rssPollFeed(uri string, timeout int, cr xmlx.CharsetFunc) { func rssPollFeed(uri string, timeout int, cr xmlx.CharsetFunc) {
feed := gorss.New(timeout, true, rssChanHandler, rssItemHandler) feed := rss.New(timeout, true, rssChanHandler, rssItemHandler)
for { for {
xlog.Info("Polling feed: %s", uri) xlog.Info("Polling feed: %s", uri)
if err := feed.Fetch(uri, cr); err != nil { if err := feed.Fetch(uri, cr); err != nil {
@ -66,11 +65,11 @@ func rssPollFeed(uri string, timeout int, cr xmlx.CharsetFunc) {
} }
} }
func rssChanHandler(feed *gorss.Feed, newchannels []*gorss.Channel) { func rssChanHandler(feed *rss.Feed, newchannels []*rss.Channel) {
//SayCh <- fmt.Sprintf("%s\n[RSS] %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 rssItemHandler(feed *gorss.Feed, ch *gorss.Channel, newitems []*gorss.Item) { func rssItemHandler(feed *rss.Feed, ch *rss.Channel, newitems []*rss.Item) {
if hideOutput { if hideOutput {
return return
} }