Giter Club home page Giter Club logo

whois's Introduction

#Whois

This library presents whois information for domains in a variety of TLD's through a standardized API (see example below).

##Installation

sudo gem install jm81-whois

##Example

domain.name         #=> "example.com"
domain.expires_on   #=> 2011-08-13 <Date>
domain.created_on   #=> 1995-08-14 <Date>
domain.updated_on   #=> 2004-03-26 <Date>
domain.database_updated_at #=> Mon Sep 28 23:44:55 UTC 2009 <Time>
domain.status       #=> ["clientDeleteProhibited", "clientTransferProhibited", "clientUpdateProhibited"]
domain.name_servers   #=> ["A.IANA-SERVERS.NET", "B.IANA-SERVERS.NET"]
domain.registrar_name #=> "RESERVED-INTERNET ASSIGNED NUMBERS AUTHORITY"
domain.whois_server   #=> "whois.iana.org"
domain.available?   #=> false
domain.registered?  #=> true
domain.expired?     #=> false

domain.raw # Raw whois information

domain.to_s # Key value pairs of anything that looks like an attribute.
            # Especially useful for non-API information, such as registrant
            # data.

##Code layout

Since pretty much every TLD has a different whois format, the various classes (which inherit from Domain::Base) in the Domain module (files in domain folder) have the following:

  • HOST constant: the host name of the whois server
  • ATTR_MATCH constant: A regular expression with two groups, that matches each key value pair line in the raw whois data. The first group is the key, the second group is the value.
  • ATTR_NAMES constant: Hash where the key represents a method name of the API and value in the text of the key in the raw data (the first group of the ATTR_MATCH regexp).
  • responds_to : list of the TLDs that this class provides whois data for. ( responds_to :biz, :us, :travel )

Methods in Base may be overriden in case that the above constants are insufficient (particular likely for lists of values, such as status and nameservers.

##Note on Tests

Tests are against actual whois data and thus are somewhat brittle, especially expires_at and updated_at.

##TODO

  • Whois information for:
    • Registrars
    • Nameservers
  • Additional TLD's
  • Standardized access of registrant data

whois's People

Stargazers

 avatar

Watchers

 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.