OpenActive Client Library for Ruby
A basic Ruby client library for working with data published as part of the OpenActive project.
Specifically the code provides support for:
- Listing all datasets that have been published as part of the project
- Fetching and harvesting a Realtime Paged Data Exchange (RPDE) containing opportunity data
- Identifying whether a feed conforms to the RPDE specification and/or the Modelling Opportunity Data specification
The project also provides some simple command-line tools to help to illustrate its use.
Add this line to your application's Gemfile:
And then execute:
Or install it yourself as:
$ gem install openactive
The code includes a couple of example scripts in the
bin directory that illustrate usage of the library to fetch
metadata and page through feeds.
bin/oa_list.rb-- list all published datasets
bin/oa_status.rb-- create a CSV file summarising current status of published datasets
bin/oa_sample.rb-- dump a random "modified" entry from a feed
bin/oa_harvest.rb-- harvest all data from a feed, storing results in a directory
For a slightly longer example, take a look at this tutorial on Indexing Opportunity Data Using Elastic Search
Handling of items in a feed
The library doesn't currently provide support for manipulating individual items in an RPDE feed. It just returns the individual items as Ruby hashes that can then be manipulated by the calling code.