Skip to content

Instantly share code, notes, and snippets.



Created Oct 17, 2012
What would you like to do?
zipplease sample in Ruby on Rails
post "demo/flicker"
gem 'uuid'
gem 'rest-client'
#Sample request
curl -X POST -H 'Content-Type:application/json' -d '["", ""]' -H 'Accept:application/json' http://localhost:3000/demo/flicker
class DemoController < ApplicationController
respond_to :json
@@uuid =
def flicker
images = params['_json']
# Create the JSON payload to send to ZipPlease
zipRequest = {
:accountKey => "6B5qClA0SG2er7x7PmZTK4QU", # Not real.
:accountSecret => "jHxRb2y3CevJyROL96hYKcE0oAI", # Get your own.
:zipName => "zipPleaseFlickrDemo_" + @@uuid.generate + ".zip",
:files => images,
:compress => false # already jpegs
response = '', zipRequest.to_json, :content_type => :json, :accept => :json
render :json => response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.