Created
October 3, 2012 06:34
-
-
Save datapolitical/3825421 to your computer and use it in GitHub Desktop.
MashapeBinariesExample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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