Last active
December 22, 2015 19:49
-
-
Save bornfree/6522488 to your computer and use it in GitHub Desktop.
Talk to Rescuegroups
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
Rescuegroups.configure do |config| | |
config.api_key = "AAAAAA" | |
end | |
client = Rescuegroups::Client.new :object_type => "animals", :object_action => "publicSearch" | |
client.set_fields ['animalName', 'animalID', 'animalBreed'] | |
AnimalsData.limit(500).skip(100).each do |animal| | |
sleep(0.5) # Please suggest value to put here | |
client.clear_filters | |
client.set_filter 'animalStatus', :eq, "Available" | |
client.set_filter 'animalID', :eq, animal.animalID | |
begin | |
resp = client.query | |
puts (resp["data"] != [])? "." : "#{animal.name} ------------Deleted" | |
rescue Exception => e | |
puts e.message | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment