Giter Site home page Giter Site logo

promptapi / whois_rb Goto Github PK

View Code? Open in Web Editor NEW
0.0 4.0 1.0 11 KB

Ruby package for Prompt API's Whois API

Home Page: https://promptapi.com/marketplace/description/whois-api

License: MIT License

Ruby 98.09% Shell 1.91%
promptapi api-marketplace api-wrapper whois whois-lookup domain-name-search domain-name-detection whois-information whoislookup whois-service whois-database whois-record registration-detail domain-registration

whois_rb's Introduction

Ruby Gem Version Build Status

Prompt API - Whois API - Ruby Package

whois_rb is a simple ruby wrapper for whois-api.

Requirements

  1. You need to signup for Prompt API
  2. You need to subscribe whois-api, test drive is free!!!
  3. You need to set PROMPTAPI_TOKEN environment variable after subscription.

then;

$ gem install whois_rb

or; install from GitHub:

$ gem install whois_rb --version "0.1.0" --source "https://rubygems.pkg.github.com/promptapi"

Example Usage

Check domain examples:

require 'whois_rb'

result = WhoisRb::check('promptapi.com')
# => {:result=>"registered"}

result = WhoisRb::check('promptapi.com', timeout=20)
# => {:result=>"registered"}

result = WhoisRb::check('foo')
# => {:error=>"Not a valid domain name"}

result = WhoisRb::check('promptapi123456.com')
# => {:result=>"available"}

Query domain examples:

require 'whois_rb'

result = WhoisRb::query('foo')
# => {:error=>"Not a valid domain name"}

result = WhoisRb::query('promptapi.com')
# => {
    :result=>{
        :domain_name=>"PROMPTAPI.COM", 
        :registrar=>"NameCheap, Inc.", 
        :whois_server=>"whois.namecheap.com", 
        :referral_url=>nil, 
        :updated_date=>"2020-05-27 22:19:36", 
        :creation_date=>"2020-04-19 15:11:52", 
        :expiration_date=>"2021-04-19 15:11:52", 
        :name_servers=>["APOLLO.NS.CLOUDFLARE.COM", "MARJORY.NS.CLOUDFLARE.COM"], 
        :status=>"clientTransferProhibited https://icann.org/epp#clientTransferProhibited", 
        :emails=>"[email protected]", 
        :dnssec=>"unsigned", 
        :name=>nil, 
        :org=>nil, 
        :address=>nil, 
        :city=>nil, 
        :state=>nil, 
        :zipcode=>nil, 
        :country=>nil
    }
}

result = WhoisRb::query('promptapi1234.com')
# => {:error=>"No match for promptapi1234.com"}

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake test to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org

$ rake -T

rake build            # Build whois_rb-0.0.0.gem into the pkg directory
rake bump[revision]   # Bump version
rake clean            # Remove any temporary products
rake clobber          # Remove any generated files
rake install          # Build and install whois_rb-0.0.0.gem into system gems
rake install:local    # Build and install whois_rb-0.0.0.gem into system gems without network access
rake push_to_github   # Push whois_rb-0.0.0.gem to GitHub registry
rake release[remote]  # Create tag v0.0.0 and build and push whois_rb-0.0.0.gem to rubygems.org
rake test             # Run tests

License

This project is licensed under MIT


Contributer(s)


Contribute

Bug reports and pull requests are welcome on GitHub:

  1. fork (https://github.com/promptapi/whois_rb/fork)
  2. Create your branch (git checkout -b my-feature)
  3. commit yours (git commit -am 'Add awesome features...')
  4. push your branch (git push origin my-feature)
  5. Than create a new Pull Request!

This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.


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.