Skip to content

Instantly share code, notes, and snippets.

@treeder treeder/batch.rb Secret
Last active Dec 7, 2015

Embed
What would you like to do?
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
You can’t perform that action at this time.