module Flickrie
Constants
- DEFAULTS
- FLICKR_API_METHODS
- NOT_IMPLEMENTED
- VERSION
Attributes
Access token (token + secret) is used to make authenticated requests. Access tokens are unique for each Flickr user, and they last forever. So, if your app is of that kind that it asks users to authenticate through Flickr, after you get their access token, you can store it somewhere in the database, and you never have to ask that user to authenticate again.
You can obtain the access token in various ways:
-
using this gem’s [authentication proccess](github.com/janko-m/flickrie#authentication)
-
using my [flickr_auth](github.com/janko-m/flickr_auth) gem
-
using [omniauth](github.com/intridea/omniauth) with the [omniauth-flickr](github.com/timbreitkreutz/omniauth-flickr) strategy
Access token (token + secret) is used to make authenticated requests. Access tokens are unique for each Flickr user, and they last forever. So, if your app is of that kind that it asks users to authenticate through Flickr, after you get their access token, you can store it somewhere in the database, and you never have to ask that user to authenticate again.
You can obtain the access token in various ways:
-
using this gem’s [authentication proccess](github.com/janko-m/flickrie#authentication)
-
using my [flickr_auth](github.com/janko-m/flickr_auth) gem
-
using [omniauth](github.com/intridea/omniauth) with the [omniauth-flickr](github.com/timbreitkreutz/omniauth-flickr) strategy
Your API key. If you don’t have one already, you can apply for it [here](www.flickr.com/services/apps/create/apply) (you first have to sign in).
Time to wait for the connection to Flickr to open (in seconds). Otherwise ‘Faraday::Error::TimeoutError` is raised. If you’re in a web application, you may want to rescue this exception and display some custom error page (telling the user to try to load the page again, for example).
You may want to override this if you notice that your connection often timeouts.
Defaults to 3 seconds.
If you’re in a web application, and you want pagination with [will_paginate](github.com/mislav/will_paginate), you can specify it here.
Flickrie.pagination = :will_paginate
Now let’s assume you have a collection of photos
@photos = Flickrie.photos_from_set(2734243, per_page: 20, page: params[:page])
This collection is now paginated. You can now call in your ERB template:
“‘erb <%= will_paginate @photos %> “`
If you’re using this, be sure to include the ‘will_paginate’ gem in your ‘Gemfile`.
{Flickrie::Collection} has some basic pagination attributes by itself, these are independent of any pagination library.
@see Flickrie::Collection
Time to wait for the first block of response from Flickr to be read (in seconds). Otherwise ‘Faraday::Error::TimeoutError` is raised. If you’re in a web application, you may want to rescue this exception and display some custom error page (telling the user to try to load the page again, for example).
You may want to override this if you notice that your connection often timeouts.
Defaults to 4 seconds.
Public Class Methods
# File lib/flickrie.rb, line 124 def self.lookup_method(method) FLICKR_API_METHODS[method] end
# File lib/flickrie/collection.rb, line 8 def initialize(hash) current_page = Integer(hash['page']) per_page = Integer(hash['per_page'] || hash['perpage']) total_entries = Integer(hash['total']) super(current_page, per_page, total_entries) end