- Go to [site]/admin/settings/edit-api
- click checkbox "Enable API"
- Make sure to change “Results per Page” to a number equal to or greater to the number of items in the site (the script does not do paging)
- Go to [site]/admin/users
- find user you want to give API access to (maybe use service account TTS) and edit the user's profile
- click the API Keys tab, give the key a label and hit the "Update API Keys" button
I haven’t turned the script into a gem so you will have to manually install dependencies. Go to the directory where you downloaded script and run the below commands (the later two are only needed if the Omeka site uses the Geolocation plugin).
- gem install rest
- gem install csv
- gem install recursive-open-struct
- gem install json
- gem install geocoder
- gem install countries
Open irb from directory the script is downloaded in.
From irb, type “load ‘[path/to/file]/omeka_export.rb’”
client = OmekaExport.new(“[site_url]/api”, “[api_key]”)
example: client = OmekaExport.new("https://[site.name.com]/api", "api key for user")
items = client.items
Separates items by their item type into separate csv files in the same directory the script is run from.
collections = client.collections
item_types = client.item_types
exhibits = client.exhibits
geolocations = client.geolocations