Skip to content

Sample script using the contentful management api to create a space with data.

License

Notifications You must be signed in to change notification settings

contentful-labs/cma_import_script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cma_import_script

Script showing usage of the contentful-management gem which is a wrapper for the Content Management API.

Description

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.

Installation

$ bundle install

Data source setup

Download openbeerdb_csv.zip from Open Beer Database and unzip it into data directory.

Usage

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

About

Sample script using the contentful management api to create a space with data.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages