Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jtblin/ip2location

Simple client for the IP2Location API
https://github.com/jtblin/ip2location

Last synced: 19 days ago
JSON representation

Simple client for the IP2Location API

Awesome Lists containing this project

README

        

ip2location
===========

Description
-----------
This is a stupid simple client for [IP2LocationAPI](http://www.ip2locationapi.com/) written with [David Balatero](https://github.com/dbalatero)'s awesome [monster_mash](https://github.com/dbalatero/monster_mash) library. I wrote it more or less
as practice and to continue to familiarize myself with Ruby 1.9, RSpec, and Typhoeus.

Usage
--------
require 'ip2location'

# Ip2Location.api_key = YOUR_API_KEY
# Ip2Location.user = YOUR_API_USERNAME
#
# OR

Ip2Location.setup do |s|
s.api_key = YOUR_API_KEY
s.user = YOUR_API_USERNAME
end

puts Ip2Location.ip2l('8.8.8.8')
#=>

Requirements
------------
* monster_mash (~> 0.2.3)
* A username and API key from [IP2LocationAPI](http://www.ip2locationapi.com/geoip-location-api/signup.php) (free)

Install
-------
gem install ip2location

Copyright
---------
Copyright (c) 2011 Ezekiel Templin

See LICENSE.txt for details.