title: syntax error, unexpected end-of-input, expecting keyword_end
body: <p>I'm trying to write a simple program to parse JSON from the results of an API call. Very new to ruby and just can't figure this one out.</p>
  
  <p>Here's all the code:</p>
  
  <pre><code>require "rubygems"
  require "json"
  require "net/http"
  require "uri"
  
  uri = URI.parse("http://api.chartbeat.com/live/recent/v3/?apikey=eaafffb9a735796b6edd50fd31eaab69&amp;host=enactus.org")
  
  http = Net::HTTP.new(uri.host, uri.port)
  request = Net::HTTP::Get.new(uri.request_uri)
  
  response = http.request(request)
  
  if response.code == "200"
    result = JSON.parse(response.body)
  
    result.each do |doc|
      puts doc["id"] #reference properties like this
      puts doc # this is the result in object form    
      puts ""
      puts ""
    end
  else
    puts "ERROR!!!"
  end
  </code></pre>
  
  <p>Here's the output of running the program (chartbeat.rb):</p>
  
  <pre><code>chartbeat.rb:14: syntax error, unexpected end-of-input, expecting keyword_end
  </code></pre>
  
  <p>The program comes verbatim from here with the url replaced: <a href="https://gist.github.com/timsavery/1657351" rel="nofollow">https://gist.github.com/timsavery/1657351</a></p>