Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

This package reads RSS and Atom feeds and provides a caching mechanism that adheres to the feed specs.

branch: master
Octocat-spinner-32 testdata Merge pull request #32 from dukex/extensions January 24, 2014
Octocat-spinner-32 LICENSE Switch to more liberal CC0 Public Domain license. March 19, 2011
Octocat-spinner-32 README.md Added link to example January 23, 2014
Octocat-spinner-32 atom.go Back to previous API. March 24, 2014
Octocat-spinner-32 author.go Making package easily usable with goinstall. Including the reference … January 20, 2011
Octocat-spinner-32 category.go Making package easily usable with goinstall. Including the reference … January 20, 2011
Octocat-spinner-32 channel.go added Extension to channel January 23, 2014
Octocat-spinner-32 cloud.go Making package easily usable with goinstall. Including the reference … January 20, 2011
Octocat-spinner-32 content.go Making package easily usable with goinstall. Including the reference … January 20, 2011
Octocat-spinner-32 database.go Adds a database. December 05, 2013
Octocat-spinner-32 enclosure.go Making package easily usable with goinstall. Including the reference … January 20, 2011
Octocat-spinner-32 feed.go Add check if the handler exists. December 05, 2013
Octocat-spinner-32 feed_test.go Merge pull request #32 from dukex/extensions January 24, 2014
Octocat-spinner-32 generator.go Making package easily usable with goinstall. Including the reference … January 20, 2011
Octocat-spinner-32 image.go Making package easily usable with goinstall. Including the reference … January 20, 2011
Octocat-spinner-32 input.go Making package easily usable with goinstall. Including the reference … January 20, 2011
Octocat-spinner-32 item.go go fmt March 24, 2014
Octocat-spinner-32 link.go Making package easily usable with goinstall. Including the reference … January 20, 2011
Octocat-spinner-32 rss.go Back to previous API. March 24, 2014
Octocat-spinner-32 source.go Making package easily usable with goinstall. Including the reference … January 20, 2011
Octocat-spinner-32 subtitle.go Making package easily usable with goinstall. Including the reference … January 20, 2011
Octocat-spinner-32 timeparser.go go fmt March 24, 2014
Octocat-spinner-32 timeparser_test.go go fmt March 24, 2014
README.md

RSS

This package allows us to fetch Rss and Atom feeds from the internet. They are parsed into an object tree which is a hybrid of both the RSS and Atom standards.

Supported feeds are:

  • Rss v0.91, 0.92 and 2.0
  • Atom 1.0

The package allows us to maintain cache timeout management. This prevents us from querying the servers for feed updates too often and risk ip bans. Apart from setting a cache timeout manually, the package also optionally adheres to the TTL, SkipDays and SkipHours values specified in the feeds themselves.

Note that the TTL, SkipDays and SkipHour fields are only part of the RSS spec. For Atom feeds, we use the CacheTimeout in the Feed struct.

Because the object structure is a hybrid between both RSS and Atom specs, not all fields will be filled when requesting either an RSS or Atom feed. I have tried to create as many shared fields as possible but some of them simply do not occur in either the RSS or Atom spec.

The Feed object supports notifications of new channels and items. This is achieved by passing 2 function handlers to the feeder.New() function. They will be called whenever a feed is updated from the remote source and either a new channel or a new item is found that previously did not exist. This allows you to easily monitor a feed for changes. See src/feed_test.go for an example of how this works.

DEPENDENCIES

github.com/jteeuwen/go-pkg-xmlx

USAGE

An idiomatic example program can be found in testdata/example.go.

Something went wrong with that request. Please try again.