Skip to content

Instantly share code, notes, and snippets.

@adamcarlile
Last active February 29, 2016 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save adamcarlile/4df73ba8cbf7ecfc50d6 to your computer and use it in GitHub Desktop.
Save adamcarlile/4df73ba8cbf7ecfc50d6 to your computer and use it in GitHub Desktop.
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