Did some significant reworking of the Rss and Atom internals. The Feed object now supports passing in 2 funciton handlers which notify your app of any new Channels or Items. These functions are called whenever the feed is updated and new channels or items are found which previously did not exist. See src/feed_test.go for examples. This change also made it prudent to change some of the struct definitions. In particular the fields referencing other structs. They have been changed from Value to Pointer definitions. So beware that this may break some of your existing code. At the very least, the feeder.New() function now takes 2 extra parameters.
This commit is contained in:
parent
eb15b6a3ef
commit
a8057b0c92
7 changed files with 223 additions and 107 deletions
43
README
43
README
|
@ -1,26 +1,33 @@
|
|||
Author: jim teeuwen <jimteeuwen@gmail.com>
|
||||
Dependencies: go-pkg-xmlx ( http://github.com/jteeuwen/go-pkg-xmlx )
|
||||
Author: jim teeuwen <jimteeuwen@gmail.com>
|
||||
Dependencies: go-pkg-xmlx ( http://github.com/jteeuwen/go-pkg-xmlx )
|
||||
|
||||
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.
|
||||
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
|
||||
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 specied in the feeds themselves.
|
||||
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 specied 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.
|
||||
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.
|
||||
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.
|
||||
|
||||
================================================================================
|
||||
LICENSE
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue