A simple and free whois client written in Nim
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Thisago d28e91f3e3 Removed runnable example from `whois`; Removed builded example 5 days ago
apiReturns removed bin 7 days ago
example Added example; added how to run example; Added to readme the cache lib name for credits 5 days ago
src Removed runnable example from `whois`; Removed builded example 5 days ago
tests Added licence; added readme; removed useless imports of `strutils` in `src/whois/api_doyosi.nim`; fixed api call 5 days ago
.gitignore Removed runnable example from `whois`; Removed builded example 5 days ago
changelog.md Added changelog; Changed lib version; changed files headers 5 days ago
license Added licence; added readme; removed useless imports of `strutils` in `src/whois/api_doyosi.nim`; fixed api call 5 days ago
readme.md Added compatibility to version 1.4.0; added help to install with nimble using package name 5 days ago
whois.nimble Added changelog; Changed lib version; changed files headers 5 days ago

readme.md

Whois.nim

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


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://gitea.com/Thisago/whois.nim

or

Manually with Nimble

# Clone repo
git clone https://gitea.com/Thisago/whois.nim

# go to folder
cd whois

# Install (with Nimble)
nimble install -y

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


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.