Created
May 24, 2013 23:46
-
-
Save jmontross/5647271 to your computer and use it in GitHub Desktop.
how to get more than 1000 s3 assets using fog gem in ruby
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
storage = Fog::Storage.new({:provider => 'AWS', :aws_access_key_id => ACCESS_KEY_ID, :aws_secret_access_key => SECRET_ACCESS_KEY}) | |
files = storage.get_bucket("lessonOverFlow",{'max-keys' =>'100000'}) | |
truncated = files.body['IsTruncated'] | |
the_response = files.body['Contents'] | |
while truncated | |
files = storage.get_bucket("lessonOverFlow",{'max-keys' =>'100000', 'marker' => files.body['Contents'].last["Key"]}) | |
truncated = files.body['IsTruncated'] | |
the_response = the_response + files.body['Contents'] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment