Exemplo n.º 1
0
        private void _airdnaScrapeThenSaveStore(bool isNew = false, bool needScrape = true)
        {
            _log($"Start AirdnaScrapeThenSaveStore (isNew={isNew})");

            var state = new ScraperAirdnaStateModel()
            {
                IsNew = isNew,
            };

            var scraper = new ScraperAirdna(state);

            if (needScrape)
            {
                scraper.Scrape();
            }

            var dataOfScrape = scraper.GetDomainModel();

            var excelService = new ExcelAirdnaService(state);

            var excelData = excelService.CreateExcel(dataOfScrape);

            var pathToFile = excelService.SaveToFile(excelData);

            var archive = new ArchiveRepository();

            archive.Save(pathToFile, state.TypeScraper);

            _log($"End AirdnaScrapeThenSaveStore (isNew={isNew}), Spent time {_calcSpentTime2String(state)}");
        }
Exemplo n.º 2
0
        public void Update()
        {
            var scraper = new ScraperAirdna(new ScraperAirdnaStateModel());

            var repository = scraper.GetRepository();
            var model      = scraper.GetDomainModel();
            var isOk       = repository.UpdateData(model);
        }
Exemplo n.º 3
0
        static void GetExcelFile(ScraperAirdna scraper)
        {
            var model = scraper.GetDomainModel();

            var excelService = scraper.GetExcelService();

            var excelData = excelService.CreateExcel(model);

            var filename = excelService.SaveToFile(excelData);
        }