Skip to content

Instantly share code, notes, and snippets.

@datapolitical
Created October 3, 2012 06:34
Show Gist options
  • Save datapolitical/3825421 to your computer and use it in GitHub Desktop.
Save datapolitical/3825421 to your computer and use it in GitHub Desktop.
MashapeBinariesExample
require File.join(File.dirname(__FILE__), "Instafilterio.rb")
# basic instantiation. TODO Put your authentication keys here.
obj = Instafilterio.new("PUBLIC-KEY", "PRIVATE-KEY")
# We're consuming this endpoint: https://www.mashape.com/thefosk/instafilter-io#Black-White
response = obj.blackWhite(File.new('/Users/mashape/Desktop/gioconda.jpeg', 'rb'))
# Let's save the binary response in a file
File.open('/Users/marco/Desktop/gioconda_output.jpeg', 'w') {|f| f.write(response.body) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment