Exemplo n.º 1
0
        public PatternExtractorVisitor()
        {
            matcher = new TokenMatcher();

            Embedded.Patterns.Domains.ForEach((name, pattern) =>
            {
                matcher.AddPattern(pattern, name);
            });
        }
Exemplo n.º 2
0
        public PatternExtractorVisitor()
        {
            matcher = new TokenMatcher();

            // Support UTC DateTimes
            matcher.RegisterTransformer <ToDateTimeUtcTransformer>();

            Embedded.Patterns.Domains.ForEach((name, pattern) =>
            {
                matcher.AddPattern(pattern, name);
            });
        }
Exemplo n.º 3
0
        /// <summary>
        /// Determines whether a WHOIS response is a redirect response to another WHOIS server.
        /// </summary>
        public bool IsARedirectRecord(WhoisResponse response, out WhoisRedirect redirect)
        {
            redirect = null;

            var pattern = Embedded.Patterns.Redirects.VerisignGrs;

            var tokenizer = new TokenMatcher();

            tokenizer.AddPattern(pattern, "verisign-grs.com");

            if (tokenizer.TryMatch <WhoisRedirect>(response.Content, out var match))
            {
                Log.Debug("Found redirect for {0} to {1}", response.Domain, match.Result.Url);

                redirect = match.Result;

                if (string.IsNullOrEmpty(redirect.Url) == false)
                {
                    return(true);
                }
            }

            return(false);
        }
Exemplo n.º 4
0
 public void AddPattern(string content, string name)
 {
     matcher.AddPattern(content, name);
 }