rss

package
v0.0.0-...-ed9fe1d Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2018 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel struct {
	Title          string   `xml:"title"`
	Link           string   `xml:"link"`
	Description    string   `xml:"description"`
	Language       string   `xml:"language"`
	Copyright      string   `xml:"copyright"`
	ManagingEditor string   `xml:"managingEditor"`
	WebMaster      string   `xml:"webMaster"`
	Images         []*Image `xml:"images"`
	LastBuildDate  Time     `xml:"lastBuildDate"`
	Category       string   `xml:"category"`
	Generator      string   `xml:"generator"`
	Items          []*Item  `xml:"item"`
}

Channel represents `rss>channel` doc.

type Image

type Image struct {
	URL    string `xml:"url"`
	Title  string `xml:"title"`
	Link   string `xml:"link"`
	Width  int64  `xml:"width"`
	Height int64  `xml:"height"`
}

Image represents `rss>channel>image` doc.

type Item

type Item struct {
	Title          string `xml:"title"`
	Link           string `xml:"link"`
	Description    string `xml:"description"`
	Author         string `xml:"author"`
	Category       string `xml:"category"`
	Comments       string `xml:"comments"`
	GUID           string `xml:"guid"`
	PubDate        Time   `xml:"pubDate"`
	ContentEncoded string `xml:"encoded"`
}

Item represents `rss>item` doc.

type Rss2

type Rss2 struct {
	XMLName xml.Name `xml:"rss"`
	Channel *Channel `xml:"channel"`
}

Rss2 is a struct to represent RSS 2.0 document

type Rss2Scraper

type Rss2Scraper struct{}

func (*Rss2Scraper) Scrape

func (rss2 *Rss2Scraper) Scrape(r io.Reader) (interface{}, error)

type Time

type Time time.Time

Time is an alias type for time.Time to unmarshal XML doc.

func (*Time) UnmarshalXML

func (t *Time) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML to implement xml unmarshalization

Jump to

Keyboard shortcuts

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