Socket
Book a DemoInstallSign in
Socket

ipaddresslabs

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ipaddresslabs

0.0.2
bundlerRubygems
Version published
Maintainers
1
Created
Source

Code Climate

Ipaddresslabs

Any available API in the world deserves a wrapper gem right?

Installation

Add this line to your application's Gemfile:

gem 'ipaddresslabs'

And then execute:

$ bundle

Or install it yourself as:

$ gem install ipaddresslabs

Usage

You can call locate method like this:

Ipaddresslabs.locate("177.142.170.45")

And it will return a JSON object like this:

{
    "query_status" : {
    "query_status_code" : "OK",
    "query_status_description" : "Query successfully performed."
},
    "ip_address" : "177.142.170.45",
    "geolocation_data" : {
        "continent_code" : "SA",
        "continent_name" : "South America",
        "country_code_iso3166alpha3" : "BRA",
        "country_code_iso3166alpha2" : "BR",
        "country_code_iso3166numeric" : "76",
        "country_code_fips10-4" : "BR",
        "country_name" : "Brazil",
        "region_code" : "BR21",
        "region_name" : "Rio de Janeiro",
        "city" : "Rio De Janeiro",
        "postal_code" : "-",
        "metro_code" : "-",
        "area_code" : "-",
        "latitude" : -22.9,
        "longitude" : -43.2333,
        "isp" : "Virtua",
        "organization" : "Virtua"
    }
}

You need to set an environment variable to get this work:

ENV["IPADDRESSLABS_KEY"] = "your_ipaddresslabs_key"

Or set in secrets.yml file

development:
  ipaddresslabs_key: your_ipaddresslabs_key
test:
  ipaddresslabs_key: your_ipaddresslabs_key
production:
  ipaddresslabs_key: your_ipaddresslabs_key

Contributing

  • Fork it ( http://github.com//ipaddresslabs/fork )
  • Create your feature branch (git checkout -b my-new-feature)
  • Commit your changes (git commit -am 'Add some feature')
  • Push to the branch (git push origin my-new-feature)
  • Create new Pull Request

FAQs

Package last updated on 04 May 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.