summaryrefslogtreecommitdiff
path: root/rss.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-07-09 17:44:15 +0200
committerDimitri Sokolyuk <demon@dim13.org>2015-07-09 17:44:15 +0200
commit04a3c5398af8ccabafafe3e684117d6e57ffe7b2 (patch)
tree9d51c415f5d41307a03002b1480731ddd29aba52 /rss.go
parent4d51712d370f60533edc9e17631e9ade56343114 (diff)
Restructure code
Diffstat (limited to 'rss.go')
-rw-r--r--rss.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/rss.go b/rss.go
new file mode 100644
index 0000000..abffafd
--- /dev/null
+++ b/rss.go
@@ -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
+}