input is ip output is city ,isp.
Add this line to your application's Gemfile:
gem 'ip2cityisp'
And then execute:
$ bundle
Or install it yourself as:
$ gem install ip2cityisp
require 'rubygems' require 'bundler/setup' require 'ip2cityisp' ip = ARGV[0] @db = Ip2cityisp::Database.new('/tmp/ipinfo.data') r = @db.query('8.8.8.8') rip = r["area"]+r["isp"]
- Fork it ( https://github.com/[my-github-username]/ip2cityisp/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 a new Pull Request