Last active
February 29, 2016 13:55
-
-
Save adamcarlile/4df73ba8cbf7ecfc50d6 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
require 'faraday' | |
conn = Faraday.new(url: 'https://www.crowdcube.com') do |faraday| | |
faraday.adapter Faraday.default_adapter # make requests with Net::HTTP | |
end | |
success = false | |
until success | |
begin | |
response = conn.get('/investment/mondo-20857') | |
success = response.success? | |
puts "[#{Time.now}] #{response.status}" | |
rescue => e | |
puts "[#{Time.now}] #{e}" | |
ensure | |
sleep 1 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment