Ejemplo n.º 1
0
        public static void Run(string[] args)
        {
            var classifier = new URLClassification();
            var finder     = new BingV5Finder();
            var query      = ReadLine();

            while (!string.IsNullOrEmpty(query))
            {
                ExecuteQuery(finder, classifier, query).GetAwaiter().GetResult();
                Console.WriteLine("=================================");
                query = ReadLine();
            }
        }
Ejemplo n.º 2
0
 private static void ExecuteQuery(IFinder finder, string query)
 {
     try
     {
         var list = finder.FindSuggestions(query).GetAwaiter().GetResult();
         foreach (var url in list)
         {
             Console.WriteLine(url);
         }
     }
     catch (WebException e)
     {
         Console.WriteLine(BingV5Finder.ReadAllAsync(e.Response.GetResponseStream()).GetAwaiter().GetResult());
     }
 }