okor / whoiz Goto Github PK
View Code? Open in Web Editor NEWA whoiz lookup API application
A whoiz lookup API application
When the response is returned in JSON format, the expiry date is not present.
http://whoiz.herokuapp.com/lookup.json?url=yahoo.com
"\nWhois Server Version 2.0\n\nDomain names in the .com and .net domains can now be registered\nwith many different competing registrars. Go to http://www.internic.net\nfor detailed information.\n\n Server Name: YAHOO.COM.ZZZZZZZ.GET.ONE.MILLION.DOLLARS.AT.WWW.UNIMUNDI.COM\n IP Address: 209.126.190.70\n Registrar: PDR LTD. D/B/A PUBLICDOMAINREGISTRY.COM\n Whois Server: whois.PublicDomainRegistry.com\n Referral URL: http://www.PublicDomainRegistry.com\n\n Server Name: YAHOO.COM.ZZZZZZ.MORE.INFO.AT.WWW.BEYONDWHOIS.COM\n IP Address: 203.36.226.2\n Registrar: INSTRA CORPORATION PTY, LTD.\n Whois Server: whois.instra.net\n Referral URL: http://www.instra.com\n\n Server Name: YAHOO.COM.ZZZZZ.GET.LAID.AT.WWW.SWINGINGCOMMUNITY.COM\n IP Address: 69.41.185.196\n Registrar: TUCOWS DOMAINS INC.\n Whois Server: whois.tucows.com\n Referral URL: http://domainhelp.opensrs.net\n\n Server Name: YAHOO.COM.ZOMBIED.AND.HACKED.BY.WWW.WEB-HACK.COM\n IP Address: 217.107.217.167\n Registrar: DOMAINCONTEXT, INC.\n Whois Server: whois.domaincontext.com\n Referral URL: http://www.domaincontext.com\n\n Server Name: YAHOO.COM.VN\n Registrar: MELBOURNE IT, LTD. D/B/A INTERNET NAMES WORLDWIDE\n Whois Server: whois.melbourneit.com\n Referral URL: http://www.melbourneit.com\n\n Server Name: YAHOO.COM.VIRGINCHASSIS.COM\n IP Address: 66.218.71.205\n Registrar: DOMAIN.COM, LLC\n Whois Server: whois.domain.com\n Referral URL: http://www.domain.com\n\n Server Name: YAHOO.COM.TWIXTEARS.COM\n IP Address: 66.218.71.205\n Registrar: DOMAIN.COM, LLC\n Whois Server: whois.domain.com\n Referral URL: http://www.domain.com\n\n Server Name: YAHOO.COM.TW\n Registrar
This isn't JSON. Any plans on fixing this?
require 'open-uri'
require 'json'
url = "http://whoiz.herokuapp.com/lookup.json?url=google.co.jp"
buffer = open(url).read
result = JSON.parse(buffer)
results in:
/Users/samuel.nissen/.rvm/gems/ruby-2.0.0-p353/gems/json-1.8.1/lib/json/common.rb:155:in `parse': 757: unexpected token at '"[ JPRS database provides information on network administration. Its use is ]\r\n[ restricted to network administration purposes. For further information, ]\r\n[ use 'whois -h whois.jprs.jp help'. To suppress Japanese output, add'/e' ]\r\n[ at the end of command, e.g. 'whois -h whois.jprs.jp xxx/e'. ]\r\n[ ]\r\n[ Notice -------------------------------------------------------------------- ]\r\n[ JPRS will change JPRS WHOIS (web-based and port 43 Whois service) about the ]\r\n[ following two points on January 18, 2015. ]\r\n[ ]\r\n[ 1) Change of the format of response about gTLD domain name ]\r\n[ 2) Change of the character encoding ]\r\n[ ]\r\n[ For further information, please see the following webpage. ]\r\n[ http://jprs.jp/whatsnew/notice/2014/20140319-whois.html (only in Japanese) ]\r\n[ --------------------------------------------------------------------------- ]\r\n\r\nDomain Information:\r\na. [Domain Name] GOOGLE.CO.JP\r\ng. [Organization] Google Japan\r\nl. [Organization Type] corporation\r\nm. [Administrative Contact] DL152JP\r\nn. [Technical Contact] TW124137JP\r\np. [Name Server] ns1.google.com\r\np. [Name Server] ns2.google.com\r\np. [Name Server] ns3.google.com\r\np. [Name Server] ns4.google.com\r\ns. [Signing Key] \r\n[State] Connected (2015/03/31)\r\n[Registered Date] 2001/03/22\r\n[Connected Date] 2001/03/22\r\n[Last Update] 2014/04/01 01:18:23 (JST)\r\n\r\n"' (JSON::ParserError)
The raw JSON output is (quotes included):
"[ JPRS database provides information on network administration. Its use is ]\r\n[ restricted to network administration purposes. For further information, ]\r\n[ use 'whois -h whois.jprs.jp help'. To suppress Japanese output, add'/e' ]\r\n[ at the end of command, e.g. 'whois -h whois.jprs.jp xxx/e'. ]\r\n[ ]\r\n[ Notice -------------------------------------------------------------------- ]\r\n[ JPRS will change JPRS WHOIS (web-based and port 43 Whois service) about the ]\r\n[ following two points on January 18, 2015. ]\r\n[ ]\r\n[ 1) Change of the format of response about gTLD domain name ]\r\n[ 2) Change of the character encoding ]\r\n[ ]\r\n[ For further information, please see the following webpage. ]\r\n[ http://jprs.jp/whatsnew/notice/2014/20140319-whois.html (only in Japanese) ]\r\n[ --------------------------------------------------------------------------- ]\r\n\r\nDomain Information:\r\na. [Domain Name] GOOGLE.CO.JP\r\ng. [Organization] Google Japan\r\nl. [Organization Type] corporation\r\nm. [Administrative Contact] DL152JP\r\nn. [Technical Contact] TW124137JP\r\np. [Name Server] ns1.google.com\r\np. [Name Server] ns2.google.com\r\np. [Name Server] ns3.google.com\r\np. [Name Server] ns4.google.com\r\ns. [Signing Key] \r\n[State] Connected (2015/03/31)\r\n[Registered Date] 2001/03/22\r\n[Connected Date] 2001/03/22\r\n[Last Update] 2014/04/01 01:18:23 (JST)\r\n\r\n"
Delta compression using up to 4 threads.
Compressing objects: 100% (51/51), done.
Writing objects: 100% (104/104), 25.94 KiB | 0 bytes/s, done.
Total 104 (delta 43), reused 104 (delta 43)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rack
remote: !
remote: ! An error occurred while installing Ruby ruby-2.1.1
remote: ! For supported Ruby versions see https://devcenter.heroku.com/articles/ruby-support#supported-runtimes
remote: ! Note: Only the most recent version of Ruby 2.1 is supported on Cedar-14
remote: ! Command: 'set -o pipefail; curl --fail --retry 3 --retry-delay 1 --connect-timeout 3 --max-time 30 https://s3-external-1.amazonaws.com/heroku-buildpack-ruby/cedar-14/ruby-2.1.1.tgz -s -o - | tar zxf - ' failed unexpectedly:
remote: !
remote: ! gzip: stdin: unexpected end of file
remote: ! tar: Child returned status 1
remote: ! tar: Error is not recoverable: exiting now
remote: !
remote:
remote: ! Push rejected, failed to compile Ruby app
remote:
remote: Verifying deploy....
remote:
remote: ! Push rejected to afternoon-citadel-9202.
remote:
To *****
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to '*****'
I change the version to 2.1.7 and for now it work fine..
please consider to change the version
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.