Script showing usage of the contentful-management gem which is a wrapper for the Content Management API.
This script is a showcase on how you can play with the contentful-management gem in order to load your data to the Contentful platform. The script uses the Open Beer Database, which includes the following domain models:
- Brewery
- Beer
- Category
- Style
The script loads only a selected sample of the items due to the size of the data (time of execution).
You can change the pre-selected set of breweries and beer styles by changing the BREWERIES_IDS
and STYLE_IDS
constants in the script.
$ bundle install
Download openbeerdb_csv.zip from Open Beer Database and unzip it into data directory.
Note that you need to specify your access token and organization id in the script.rb file (ACCESS_TOKEN
, ORGANIZATION_ID
).
Your access token can be found at CMA - documentation
Script execution:
$ ruby script.rb