Asynchronous photo upload

Janko Marohnić edited this page May 16, 2012 · 2 revisions

Asynchronous photo upload

ticket_ids = [
  Flickrie.upload("/path/to/photo1.jpg", :title => "A cow", :async => 1),
  Flickrie.upload("/path/to/photo2.jpg", :title => "Another cow", :async => 1)
]
sleep(10)

tickets = Flickrie.check_upload_tickets(ticket_ids.join(','))
complete_tickets = tickets.select { |ticket| ticket.complete? }
first_photo_id = complete_tickets.first.photo_id
first_photo = Flickrie.get_photo_info(photo_id)

puts "This photo was uploaded first: #{first_photo.title}"
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.