Exemplo n.º 1
0
 public void Stop()
 {
     foreach (Ripper _ripper in this._rippers)
     {
         _ripper.Running = false;
     }
     Downloader.GetInstance().Stop();
     Downloader.GetInstance().Files.Clear();
     this.OnStop();
 }
Exemplo n.º 2
0
 private void CheckforDownloadErrors()
 {
     lock (Downloader.GetInstance().ErrorList)
     {
         int count = Downloader.GetInstance().ErrorList.Count;
         if (count > 0)
         {
             MessageBox.Show(string.Concat(count, " dead links found"), "Download Errors Found");
             Downloader.GetInstance().ErrorList.Clear();
         }
     }
 }
Exemplo n.º 3
0
 public void Start()
 {
     (new ParallelOptions()).MaxDegreeOfParallelism = 4;
     this.Status = BlogDownloader.DownloaderStatus.Running;
     this.OnStart();
     for (int i = 0; i < this.Websites.Count; i++)
     {
         Ripper ripper = Ripper.GetRipper(this.Websites[i]);
         this._rippers.Add(ripper);
         ripper.Load();
         while (this.getNumberOfRunningBlogs() > 4)
         {
             Thread.Sleep(1000);
         }
     }
     Downloader.GetInstance().Start();
 }
Exemplo n.º 4
0
        protected void GetPage(int offset)
        {
            this.currentCount = offset;
            string      str         = string.Concat("http://", this.w.Url);
            MyWebClient myWebClient = new MyWebClient();

            if (offset > 0)
            {
                str = string.Concat(str, "?before=", offset);
            }
            this.w.Viewstatus = string.Concat("Loading page ", offset);
            Post post = new Post()
            {
                Url     = str,
                Website = this.w
            };

            Downloader.Callback <PostItem> callback = new Downloader.Callback <PostItem>(this.getPageCallback);
            Downloader.GetInstance().DownloadPostHTML(post, callback);
        }
Exemplo n.º 5
0
        protected void GetPage(int page)
        {
            if (page == 0)
            {
                page = 1;
            }
            Console.WriteLine(string.Concat("GetPage ", page));
            this.currentPage = page;
            string str = string.Concat("http://", this.w.Url);

            if (page > 1)
            {
                str = string.Concat(str, "/page/", page);
            }
            this.w.Viewstatus = string.Concat("Parsing page ", page);
            Post post = new Post()
            {
                Url     = str,
                Website = this.w
            };

            Downloader.Callback <PostItem> callback = new Downloader.Callback <PostItem>(this.getPageCallback);
            Downloader.GetInstance().DownloadPostHTML(post, callback);
        }
Exemplo n.º 6
0
 public BlogDownloader()
 {
     this.Websites = new List <Website>();
     this._rippers = new List <Ripper>();
     Downloader.GetInstance().DownloadFinished += new EventHandler(this.BlogDownloader_DownloadFinished);
 }