
Security News
New Website “Is It Really FOSS?” Tracks Transparency in Open Source Distribution Models
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Gem for accessing whoisxmlapi.com based on httparty and mongoid
Add this line to your application's Gemfile:
gem 'whoisxmlapi'
And then execute:
$ bundle
Or install it yourself as:
$ gem install whoisxmlapi
Whois
# config/initializers/whoisxmlapi.rb
WhoisXMLAPI.configure do |config|
config.username = ENV['WHOISXMLAPI_USERNAME']
config.password = ENV['WHOISXMLAPI_PASSWORD']
config.cache = true
config.cache_length = 1.minute
end
# elsewhere
wc = WhoisXMLAPI::Client.new
y = wc.whois("google.com")
# y should now be a WhoisXMLAPI::Result (or an exeption was thrown)
y.registrant.email
Associate your model with a whois record:
has_one :whois, as: :whoisable, autosave: true, class_name: "WhoisXMLAPI::Result"
Now we can get at the data:
myinstance.whois.registrant.email
RWhois
z = wc.rwhois(cmaujean@brandle.net)
z.domains
Associate your model with a rwhois record:
has_one :rwhois, as: :rwhoisable, autosave: true, class_name: "WhoisXMLAPI::RWhoisResult"
Account Balance
Check your whoisxmlapi credits:
balance = wc.account_balance
# {
# "balance"=>"464",
# "reserve"=>"500",
# "monthly_balance"=>"0",
# "monthly_reserve"=>"0",
# "reverse_whois_balance"=>"0",
# "reverse_whois_reserve"=>"0",
# "reverse_whois_monthly_balance"=>"0",
# "reverse_whois_monthly_reserve"=>"0",
# "ba_query_balance"=>nil,
# "ba_query_reserve"=>nil,
# "ra_query_balance"=>nil,
# "ra_query_reserve"=>nil,
# "ds_query_balance"=>nil,
# "ds_query_reserve"=>nil
# }
Callbacks
You can add callbacks to your whois and rwhois calls via the initializer:
config.callbacks[:whois] << Proc.new { SystemCumulativeStats.increment_whoisxmlapi_requests }
config.callbacks[:rwhois] << Proc.new { SystemCumulativeStats.increment_rwhoisxmlapi_requests }
The callbacks will be called after the request to whoisxmlapi.com has been made. NOTE: Callback arguments are not currently supported.
Exists
Boolean check to see if a domain is registered.
wc.exists("foo.com")
#=> true
wc.exists("sdflsdfhwetewrw.com")
#=> false
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that whoisxmlapi demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.