TheCountryIdentity

Gem Version Build Status Coverage Status

Introducing the_country_identity, a CIA World Factbook crawler gem, honoring The Bourne Series.

The source of information is a RDF Turtle endpoint served from the D2R Server for the CIA Factbook hosted by the Research Group Data and Web Science at the University of Mannheim, Germany. In case you get no information from an existing country try here or here to see if this server is alive.

This is experimental software, you can use it on production at your own risk.

Installation

Add this line to your application's Gemfile:

gem 'the_country_identity'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install the_country_identity

Usage

> country = TheCountryIdentity::RDF.new('venezuela')
=> #<TheCountryIdentity::RDF:0x007faaabaa1c40
   @country_name="venezuela",
   @data={},
   @repo=#<RDF::Repository:0x3fd555d50c54()>,
   @url="http://wifo5-03.informatik.uni-mannheim.de/factbook/data/venezuela">

> country.get_property('lifeexpectancyatbirth_totalpopulation')
=> "73.28E0"

You can find all the country property keys here and a running example on a rails application here.

  • Note: properties will be lazy returned, so a request to the RDF server will be fired only at the first execution of get_property method.

Roadmap

  • Implement HTML request approach.

Contributing

  1. Fork it.
  2. Create your feature branch (git checkout -b my-new-feature).
  3. Commit your changes (git commit -am 'Added some feature').
  4. Push to the branch (git push origin my-new-feature).
  5. Create new Pull Request.

License

© 2012 by Raul Pino for Alphadeville, published under MIT license.

Some portions of this software corresponds to © 2012 Alex Oberhauser MIT license in a previous version.