Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

flickr_collage

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flickr_collage

  • 0.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Flickr Collage

Flickr Collage queries the Flickr API for the top-rated image by search keywords and assembles a collage grid from this images to a new file.

Installation

You have to install ImageMagick. On Ubuntu for example, you can run:

sudo apt-get install libmagickwand-dev

For more details take a look at (https://github.com/rmagick/rmagick#prerequisites).

Installing via Bundler

Add this line to your application's Gemfile:

gem 'flickr_collage'

And then execute:

bundle

Installing via Rubygems

gem install flickr_collage

Installing from github

git clone https://github.com/plaschczek/flickr_collage
cd flickr_collage
bundle
rake install

Usage

First you have to initialize FlickRaw.api_key and FlickRaw.shared_secred.
For example export the following env vars:

export FLICKR_API_KEY='... Your API key ...'
export FLICKR_SHARED_SECRET='... Your shared secret ...'

Or in your Ruby file:

require 'flickr_collage'

FlickRaw.api_key="... Your API key ..."
FlickRaw.shared_secret="... Your shared secret ..."

Examples

To create a collage with 10 random images, instantiate a new FlickrCollage and save the image:

FlickrCollage.new.save

Full options example (9 images, 4 by keyword, 5 random in 2 rows as squares, saved as 'tmp/fruits_example.jpg'):

FlickrCollage.new(
  keywords: ['strawberry', 'kiwi', 'cherry', 'limes'],
  filename: 'fruits_example.jpg',
  dir: 'tmp',
  no_of_images: 9,
  rows: 2,
  squares: true
).save

Command Line Examples

The same full options example as before:

flickr_collage -k strawberry,kiwi,cherry,limes -f fruits_example.jpg -d tmp -n 9 -r 2 -s

And the command line help:

flickr_collage -h

Options

FlickrCollage.new(keywords:, filename:, dir:, no_of_images:, rows:, squares:)

    keywords: Array with keywords
    filename: collage filename, default 'collage.jpg'
         dir: directory to save the collage, has to exist, default '.'
no_of_images: number of images, default number of keywords and without keywords 10
        rows: number of collage rows, default sqrt(no_of_images).floor
     squares: boolean, if true images squared

License

The gem is available as open source under the terms of the MIT License.

FAQs

Package last updated on 27 Oct 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc