GeoRSS4rb
GeoRSS4rb is an addon to the FeedTools library that aims at making GeoRSS information in a feed easily accessible for users of that library. It currently supports all the dialects (W3CGeo, Simple, GML) detailed in the GeoRSS specification version 1, including all the geometry types.
Installing
Just type under a command line: gem install georss4rb And the last version will be automatically downloaded and installed, along with the latest version of FeedTools, if you don’t already have it.
Operations
Now you have a location
method on FeedTools::Feed
and FeedTools::Item
objects, that will return either nil
, if no location exists, or an object of a subclass of GeoRss4rb::Geometry
, if a location exists. The subclass can be one of four types:
-
GeoRss4rb::Point
: With 2 properties,lat
andlon
-
GeoRss4rb::Line
: Behaves like an array of points -
GeoRss4rb::Polygon
: Behaves like an array of lines (although the GeoRss spec version 1 allows only the exterior ring to be defined) -
GeoRss4rb::Box
: Holds 2 corner points,lower_corner
andupper_corner
Here is an example of usage: feed = FeedTools::Feed.open(‘example.org/georss’) feed.title #=>MegaCool GeoRSS feed feed.location #=><GeoRss4rb::Box …> feed.items.first.location #=><GeoRss4rb::Point …> The location of the entire feed could be a bounding of the location of the items. Then each item can have a location item, here a point. Note that the specific GeoRSS dialect used does not make any difference in the object returned.
Changes since last version
-
First release
TODO
-
Add support for other RSS parsing libraries
License
GeoRSS4rb is released under the MIT license.
Support
Any questions, enhancement proposals, bug notifications or corrections can be sent to [email protected].