Skip to content

Instantly share code, notes, and snippets.

Created January 11, 2013 15:45
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 9 You must be signed in to fork a gist
  • Save adamcooke/4511658 to your computer and use it in GitHub Desktop.
Save adamcooke/4511658 to your computer and use it in GitHub Desktop.
Export all your drops from CloudApp using this quick Ruby script
#!/usr/bin/env ruby
# A quick script to download all your files from CloudApp.
# To run this just run the script passing your e-mail & password
# to the script, for example:
# gem install cloudapp_api
# ruby cloudapp-export.rb mypassword
ROOT = File.expand_path('../cloudapp-export', __FILE__)
require 'fileutils'
require 'cloudapp_api'
CloudApp.authenticate(EMAIL_ADDRESS, PASSWORD)
returned_drops = nil
page = 1
until returned_drops && returned_drops < PER_PAGE
drops = CloudApp::Drop.all(:per_page => PER_PAGE, :page => page)
puts "Getting Page: #{page}"
for drop in drops
time = Time.parse(drop.created_at)
directory = File.join(ROOT, time.year.to_s, time.month.to_s,
path = File.join(directory,
if File.exist?(path)
puts " -> Skipping #{} (it already exists)"
puts " -> Downloading #{}", 'w') { |f| f.write(drop.raw) }
page += 1
returned_drops = drops.size
Copy link

rebyn commented Feb 24, 2013

Nifty. Would love to have options like downloading images only. And incremental filename of existing drops also :(.

Copy link

Strajk commented Aug 24, 2013

File could not be created if name of the drop contains : character
But thanks for great work!

Copy link

cggaurav commented May 1, 2022

/Library/Ruby/Gems/2.6.0/gems/json-1.8.6/lib/json/common.rb:155:in `parse': 822: unexpected token at '<!DOCTYPE html> (JSON::ParserError)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment