summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rss.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/rss.go b/rss.go
index e3d4d17..ecf6f24 100644
--- a/rss.go
+++ b/rss.go
@@ -1,3 +1,4 @@
+// Package rss implements RSS fetcher
package rss
import (
@@ -8,11 +9,13 @@ import (
_ "code.google.com/p/go-charset/data"
)
+// RSS container
type RSS struct {
Version string `xml:"version,attr"`
Channel Channel `xml:"channel"`
}
+// Channel container
type Channel struct {
Link string `xml:"link"`
Language string `xml:"language"`
@@ -22,6 +25,7 @@ type Channel struct {
Items []Item `xml:"item"`
}
+// Item container
type Item struct {
Author string `xml:"author"`
Link string `xml:"link"`
@@ -30,6 +34,7 @@ type Item struct {
PubDate string `xml:"pubDate"`
}
+// Fetch and parse RSS from given URL
func Fetch(url string) (rss RSS, err error) {
resp, err := http.Get(url)
if err != nil {