Skip to content

junkd0g/karoo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

karoo

Package junkd0g/karoo is a simple rss feed client

Installing

go get -u github.com/junkd0g/karoo

Example

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)

}

Return feed struct

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"`
}

Authors

About

Golang RSS client

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages