Giter Club home page Giter Club logo

flickr_etv's Introduction

FlickrEtv

FlickrEtv is a Ruby gem, it allows:

  • Accepts a list of search keywords as arguments
  • Queries the Flickr API for the top-rated image for each keyword
  • Downloads the results
  • Crops them rectangularly
  • Assembles a collage grid from ten images and
  • Writes the result to a user-supplied filename

Dependencies

This gem depends on:

Before to bundle you have to install ImageMagick. On OSX, you can install ImageMagick with brew:

$ brew install imagemagick

Gem setup

To use the Flickr API you need a Flickr API key.

If you don't have a Flickr API key you can get one from here.

The gem reads the Flickr API key from the environment variables so you have a to define it:

$ export FLICKR_API_KEY="Your Flickr API key"
$ export FLICKR_SHARED_SECRET="Your Flickr shared secret"

Now we can install the needed gems:

$ bundle install

Testing the gem

The gem uses rspec so just type:

$ rspec

Building and Installing

The gem uses Rake tasks to build and install the gem:

$ rake build
$ rake install

Now wecan run FlickrEtv.

Run

FlickrEtv offers a command line interface.

To check the arguments accepted run:

$ flickr_etv -h

Example:

If we want to create a collage with the following keywords: "Winter, Summer, Brexit" we need to type:

$ flickr_etv -f MyNewCollage.jpg -k "Winter,Summer,Brexit"

That command will fetch for each keyword the top-rated image and fetch 7 images based on random keywords from /usr/share/dict/words

The final collage will be saved to MyNewCollage.jpg

flickr_etv's People

Contributors

leviorca avatar

Watchers

 avatar

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.