RSSParse

package module
v0.0.0-...-fbc7d54 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 30, 2024 License: 0BSD Imports: 2 Imported by: 0

README

Programming Language Zero Clause BSD License

GoRSS

Description

Library for parsing RSS feeds into a Golang struct.

Building

Requires

golang-1.18

License

All code and files in this repository are licensed under the 0-BSD License

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel struct {
	// Required fields
	Description string `xml:"description"`
	Links       []Link `xml:"link"`
	Title       string `xml:"title"`

	Items []Item `xml:"item,omitempty"`

	// Optional fields
	Author          string      `xml:"author,omitempty"`
	Category        string      `xml:"category,,omitempty"`
	Cloud           string      `xml:"cloud,omitempty"`
	Copyright       string      `xml:"copyright,omitempty"`
	Documentation   string      `xml:"docs,omitempty"`
	Generator       string      `xml:"generator,omitempty"`
	Language        string      `xml:"language,omitempty"`
	LastBuildDate   string      `xml:"lastBuildDate,omitempty"`
	ManagingEditor  string      `xml:"managingEditor,omitempty"`
	PublicationDate string      `xml:"pubDate,omitempty"`
	Rating          string      `xml:"rating,omitempty"`
	SkipHours       string      `xml:"skipHours,omitempty"`
	SkipDays        string      `xml:"skipDays,omitempty"`
	TextInputs      []TextInput `xml:"textInput,omitempty"`
	TimeToLive      string      `xml:"ttl,omitempty"`
	WebMaster       string      `xml:"webMaster,omitempty"`

	// Fields with optional subelements
	Images     []Image `xml:"image,omitempty"`
	ImageWidth int     `xml:"image,attr"`
}

type Enclosure

type Enclosure struct {
	Length int    `xml:"length,attr"`
	SMIME  string `xml:"smime,attr"`
	URL    string `xml:"url,attr"`
}

type Image

type Image struct {
	Height int `xml:"height,attr"`
	Width  int `xml:"width,attr"`
	Title  int `xml:title,attr`

	Text string `xml:",chardata"`
	Href string `xml:"href,attr"`
}

type Item

type Item struct {
	Description string `xml:"description"`
	Link        string `xml:"link"`
	Title       string `xml:"title"`

	Author   string `xml:"author,omitempty"`
	Category string `xml:"category,omitempty"`
	Comment  string `xml:"comment,omitempty"`

	Enclosures []Enclosure `xml:"enclosure"`

	Guid            string `xml:"guid,omitempty"`
	PublicationDate string `xml:"pubDate,omitempty"`
}
type Link struct {
	Href string `xml:"href,attr"`
	URL  string `xml:",chardata"`
}

type RSS

type RSS struct {
	XMLName  xml.Name
	Channels []Channel `xml:"channel"`
}

func RSSFeedParse

func RSSFeedParse(data string) (feed *RSS, err error)

type TextInput

type TextInput struct {
	Title       string `xml:"title"`
	Description string `xml:"description"`
	Name        string `xml:"name"`
	Link        string `xml:"link"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL