Interpretando a saída bruta do WHOIS

1

Estou tentando interpretar os dados do WHOIS que foram enviados usando um serviço personalizado. Os dados são assim:

{
  "rawText": "MarkMonitor is the Global Leader in Online Brand Protection.\r\n\r\nDomain Management\r\nMarkMonitor Brand Protection\u2122\r\nMarkMonitor AntiPiracy\u2122\r\nMarkMonitor AntiFraud\u2122\r\nP
rofessional and Managed Services\r\n\r\nVisit MarkMonitor at www.markmonitor.com\r\nContact us at 1 (800) 745-9229\r\nIn Europe, at +44 (0) 203 206 2220\r\n\r\nThe Data in MarkMonitor.com's WHOIS database 
is provided by MarkMonitor.com\r\nfor information purposes, and to assist persons in obtaining information\r\nabout or related to a domain name registration record.  MarkMonitor.com\r\ndoes not guarantee i
ts accuracy.  By submitting a WHOIS query, you agree\r\nthat you will use this Data only for lawful purposes and that, under no\r\ncircumstances will you use this Data to: (1) allow, enable, or otherwise\r
\nsupport the transmission of mass unsolicited, commercial advertising or\r\nsolicitations via e-mail (spam); or  (2) enable high volume, automated,\r\nelectronic processes that apply to MarkMonitor.com (o
r its systems).\r\nMarkMonitor.com reserves the right to modify these terms at any time.\r\nBy submitting this query, you agree to abide by this policy.\r\n\r\nRegistrant:\r\n        Dns Admin\r\n        G
oogle Inc.\r\n        Please contact [email protected] 1600 Amphitheatre Parkway\r\n         Mountain View CA 94043\r\n        US\r\n        [email protected] +1.6502530000 Fax: +1.6506188571\r\n
\r\n    Domain Name: google.com\r\n\r\n        Registrar Name: Markmonitor.com\r\n        Registrar Whois: whois.markmonitor.com\r\n        Registrar Homepage: http://www.markmonitor.com\r\n\r\n    Adminis
trative Contact:\r\n        DNS Admin\r\n        Google Inc.\r\n        1600 Amphitheatre Parkway\r\n         Mountain View CA 94043\r\n        US\r\n        [email protected] +1.6506234000 Fax: +1.6506
188571\r\n    Technical Contact, Zone Contact:\r\n        DNS Admin\r\n        Google Inc.\r\n        2400 E. Bayshore Pkwy\r\n         Mountain View CA 94043\r\n        US\r\n        [email protected] 
+1.6503300100 Fax: +1.6506181499\r\n\r\n    Created on..............: 1997-09-15.\r\n    Expires on..............: 2020-09-13.\r\n    Record last updated on..: 2012-01-29.\r\n\r\n    Domain servers in list
ed order:\r\n\r\n    ns2.google.com\r\n    ns1.google.com\r\n    ns3.google.com\r\n    ns4.google.com\r\n    \r\n\r\n\r\n\r\nMarkMonitor is the Global Leader in Online Brand Protection.\r\n\r\nDomain Manag
ement\r\nMarkMonitor Brand Protection\u2122\r\nMarkMonitor AntiPiracy\u2122\r\nMarkMonitor AntiFraud\u2122\r\nProfessional and Managed Services\r\n\r\nVisit MarkMonitor at www.markmonitor.com\r\nContact us
 at 1 (800) 745-9229\r\nIn Europe, at +44 (0) 203 206 2220\r\n\r\n--",
  "strippedText": "Registrant:\nDns Admin\nGoogle Inc.\nPlease contact [email protected] 1600 Amphitheatre Parkway\nMountain View CA 94043\nUS\[email protected] +1.6502530000 Fax: +1.6506188571\
n\nDomain Name: google.com\n\nRegistrar Name: Markmonitor.com\nRegistrar Whois: whois.markmonitor.com\nRegistrar Homepage: http://www.markmonitor.com\n\nAdministrative Contact:\nDNS Admin\nGoogle Inc.\n160
0 Amphitheatre Parkway\nMountain View CA 94043\nUS\[email protected] +1.6506234000 Fax: +1.6506188571\nTechnical Contact, Zone Contact:\nDNS Admin\nGoogle Inc.\n2400 E. Bayshore Pkwy\nMountain View CA 
94043\nUS\[email protected] +1.6503300100 Fax: +1.6506181499\n\nCreated on..............: 1997-09-15.\nExpires on..............: 2020-09-13.\nRecord last updated on..: 2012-01-29.\n\nDomain servers in 
listed order:\nns2.google.com\nns1.google.com\nns3.google.com\nns4.google.com\n",
  "domainNameExt": ".com",
  "domainName": "google.com",
  "audit": {
    "updatedDate": {
      "$": "2012-10-09 15:53:51.0",
      "@class": "sql-timestamp"
    },
    "createdDate": {
      "$": "2012-10-09 15:53:51.0",
      "@class": "sql-timestamp"
    }
  },
  "technicalContact": {
    "rawText": "DNS Admin\nGoogle Inc.\n2400 E. Bayshore Pkwy\nMountain View CA 94043\nUS\[email protected] +1.6503300100 Fax: +1.6506181499\n",
    "city": "Mountain View",
    "fax": "+1.6503300100 ",
    "name": "DNS Admin",
    "street1": "2400 E. Bayshore Pkwy",
    "telephone": "+1.6503300100 ",
  }
}

Os dados foram reduzidos para legibilidade. Eu quero exibir este bem na linha de comando para que seja mais fácil de ler, ou seja, eu deveria ser capaz de interpretar os caracteres especiais (\ n, \ r, \ t). Eu tentei usar:

whoisout google.com | xargs -I LINE echo -e LINE

mas isso não preserva os espaços antes de qualquer linha. Alguma idéia de como posso mostrar isso corretamente?

    
por sandyp 26.07.2013 / 22:01

0 respostas

Tags