Skip to content

Instantly share code, notes, and snippets.

@neovintage
Created November 21, 2013 18:05
Show Gist options
  • Select an option

  • Save neovintage/7586530 to your computer and use it in GitHub Desktop.

Select an option

Save neovintage/7586530 to your computer and use it in GitHub Desktop.

Revisions

  1. neovintage created this gist Nov 21, 2013.
    20 changes: 20 additions & 0 deletions script.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    # Background:
    # I followed the initial url and your message suggested that I try json instead.
    # Using that, I hit the initial page and tagged '.json' on to the url. You had
    # mentioned in your job description that you were using rails so I figured I could
    # do that in the URL instead of using the accept headers.
    #
    require 'rest-client'
    require 'json'


    result = RestClient.get('http://letsrevolutionizetesting.com/challenge', :accept => :json)
    JSON.parse(result)

    while !result['follow'].nil? do
    result = RestClient.get(result['follow'], :accept => :json)
    result = JSON.parse(result)
    puts result
    end