flickrex v0.2.0 Flickrex
Flickr client library for Elixir.
Configuration
config :flickrex, :oauth, [
consumer_key: "...",
consumer_secret: "...",
]
Examples
flickrex = Flickrex.new
token = Flickrex.get_request_token(flickrex)
auth_url = Flickrex.get_authorize_url(token)
# Open the URL in your browser, authorize the app, and get the verify token
verify = "..."
flickrex = Flickrex.fetch_access_token(flickrex, token, verify)
login = Flickr.Test.login(flickrex)
Summary
Functions
Updates the config of a Flickrex client
Fetches an access token from Flickr and updates the config
Makes a GET request to the Flickr REST endpoint
Generates a Flickr authorization page URL for a user
Gets a temporary token to authenticate the user to your application
Creates a Flickrex client using the application config
Creates a Flickrex client using the provided config
Makes a POST request to the Flickr REST endpoint
Types
Functions
Updates the config of a Flickrex client
Examples:
tokens = [access_token: "...", access_token_secret: "..."]
flickrex = Flickrex.new |> Flickrex.config(tokens)
fetch_access_token(Flickrex.Config.t, Flickrex.RequestToken.t, binary) :: Flickrex.Config.t
Fetches an access token from Flickr and updates the config
The function takes an existing Flickrex config, a request token, and a verify token generated by the Flickr authorization page.
Examples:
flickrex = Flickrex.fetch_access_token(flickrex, token, verify)
Makes a GET request to the Flickr REST endpoint
Examples:
response = Flickrex.get(flickrex, "flickr.photos.getRecent", per_page: 5)
Generates a Flickr authorization page URL for a user
Examples:
token = Flickrex.get_request_token(flickrex)
auth_url = Flickrex.get_authorize_url(token)
get_authorize_url(Flickrex.RequestToken.t, Keyword.t) :: binary
Gets a temporary token to authenticate the user to your application
Options
oauth_callback- For web apps, the URL to redirect the user back to after authentication.
get_request_token(Flickrex.Config.t, Keyword.t) :: Flickrex.RequestToken.t
Creates a Flickrex client using the application config
Creates a Flickrex client using the provided config
The accepted parameters are:
:consumer_token- Flickr API key:consumer_secret- Flicrkr API shared secret:access_token- Per-user access token:access_token_secret- Per-user access token secret