Project

flicket

0.01
No commit activity in last 3 years
No release in over 3 years
Command line tool to create collages of flickr images
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.11
~> 0.10.3
~> 10.0
~> 3.0
~> 3.0.3
~> 2.1.0

Runtime

= 0.9.8
~> 4.5.1
 Project Readme

Flicket

Build Status

About

Flicket is a ruby command line tool that:

  • 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

If given less than ten keywords, or if any keyword fails to result in a match, it retrieves random words from a dictionary source such as /usr/share/dict/words. Repeating as necessary until you have gathered ten images.

Usage

  1. Install ImageMagick. On OS X it can be done with Homebrew brew install imagemagick.
  2. Obtain flickr API key from https://www.flickr.com/services/apps/create/apply
  3. Export them as environment variables
export FLICKR_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # Replace with your key
export FLICKR_SECRET=xxxxxxxxxxxxxxxx # Replace with your secret
  1. Install Flicket: gem install flicket
  2. Generate some collages: flicket dog cat doormat

NB! Output filename can be provided with --output or -o e.g. flicket -o mycollage.png tree river bratwurst

Development

Most of the code is covered with tests using RSpec. VCR is used to avoid hitting Flickr api every time and to speed up tests.

  1. Clone the repo git clone https://github.com/madis/flicket
  2. Install dependencies cd flicket && bundle install
  3. Run tests rspec

Layouts

Layouts can be defined in LayoutCalculator. Example layout is defined.

LAYOUT = [
  [0,1,2,3],
  [4,5,6,3],
  [4,7,8,9]
]

10 image layout

The numbers in the matrix are cell names. To mark bigger cell, e.g. cell 4 that is double the height of single cell, use same name in consequtive rows. Layout calculator will crop and resize automatically

NB The LayoutCalculator may not handle more complex layouts correctly in its initial incarnation. It is mainly here as a starting point and a direction for future development.

Example

flicket -o collage.png flower powerlifter programmer snoop snow nature sunset computer guitar woman

example collage