Home > contentdm-ruby

contentdm-ruby

Contentdm-ruby is a project mainly written in Ruby, it's free.

Ruby module to pull data and metadata out of CONTENTdm repositories

= Introduction The ContentDm module for Ruby provides access to structured metadata in CONTENTdm collections via CONTENTdm's built-in OAI-PMH provider interface. The module turns Qualified Dublin Core metadata into a convenient hash structure. With proper authentication, it can also scrape collection-level field information from the CONTENTdm administrative interface and create formatted HTML output from retrieved records.

= Examples

Create a Harvester using the location of a CONTENTdm repository

harvester = ContentDm::Harvester.new('http://mycontentdm.example.com/')

Retrieve the list of collections

collections = harvester.collections
=> {"collection1" => "My First Collection", "collection2" => "My Second Collection"}

Retrieve a single record from collection1

record = harvester.get_record("collection1",16)

Retrieve all records from collection2

records = harvester.get_records("collection2")

Output XML and HTML markup consistent with the default CONTENTdm settings for the

collection

puts record.to_xml() puts record.to_html()

Retrieve a record based on its persistent URI using the class method version of #get_record

record = ContentDm::Harvester.get_record('http://mycontentdm.example.com/u/?/collection1,16')

Previous:Snowy