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

fccc

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fccc

  • 0.1.2
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

fccc - Flickr Collage Coding Challenge

Code Climate

Features

Basic

Ruby command line application 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
  • adds suffix to filename if user-supplied one already exists.
  • If given less than ten keywords, or if any keyword fails to result in a match, retrieves random words from a dictionary source and repeats as necessary until it has gathered ten images.

Additional features

  • Wrapped in a Gem and installable from Github repo.
  • You can provide keywords either as arguments or from a file.

Installation

Requirements

  • Ruby 2.2.x or 2.3.x
    • apt-get install ruby ruby-dev (Ubuntu)
  • ImageMagick
    • brew install imagemagick && brew install pkg-config (Mac OSX)
    • apt-get install imagemagick libmagickcore-dev libmagickwand-dev (Ubuntu)
  • Bundler
    • gem install bundler

Install fccc

There are three ways to install fccc:

  • Install from Github (Recommended)
  • Install locally
  • Just as a Ruby script
Install from Github

First, create Gemfile in your current directory. Gemfile should be like this.

# Gemfile
source 'https://rubygems.org'
gem 'fccc', :git => 'http://github.com/AkihikoITOH/fccc.git'

Then, run

$ bundle install

to install fccc.

Install locally

You can also build gem and install it locally.

$ git clone https://github.com/AkihikoITOH/fccc.git
$ cd fccc && gem build fccc.gemspec
$ gem install fccc-0.1.0.gem
Just as a ruby script

You can also use fccc by simply downloading file from Github.

$ git clone https://github.com/AkihikoITOH/fccc.git
$ cd fccc
$ ruby lib/fccc.rb

Usage

First, you need to put credentials.yml containing api_key and shared_secret of Flickr API in your current directory(in which you will run fccc command).

credentials.yml should be like this.

api_key: yourapikeyhere
shared_secret: yoursecretkeyhere
# As a command line application
$ fccc collage [keyword1, keyword2, ..., keyword10] --output [output_filename]
# If it doesn't work, you can try another way
$ bundle exec fccc collage [keyword1, keyword2, ..., keyword10] --output [output_filename]

# As a Ruby script
$ cd fccc/
$ ruby lib/fccc.rb collage keyword1, keyword2, ..., keyword10 --output filename

Example

# Basic
$ fccc collage dog, cat, lion, tiger, beetle, bee, salmon, mackerel, Kyoto, Hamburg --output mycollage

# If you have a list of keywords in a file, you can use it as input instead of giving them as arguments.
$ fccc collage --input keywords.txt --credential credentials.yml --output mycollage

keywords.txt should be like this.

dog
cat
lion
tiger
beetle
bee
salmon
mackerel
Kyoto
Hamburg

License

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

FAQs

Package last updated on 01 Jun 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