Example #1
0
 public void GetHtmlFromUrl()
 {
     try
     {
         if (ForceRequest)
         {
             HtmlContent = CinevoRequests.GetContent(Url).Trim().TrimEnd().TrimStart();
             CinevoFiles.SaveToFile(Path, CinevoEnums.PageTypes.Town.ToString(), "html", HtmlContent);
         }
     }
     catch (Exception ex)
     {
         new Error().SendError(ex);
     }
 }
Example #2
0
 public void GetHtmlFromUrl()
 {
     try
     {
         if (ForceRequest)
         {
             HtmlContent = CinevoRequests.GetContent(Cinema.Url).Trim().TrimEnd().TrimStart();
             CinevoFiles.SaveToFile(Path, Cinema.Tag, "html", HtmlContent);
         }
         ScrapeHtml(Path);
     }
     catch (Exception ex)
     {
         new Error().SendError(ex);
     }
 }
Example #3
0
        public void GetHtmlFromUrl()
        {
            try
            {
                if (ForceRequest)
                {
                    HtmlContent = CinevoRequests.GetContent(Url).Trim().TrimEnd().TrimStart();
                    CinevoFiles.SaveToFile(Path, CinevoEnums.PageTypes.CinemasIndex.ToString(), "html", HtmlContent);
                }

                Console.WriteLine("Scraping cinemas index");
                Console.WriteLine("----\n");
                ScrapeHtml(Path);
            }
            catch (Exception ex)
            {
                new Error().SendError(ex);
            }
        }
Example #4
0
        public void GetHtmlFromUrl()
        {
            try
            {
                if (ForceRequest && Film.IsOriginalVersion)
                {
                    if (!Directory.Exists(Path))
                    {
                        Directory.CreateDirectory(Path);
                    }

                    if (new DirectoryInfo(Path).GetFiles().Where(x => x.FullName.Contains(Film.Tag)).ToList().Count == 0)
                    {
                        HtmlContent = CinevoRequests.GetContent(Film.FilmUrl).Trim().TrimEnd().TrimStart();
                        CinevoFiles.SaveToFile(Path, Film.Tag, "html", HtmlContent);
                    }
                }
                ScrapeFilm();
            }
            catch (Exception ex)
            {
                new Error().SendError(ex);
            }
        }
Example #5
0
 public void Shoud_save_a_file()
 {
     CinevoFiles.SaveToFile(path, CinevoEnums.PageTypes.Town.ToString(), extension, content);
     Assert.IsTrue(Directory.GetFiles(path)[0].Contains(CinevoEnums.PageTypes.Town.ToString()));
 }