Ejemplo n.º 1
0
        public void Crawl()
        {
            _queueManager.Add(new PageToCrawl(new Uri("http://www.nairaland.com/programming", UriKind.Absolute))
            {
                IsBaseUrl = true,
                ParentUrl = new Uri("http://www.nairaland.com/programming", UriKind.Absolute),
                SiteName  = SiteNames.NAIRALAND
            });

            _queueManager.Add(new PageToCrawl(new Uri("http://stackoverflow.com/questions", UriKind.Absolute))
            {
                IsBaseUrl = true,
                ParentUrl = new Uri("http://stackoverflow.com/questions", UriKind.Absolute),
                SiteName  = SiteNames.STACKOVERFLOW
            });

            try
            {
                StartMultiThreadedCrawling();
            }
            catch (Exception e)
            {
                //ignored
                //log the error
            }
            finally
            {
                if (_threadCordinator != null)
                {
                    _threadCordinator.Dispose();
                }
            }
        }
Ejemplo n.º 2
0
 public void ProcessCommand(string roverName, string commands)
 {
     _queueManager.Add(new QueueMessage {
         RoverName = roverName, Commands = commands
     });
 }