TheCountryIdentity
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:0x007ff9c3350600
@cache={},
@country_name="venezuela",
@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
- Fork it.
- Create your feature branch (
git checkout -b my-new-feature
). - Commit your changes (
git commit -am 'Added some feature'
). - Push to the branch (
git push origin my-new-feature
). - 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.