Example #1
0
 /// <summary>
 /// Creates a new crawler API instance.
 /// </summary>
 /// <param name="config">The crawler configuration.</param>
 /// <param name="database">The database configuration.</param>
 /// <param name="log">The crawler log.</param>
 /// <param name="status">The crawler status.</param>
 public CrawlerApi(CrawlerConfig config, DbConfig database, Logger log, ApplicationStatus status)
 {
     this.config = config;
     this.database = database;
     this.log = log;
     this.status = status;
 }
Example #2
0
        /// <summary>
        /// Creates a new crawer global object, based on a configuration from the specified root registry key.
        /// </summary>
        /// <param name="rootKey">The root registry key.</param>
        /// <param name="rootPath">The root registry path.</param>
        public Crawler(RegistryKey rootKey, string rootPath)
        {
            // Create the configuration.
            this.config = new CrawlerConfig(rootKey, rootPath);

            // Create the crawler events.
            this.events = new CrawlerEvents();

            // Create the logger.
            this.log = new Logger(this.config.LogFileName);

            // Create the database servers.
            this.dbConfig = new DbConfig(this, rootKey, rootPath + @"\Database");

            // Create the PlanetLab configuration.
            this.plConfig = new PlConfig(rootKey, rootPath + @"\PlanetLab");

            // Create the YouTube configuration.
            this.ytConfig = new YtConfig(this.config);

            // Create the status.
            this.status = new ApplicationStatus();

            // Create the comments.
            this.comments = new CrawlerComments(this.config);

            // Create the crawler spiders.
            this.spiders = new Spiders(this);

            // Create the crawler API.
            this.api = new CrawlerApi(this.config, this.dbConfig, this.log, this.status);

            // Create the toolbox.
            this.toolbox = new Toolbox(this, rootKey, rootPath + @"\Toolbox");
        }
        /// <summary>
        /// Creates a new comments instance.
        /// </summary>
        /// <param name="config">A crawler configuration object.</param>
        public CrawlerComments(CrawlerConfig config)
        {
            // Set the configuration.
            this.config = config;

            // Create the videos comments.
            this.commentsVideos = new CrawlerCommentsList(this.config.CommentsVideosFileName);

            // Create the users comments.
            this.commentsUsers = new CrawlerCommentsList(this.config.CommentsUsersFileName);

            // Create the playlists comments.
            this.commentsPlaylists = new CrawlerCommentsList(this.config.CommentsPlaylistsFileName);
        }
Example #4
0
 /// <summary>
 /// Initializes the control with a crawler object.
 /// </summary>
 /// <param name="config">The configuration.</param>
 /// <param name="log">The log object.</param>
 public void Initialize(CrawlerConfig config, Logger log)
 {
     // Set the configuration.
     this.config = config;
     // Set the log.
     this.log = log;
     // Refresh the log.
     this.OnCalendarDateChanged(null, new DateRangeEventArgs(this.calendar.Calendar.SelectionStart, this.calendar.Calendar.SelectionEnd));
 }