summaryrefslogtreecommitdiff
path: root/rss.go
diff options
context:
space:
mode:
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
+}