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
This gem depends on:
- Ruby v2.3.1
- Flickraw
- ImageMagick
Before to bundle you have to install ImageMagick. On OSX, you can install ImageMagick with brew:
$ brew install imagemagick
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
The gem uses rspec so just type:
$ rspec
The gem uses Rake tasks to build and install the gem:
$ rake build
$ rake install
Now wecan run FlickrEtv.
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