golibri/feed
Parse any RSS/Atom feed and get the relevant article URLs.
Requirements
go get -u github.com/golibri/fetch
go get -u github.com/PuerkitoBio/goquery
go get -u github.com/mmcdole/gofeed
installation
go get -u github.com/golibri/feed
usage
import "github.com/golibri/feed"
func main() {
f := feed.FromURL("http://example.com/whatever")
// OR:
f := feed.Parse("feed-xml-string")
// f is a Feed object, see below
// to get all article URLs directly:
links := f.Links() // []string
}
data fields
A Feed has the following data fields:
type Feed struct {
URL string
Body string
Items []Item
}
type Item struct {
Title string
URL string
Text string
Image string
}
license
LGPLv3. (You can use it in commercial projects as you like, but improvements/bugfixes must flow back to this lib.)