Skip to content

Instantly share code, notes, and snippets.

@theist
Created December 20, 2015 21:37
Show Gist options
  • Select an option

  • Save theist/6e88ee39638fa4dcace7 to your computer and use it in GitHub Desktop.

Select an option

Save theist/6e88ee39638fa4dcace7 to your computer and use it in GitHub Desktop.
require "net/http"
require "json"
url = "http://resultadosgenerales2015.interior.es/congreso/results/ES201512-CON-ES/ES/info.json"
j=JSON.parse(Net::HTTP.get(URI(url)))
j['results']['parties'].each do |pa|
puts "#{pa['acronym']}: #{pa['seats']}" if pa['seats'] > 0
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment