/// <summary> /// Visits the specified record. /// </summary> /// <param name="record">The record.</param> /// <returns></returns> public WhoisRecord Visit(WhoisRecord record) { using (var tcpReader = TcpReaderFactory.Create(CurrentEncoding)) { record.Text = tcpReader.Read(record.Server, 43, record.Domain); } return record; }
/// <summary> /// Visits the specified record. /// </summary> /// <param name="record">The record.</param> /// <returns></returns> public WhoisRecord Visit(WhoisRecord record) { // Check to narrow down search results if (record.Text.AsString().Contains("=xxx")) { using (var tcpReader = TcpReaderFactory.Create(CurrentEncoding)) { record.Text = tcpReader.Read(record.Server, 43, "=" + record.Domain); } } return record; }
/// <summary> /// Visits the specified record. /// </summary> /// <param name="record">The record.</param> /// <returns></returns> public WhoisRecord Visit(WhoisRecord record) { var referralIndex = record.Text.IndexOfLineContaining("Created on"); if (referralIndex > -1) { var registationString = record.Text.Containing("Created on", referralIndex); registationString = registationString.SubstringAfterChar(":").Trim(); DateTime registrationDate; if (DateTime.TryParse(registationString, out registrationDate)) { record.Created = registrationDate; } } return record; }
/// <summary> /// Visits the specified record. /// </summary> /// <param name="record">The record.</param> /// <returns></returns> public WhoisRecord Visit(WhoisRecord record) { var referralIndex = record.Text.IndexOfLineContaining("Creation Date (dd/mm/yyyy): "); if (referralIndex > -1) { var registationString = record.Text.Containing("Creation Date (dd/mm/yyyy): ", referralIndex); registationString = registationString.SubstringAfterChar(":").Trim(); DateTime registrationDate; if (DateTime.TryParseExact(registationString, "dd/MM/yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None, out registrationDate)) { record.Created = registrationDate; } } return record; //created: }
/// <summary> /// Visits the specified record. /// </summary> /// <param name="record">The record.</param> /// <returns></returns> public WhoisRecord Visit(WhoisRecord record) { var referralIndex = record.Text.IndexOfLineEndingWith(": " + record.Domain); if (referralIndex > -1) { var whoIsServer = record.Text.Containing("whois", referralIndex); whoIsServer = whoIsServer.SubstringAfterChar(":").Trim(); if (!string.IsNullOrEmpty(whoIsServer)) { using (var tcpReader = TcpReaderFactory.Create(CurrentEncoding)) { record.Text = tcpReader.Read(whoIsServer, 43, record.Domain); } } } return record; }
/// <summary> /// Visits the specified record. /// </summary> /// <param name="record">The record.</param> /// <returns></returns> public WhoisRecord Visit(WhoisRecord record) { record.Server = WhoisServerLookup.Lookup(record.Domain); return record; }