Package junkd0g/karoo is a simple rss feed client
go get -u github.com/junkd0g/karoo
package main
import (
"fmt"
rss "github.com/junkd0g/karoo"
)
func main() {
client, clientError := rss.NewClient()
if clientError != nil {
panic(clientError.Error())
}
feed, getFeedError := client.GetFeed("https://news.google.com/rss")
if getFeedError != nil {
panic(getFeedError)
}
fmt.Println(feed)
}
type RSS struct {
XMLName xml.Name `xml:"rss"`
Text string `xml:",chardata"`
Version string `xml:"version,attr"`
Channel struct {
Text string `xml:",chardata"`
Title string `xml:"title"`
Link string `xml:"link"`
Description string `xml:"description"`
Item []struct {
Text string `xml:",chardata"`
Title string `xml:"title"`
Link string `xml:"link"`
Description string `xml:"description"`
} `xml:"item"`
} `xml:"channel"`
}
- Iordanis Paschalidis -junkd0g