Skip to content
/ rss2 Public

Parse, modify, create and render RSS 2.0 feeds in Go.

License

Notifications You must be signed in to change notification settings

codesoap/rss2

Repository files navigation

GoDoc

A complete and strictly standard conforming library for parsing and rendering RSS 2.0 feeds.

Simple example which renders a feed:

package main

import (
	"encoding/xml"
	"fmt"
	"time"

	"github.com/codesoap/rss2"
)

func main() {
	item, _ := rss2.NewItem(`Stonehenge finally understood!`, ``)
	item.Link = `https://willies-wilts.news/stonehenge-understood`
	item.PubDate = &rss2.RSSTime{time.Date(2022, 2, 3, 9, 39, 21, 0, time.UTC)}

	channelTitle := `Willie's Wiltshire News`
	channelLink := `https://willies-wilts.news`
	channelDesc := `Willie's latest news regarding Wiltshire`
	channel, _ := rss2.NewChannel(channelTitle, channelLink, channelDesc)
	channel.Items = []*rss2.Item{item}

	rss, _ := xml.MarshalIndent(rss2.NewRSS(channel), ``, `    `)
	fmt.Println(xml.Header + string(rss))
}

Find more examples and documentation at https://pkg.go.dev/github.com/codesoap/rss2.

About

Parse, modify, create and render RSS 2.0 feeds in Go.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages