feed

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2015 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindRssFeedUrl

func FindRssFeedUrl(url string, c chan string)

Find the rss feed url from a given url

func NewCronRss

func NewCronRss() *cron.Cron

Cron to fetch all the rss content

func ParseRssFeed

func ParseRssFeed(url string, c chan *RSS)

Fetch the content of the url and unmarshal the body to a struct

Types

type Feed

type Feed struct {
	FeedId      string    `json:"feedId"`
	FeedUrl     string    `json:"feedUrl"`
	LastUpdated time.Time `json:"-"`
}

The feed

func GetList

func GetList() []*Feed

Fetch all feeds from the db

func New

func New() *Feed

Instanciate a new feed

func (*Feed) Update

func (f *Feed) Update()

Update the feed

type Item

type Item struct {
	Title   string `xml:"title"`
	Link    string `xml:"link"`
	PubDate string `xml:"pubDate"`
}

type Items

type Items struct {
	XMLName       xml.Name `xml:"channel"`
	LastBuildDate string   `xml:"lastBuildDate"`
	Title         string   `xml:"title"`
	ItemList      []Item   `xml:"item"`
}

type RSS

type RSS struct {
	XMLName xml.Name `xml:"rss"`
	Items   Items    `xml:"channel"`
}

The RSS representation

Jump to

Keyboard shortcuts

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