GithubHelp home page GithubHelp logo

griffinqiu / ipip Goto Github PK

View Code? Open in Web Editor NEW

This project forked from liluo/ipip

0.0 2.0 0.0 3.15 MB

IP search based on IPIP.net

Home Page: http://liluo.github.com/ipip/

License: MIT License

Ruby 100.00%

ipip's Introduction

IPIP

Gem Version Build Status

IP search based on IPIP.net

Getting Started

Install the gem:

gem install ipip

Then use it in your application:

require 'ipip'
                                # => Format: "国家\t省份或直辖市\t地区或城市"

IPIP.find('127.0.0.1')          # => "本机地址\t本机地址\t\t"

IPIP.find('211.147.4.49')       # => "**\t北京\t北京\t"

IPIP.find('202.195.161.30')     # => "**\t江苏\t镇江\t"

IPIP.find('www.douban.com')     # => "**\t北京\t北京\t"

If you have DATX file(付费用户):

require 'ipip'

IPIPX.load_data!("/path/ipip.datx")

# => Format: "国家\t省份或直辖市\t地区或城市\t学校或单位\t运营商\t纬度\t经度\t时区1\t时区2\t行政代码.."

IPIPX.find('118.28.8.8')        # => "**\t天津\t天津\t\t鹏博士\t39.125596\t117.190182\tAsia/Shanghai\tUTC+8\t120000\t86\tCN\tAP"

IPIPX.find("58.82.112.15")      # => "**\t广东\t广州\t\t电信\t23.125178\t113.280637\tAsia/Shanghai\tUTC+8\t440100\t86\tCN\tAP"

IPIPX.find("60.191.8.80")       # => "**\t浙江\t杭州\t\t电信\t30.287459\t120.153576\tAsia/Shanghai\tUTC+8\t330100\t86\tCN\tAP"

IPIPX.find("114.114.114.114")   # => "114DNS\t114DNS\t\tgreatbit.com\t\t\t\t\t\t\t\t*\t*"

You can try running ipip [ip | domain]:

$ ipip 202.195.161.30
Location for 202.195.161.30: **       江苏    镇江

$ ipip douban.com
Location for douban.com: **   北京    北京

Contributing

  • Fork the repository.
  • Create a topic branch.
  • Implement your feature or bug fix.
  • Add, commit, and push your changes.
  • Submit a pull request.

ChangeLog

ChangeLog

License

Released under the MIT license.

ipip's People

Contributors

liluo avatar

Watchers

Griffin Qiu avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.