Skip to content

Instantly share code, notes, and snippets.

@git-toni
Created November 15, 2014 19:52
Show Gist options
  • Save git-toni/705b2e550c782a0b4a62 to your computer and use it in GitHub Desktop.
Save git-toni/705b2e550c782a0b4a62 to your computer and use it in GitHub Desktop.
Rainforest challenge
#!/bin/env
require 'httparty'
require 'cgi'
require 'pry'
myid=995287801
200.times do |i|
begin
response=HTTParty.get("http://letsrevolutionizetesting.com/challenge.json?id=#{myid}")
json=JSON.parse(response.body)
query=URI.parse(json['follow']).query
cgi=CGI.parse(query)
myid=cgi['id'][0]
p "THE ID IS #{myid}"
p "COUNTER #{i}"
p response.body
p '----------'
rescue
binding.pry
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment