-
-
Save treeder/780f46512e96e0675782 to your computer and use it in GitHub Desktop.
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
rest = Rest::Client.new | |
images = JSON.parse(rest.get("https://unsplash.it/list").body) | |
client = IronWorker::Client.new() | |
images.each_with_index do |im,i| | |
puts "Queuing task for image #{i}" | |
payload = IronWorker.payload | |
payload = payload.merge({ | |
image_url: "https://unsplash.it/200/300?image=#{im['id']}", | |
operations: [ | |
{ | |
op: 'sketch', | |
format: 'jpg', | |
destination: "image_#{im['id']}" | |
} | |
] | |
}) | |
task = client.tasks.create('USERNAME/image_processor', payload) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment