Created
January 20, 2014 19:55
-
-
Save sumitngupta/8527817 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
namespace :quotes do | |
desc 'Import data from the Ted API' | |
task :import_data => :environment do | |
# here is where you put the code to hit your Quote model. | |
still_has_data = true | |
page = 0 | |
while still_has_data do | |
Quote.save_data_from_api(do something with the page variable to move the offset here) | |
# if your response has no more results, set still_has_data to false | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment