Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

geo-ip-json

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

geo-ip-json

  • 0.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

GeoIPJSON - GeoIP information as JSON via a rack app

A very simple rack app to provide Geo-location Information as JSON.

By default it returns the country code of the current client.

Alternatively, an ?ip=1.2.3.4 parameter can be supplied.

We are using this as a datasource for an AJAX call.

Install

Rails

In Gemfile

gem 'geo-ip-json'

In routes.rb

<AppName>::Application.routes.draw do
  match "/geoip.json", :to => GeoIPJson::App.new
end

Download the GeoIP database file from MaxMind (http://www.maxmind.com/)

Put it in the root of your Rails app (configurable location is coming)

Testing

Run rake test to run the tests. A Guardfile is present to use with Guard.

Thanks!

Steve England for the idea

Ruby GeoIP library which does most of the work!

FAQs

Package last updated on 06 Jul 2012

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc