Skip to content

Instantly share code, notes, and snippets.

@mikesten
Forked from adamcarlile/mondo.rb
Last active February 29, 2016 13:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikesten/75b8776f15ada1e44c5b to your computer and use it in GitHub Desktop.
Save mikesten/75b8776f15ada1e44c5b to your computer and use it in GitHub Desktop.
require 'faraday'
require 'launchy'
conn = Faraday.new(url: 'https://www.crowdcube.com') do |faraday|
faraday.adapter Faraday.default_adapter # make requests with Net::HTTP
faraday.options.timeout = 5
faraday.options.open_timeout = 2
end
success = false
until success
begin
response = conn.get('/investment/mondo-20857')
success = response.success?
puts response.status
rescue => e
puts e
ensure
sleep 1
end
end
Launchy.open 'https://www.crowdcube.com/investment/mondo-20857'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment