rb-urlvoid

Yet another Ruby Gem for URLVoid API.

Installation

Add this line to your application's Gemfile:

gem 'rb-urlvoid'

And then execute:

$ bundle

Or install it yourself as:

$ gem install rb-urlvoid
$ urlvoid [options]

Create your configuration file

$ urlvoid create_config

Edit your configuration file with API KEY

$ $EDITOR ~/.urlvoid.yml

Alternatively you can set Environment variables without a config file

$ export URLVOID_API_KEY=<YOUR_API_KEY_HERE>

CLI Usage

Retrieve information about a specific website

$ urlvoid info malicious.com
=>
{
  "details": {
    "host": "malicious.com",
    "updated": "1486047152",
    "http_response_code": "0",
    "domain_age": "808372800",
    "google_page_rank": "0",
    "alexa_rank": "0",
    "connect_time": "0",
    "header_size": "0",
    "download_size": "0",
    "speed_download": "0",
    "external_url_redirect": null,
    "ip": {
      "addr": "93.184.216.34",
      "hostname": null,
      "asn": "15133",
      "asname": "EdgeCast Networks, Inc.",
      "country_code": "US",
      "country_name": "United States",
      "region_name": "Massachusetts",
      "city_name": "Norwell",
      "continent_code": "NA",
      "continent_name": "North America",
      "latitude": "42.1508",
      "longitude": "-70.8228"
    }
  },
  "detections": {
    "engines": [
      "BitDefender",
      "Fortinet"
    ],
    "count": "2"
  },
  "page_load": "0.01"
}

Rescan of a specific website

$ urlvoid rescan example.com
=>
{
  "details": {
    "host": "example.com",
    "updated": "1486798381",
    "http_response_code": "0",
    "domain_age": "808372800",
    "google_page_rank": "0",
    "alexa_rank": "0",
    "connect_time": "0",
    "header_size": "0",
    "download_size": "0",
    "speed_download": "0",
    "external_url_redirect": null,
    "ip": {
      "addr": "93.184.216.34",
      "hostname": null,
      "asn": "15133",
      "asname": "EdgeCast Networks, Inc.",
      "country_code": "US",
      "country_name": "United States",
      "region_name": "Massachusetts",
      "city_name": "Norwell",
      "continent_code": "NA",
      "continent_name": "North America",
      "latitude": "42.1508",
      "longitude": "-70.8228"
    }
  },
  "action_result": "OK",
  "page_load": "20.38"
}

Scan a new website not present in the URLVoid's database

$ urlvoid new_sacan unkown.com
=>
{
  "page_load": "0.01"
}

** Get the number of queries remained **

$ urlvoid stats
=> Remained queries: 973

API Usage

require 'urlvoid'

# Retrieve information about a specific website
result = URLVoid::Host.info "example.com"
# => Returns API response as a Hash

# Rescan of a specific website
result = URLVoid::Host.rescan "example.com"
# => Returns API response as a Hash

# Scan a new website not present in the URLVoid's database
result = URLVoid::Host.new_scan "example.com"
# => Returns API response as a Hash

# Get the number of queries remained
result = URLVoid::Stats.remained_queries
# => Returns API response as a Integer

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/ninoseki/rb-urlvoid. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.