Code Monkey home page Code Monkey logo

r2flickr's Introduction

r2flickr

A Ruby implementation of the Flickr API.

It is a fork of rflickr, which is no longer maintained.

Includes a faithful reproduction of the published API as well as method encapsulation to provide more useful object mappings. As rflickr, it features result caching to improve performance, with addition to some bug fixes in the API implementation.

Installation

sudo gem install r2flickr

Documentation

API authentication

You’ll need to authorize your application’s API key for each account which you want to access. The process is described on the Flickr Authentication API page.

Here is a sample you can use to get started:

flickr = Flickr.new(token_cache_file, MY_APPLICATION_KEY, MY_SHARED_SECRET)

unless flickr.auth.token
  flickr.auth.getFrob
  url = @flickr.auth.login_link
  puts "You must visit #{url} to authorize this application. Press enter " \
    "when you have done so. This is the only time you will have to do this."
  gets
  flickr.auth.getToken
  flickr.auth.cache_token
end

# do flickr stuff now

The general idea is that once you cache the token, the user will not have to reauthorize your application unless the file where the token is cached (the first argument to the new method on Flickr) is deleted.

When you create a new Flickr instance and pass in a file path to the cached token, the API will attempt to load the token from the file. If found and loaded, the Flickr instance’s auth.token is present. If the token could not be found in the file specified, then the instance’s auth.token will be nil, and you will have to have the user authorize
the application before it can be used.

For convenience, you can set your API_KEY and SHARED_SECRET in the installed version of flickr/base.rb rather than including it in every application.

Source

http://github.com/markoa/r2flickr

git clone git://github.com/markoa/r2flickr.git

Contributing

If you find a bug, you can report it through the issues interface.

Feel free to fork, write code and send a pull request.

Authors

License

GPL. See LICENSE file for details.

r2flickr's People

Contributors

dustin avatar markoa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

dustin okonet

r2flickr's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.