README.md in imgurapi-2.0.0 vs README.md in imgurapi-2.0.1
- old
+ new
@@ -1,8 +1,9 @@
# Imgur
This gem allows you to interact with Imgur's authenticated API, version 3.
+
It doesn't implement all the available endpoints. So far:
- image upload, find and delete
- account image count, account details, account image list
## Imgur set-up
@@ -18,11 +19,11 @@
## Installation
Add this line to your application's Gemfile:
```ruby
-gem 'imgurruby'
+gem 'imgurapi'
```
And then run:
```bash
$ bundle install
@@ -49,12 +50,12 @@
imgur_session = Imgur::Session.new(client_id: 'CLIENT_ID', client_secret: 'CLIENT_SECRET', refresh_token: 'REFRESH_TOKEN')
```
Your account:
```ruby
-account = imgur_session.account
-{"id"=>123, "url"=>"my_account", "bio"=>nil, "reputation"=>7, "created"=>1352279501, "pro_expiration"=>false}
+account = imgur_session.account.account
+=> #<Imgur::Account:0x007fd399b6b678 @id=123, @url="my_account", @bio=nil, @reputation=7, @created=1352279501, @pro_expiration=false>
```
How many images you have:
```ruby
puts imgur_session.account.image_count
@@ -91,9 +92,17 @@
Feel free to use it in your Rails views:
```ruby
<%= image_tag my_image.link %>
```
+
+Alternatively, you can use `url` instead of `link` because it provides image resizing.
+```
+<%= image_tag my_image.url %>
+<%= image_tag my_image.url(:small) %>
+```
+With no arguments, it's the same as `link`.
+Available sizes are small (`:small_square`, `:small` or `:s`) and large (`:large_thumbnail`, `:large` or `:l`)
How many images do you have at the moment?
```ruby
puts imgur_session.account.image_count
```