Skip to content

Instantly share code, notes, and snippets.

@bornfree
Last active December 22, 2015 19:49
Show Gist options
  • Save bornfree/6522488 to your computer and use it in GitHub Desktop.
Save bornfree/6522488 to your computer and use it in GitHub Desktop.
Talk to Rescuegroups
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