GithubHelp home page GithubHelp logo

thisago / whois Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 477 KB

A simple and free whois client

Home Page: https://thisago.github.io/whois/whois.html

License: MIT License

Nim 100.00%
nim whois whois-lookup whois-client

whois's Introduction

Whois.nim

The Whois.nim is a simple whois client. With cache (kashae)!

The doyosi whois demo website is down, to use this lib you will need an instance of that


Requirements

  • The Nim (Official website) programming language (Min version 1.4.0)
  • Nimble (Github), the Nim's package manager

Hint: Install Nim with Choosenim (Github)

Installation

Directly with Nimble

# Install directly with Nimble
nimble install whois

or

Directly with Nimble (with url)

# Install directly with Nimble (with url)
nimble install https://github.com/thisago/whois.nim

or

Manually with Nimble

# Clone repo
git clone https://github.com/thisago/whois.nim

# go to folder
cd whois

# Install (with Nimble)
nimble install -y

Docs

You can find the docs in Github pages

Usage

example/example.nim

import whois

echo whois("duckduckgo.com")

# or

var domain = "metager.org".toDomain # convert to a `Domain` instance
domain.update() # Get data from API

echo domain

Run:

nim c -r -d:ssl -d:release example/example.nim

NOTE: Compile with -d:ssl

TODO

  • Change the nimble package url from gitea to github

Contributing

Its easy to create a parser for another API!

Just see src/whois/api_doyosi.nim to understand how simple is it.

All definitions is in src/whois/core.nim.

  • Create a new file in src/whois/ called api_APINAME.nim
  • Import module src/whois/core.nim
  • Export a function named apiFetch
  • In src/whois.nim
    • Import the new api parser using:
      from whois/api_APINAME.nim import nil
    • Call the apiFetch function in update in end like:
      if api_APINAME.apiFetch(self, noCache): return # If any error, try next API

NOTICE

The implemented API service has no relation with this lib.

whois's People

Contributors

thisago avatar

Stargazers

 avatar

Watchers

 avatar  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.