diff options
author | Dimitri Sokolyuk <demon@dim13.org> | 2015-07-25 13:38:06 +0200 |
---|---|---|
committer | Dimitri Sokolyuk <demon@dim13.org> | 2015-07-25 13:38:06 +0200 |
commit | 2cf7407e968c3e1191b2182df091e993ca347a9d (patch) | |
tree | c2a6e5763498d65043aef004a486930da23c8670 /rss.go | |
parent | 4ff34bf33beac8c6a35815b0e05000ced132cefc (diff) |
Rename LOR feed, bump time to 1/2h, give up on failure
Diffstat (limited to 'rss.go')
-rw-r--r-- | rss.go | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -10,7 +10,7 @@ import ( ) var Feed = map[string]string{ - "News": `https://www.linux.org.ru/section-rss.jsp?section=1`, + "LOR": `https://www.linux.org.ru/section-rss.jsp?section=1`, "OpenNET": `http://www.opennet.ru/opennews/opennews_all_noadv.rss`, "Undeadly": `http://undeadly.org/cgi?action=rss`, } @@ -20,7 +20,7 @@ type News struct { Item rss.Item } -const timeOut = 15 * time.Minute +const timeOut = 30 * time.Minute var news = make(chan News) @@ -37,11 +37,12 @@ func init() { for k, v := range Feed { go func(c chan News, source, url string) { for { - to := time.Now().Add(-timeOut) r, err := rss.Fetch(url) if err != nil { log.Println(source, err) + return } + to := time.Now().Add(-timeOut) for _, i := range r.Channel.Items { if i.PubDate.After(to) { c <- News{source, i} |