GettyConnect

An un-official ruby wrapper for the Getty Images Connect API.

Getty Connect

Installation

Add this line to your application's Gemfile:

gem 'getty_connect'

And then execute:

$ bundle

Or install it yourself as:

$ gem install getty_connect

Usage Examples

Creating and configuring a client

GettyConnect.configure do |c|
  c.system_id = YOUR_SYSTEM_ID
  c.system_password = YOUR_SYSTEM_PASSWORD
  c.api_username = YOUR_API_USERNAME
  c.api_password = YOUR_API_PASSWORD
end

client = GettyConnect.new

Requesting an authentication token

client.request_token

With the duration of client.token_duration, tokens can be renewed with

client.renew_token

Search & Image Details

client.search("phrase", options={})

e.g. to return 5 images of bears

client.search("bears", options={:item_count => 5}

search() will return a subset of image metadata. To retrieve all metadata for a particular asset use:

client.get_image_details(assetIds)

Retrieving Image URLs

Preview images

Options are comp, preview, thumb, watermark_comp, watermark_preview

client.get_preview(["143895284", "143895289"], "thumb")

API Documentation

Run the following command to generate documentation:

rake doc:yard

Not Yet Implemented

  • GetEvents
  • GetLargestImageDownloadAuthorizations

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Inspiration

Inspired by the Twitter API gem.

Copyright (c) 2012 Avos Systems Inc.