Based on Cubee's imgur-ruby script.
Add this line to your application's Gemfile
gem "imgurruby", "~> 0.0.3"
For the latest version:
gem "imgurruby", :git => 'https://github.com/asithade/imgur-ruby'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install imgurruby
@image = Imgurruby::Imgur.new('YOUR_API_KEY')
@image.upload(params[:file])
You can then access the url/error by calling
@image.url
I'm quite a newbie with Ruby, so feel free to add your own insight!
- Fork it ( http://github.com//imgurruby/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request