icamys / whois-parser Goto Github PK
View Code? Open in Web Editor NEWExtendable whois parser written in Go
License: Apache License 2.0
Extendable whois parser written in Go
License: Apache License 2.0
For automatically whois format changes detection
Example code:
package main
import (
"encoding/json"
"fmt"
whoisparser "github.com/icamys/whois-parser"
)
func main() {
domain := "italotreno.it"
whoisRaw := "Domain: italotreno.it\r\nStatus: ok\r\nSigned: no\r\nCreated: 2010-09-13 10:33:04\r\nLast Update: 2019-09-29 00:46:47\r\nExpire Date: 2020-09-13\r\n\r\nRegistrant\r\n Organization: Nuovo Trasporto Viaggiatori S.p.A.\r\n Address: Viale Del Policlinico 149/B\r\n Roma\r\n 00161\r\n RM\r\n IT\r\n Created: 2010-09-13 10:33:04\r\n Last Update: 2011-08-04 12:32:45\r\n\r\nAdmin Contact\r\n Name: Lucio Moriconi\r\n Organization: Nuovo Trasporto Viaggiatori S.p.A.\r\n Address: Viale Del Policlinico 149/B\r\n Roma\r\n 00161\r\n RM\r\n IT\r\n Created: 2010-09-13 10:33:04\r\n Last Update: 2015-06-10 11:30:13\r\n\r\nTechnical Contacts\r\n Name: Registrazione Domini\r\n Organization: I.NET S.p.A.\r\n Address: Via Darwin, 85\r\n Settimo Milanese\r\n 20019\r\n MI\r\n IT\r\n Created: 2002-11-08 00:00:00\r\n Last Update: 2011-08-04 12:33:12\r\n\r\nRegistrar\r\n Organization: BT Italia s.p.a.\r\n Name: BTITALIA-REG\r\n Web: http://www.btitalia.it\r\n DNSSEC: no\r\n\r\n\r\nNameservers\r\n venere.inet.it\r\n ns1a.btitalia.it\r\n ns2a.btitalia.it\r\n ns2.inet.it"
// whoisRecord is of Record type, see ./record.go
whoisRecord := whoisparser.Parse(domain, whoisRaw)
whois2b, _ := json.Marshal(whoisRecord)
fmt.Println(string(whois2b))
}
Output contains \r
in address:
{"registrar":{"created_date":"2010-09-13 10:33:04\r","domain_name":"italotreno.it\r","domain_status":"ok\r","expiration_date":"2020-09-13\r","updated_date":"2019-09-29 00:46:47\r"},"registrant":{"street":"Viale Del Policlinico 149/B\r","city":"Roma\r","province":"RM\r","postal_code":"00161\r","country":"IT\r"},"admin":{"street":"Viale Del Policlinico 149/B\r","city":"Roma\r","province":"RM\r","postal_code":"00161\r","country":"IT\r"},"tech":{"street":"Via Darwin, 85\r","city":"Settimo Milanese\r","province":"MI\r","postal_code":"20019\r","country":"IT\r"}}
Some whois responses contain admin contact urls. Maybe we should parse them too.
See example by querying:
# Pay attention to field "admin-contact"
$ whois salenames.ru
At the moment we've encountered such field only in one domain. If more domains return such field, we should add a new field to regex structures.
Domains with contact admin field:
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.