Ruby wrapper for the Imgur API.
Install with RubyGems:
$ gem install imgur-apiOr add to your Gemfile:
gem 'imgur-api'For anonymous usage, create a new client with your Client-ID
client = Imgur.new(client_id) # or Imgur::Client.new(client_id)To upload an image, first create a Imgur::LocalImage
image = Imgur::LocalImage.new('path/to/image', title: 'Awesome photo')Then use the client to upload it and recieve a Imgur::Image
uploaded = client.upload(image)
# uploaded.link => http://i.imgur.com/...Creating an album is super easy!
# The first argument can also be an array of images, or nil for a blank album.
album = client.new_album(uploaded, title: 'My Photography')
# album.link => http://imgur.com/a/...