Project

imgur-api

0.01
No release in over 3 years
Low commit activity in last 3 years
Imgur API wrapper
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
>= 0

Runtime

 Project Readme

Imgur

Ruby wrapper for the Imgur API.

Installation

Install with RubyGems:

$ gem install imgur-api

Or add to your Gemfile:

gem 'imgur-api'

Usage

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/...