Hello,

  I've put together a factbook gem [1] that lets you read in World
Factbook country profile pages (in HTML) and returns a structured Ruby
hash that you can save, for example, as a pretty printed JSON file.
Example:

  Get country profile page for Brazil (br) as a hash (that is,
structured data e.g. nested key/values)

   page = Factbook::Page.new( 'br' )
   pp page.data          # pretty print hash

  Save to disk as JSON

   File.open( 'br.json', 'w') do |f|
     f.write page.to_json( pretty: true )
   end

  and so on.

  Find ready-to-use country profile in JSON in the
openmundi/factbook.json [2] repo.

  Thanks to the CIA for the great service (and public domain data - no
rights reserved, no copyright).

 Cheers.

[1] github.com/worlddb/factbook.ruby
[2] github.com/openmundi/factbook.json