diff options
author | Dimitri Sokolyuk <demon@dim13.org> | 2015-07-09 17:44:15 +0200 |
---|---|---|
committer | Dimitri Sokolyuk <demon@dim13.org> | 2015-07-09 17:44:15 +0200 |
commit | 04a3c5398af8ccabafafe3e684117d6e57ffe7b2 (patch) | |
tree | 9d51c415f5d41307a03002b1480731ddd29aba52 /rss.go | |
parent | 4d51712d370f60533edc9e17631e9ade56343114 (diff) |
Restructure code
Diffstat (limited to 'rss.go')
-rw-r--r-- | rss.go | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -0,0 +1,19 @@ +package main + +import "dim13.org/rss" + +const ( + lor = `https://www.linux.org.ru/section-rss.jsp?section=1` + undeadly = `http://undeadly.org/cgi?action=rss` +) + +func FetchNews(url string) (s []string, err error) { + news, err := rss.Fetch(url) + if err != nil { + return nil, err + } + for _, i := range news.Channel.Items { + s = append(s, i.Title) + } + return s, nil +} |