sveden-parser/scripts/contingent_parser.php

28 lines
814 B
PHP
Raw Permalink Normal View History

<?php
2024-12-02 09:23:01 +03:00
use SvedenParser\Factory\ManagerFactory;
use SvedenParser\Factory\ProgressBarFactory;
use SvedenParser\Factory\TypeManger;
use SvedenParser\Manager\Manager;
use Symfony\Component\Console\Helper\ProgressBar;
use Symfony\Component\Console\Output\ConsoleOutput;
define('SVEDEN_PARSER', '/home/developer/sveden_parser');
2024-12-02 09:23:01 +03:00
define('TYPE_PARSER', TypeManger::CONTINGENT->value);
require_once SVEDEN_PARSER . "/vendor/autoload.php";
2024-12-02 09:23:01 +03:00
/** @var Manager $manager */
$manager = ManagerFactory::create(TypeManger::CONTINGENT);
$sites = $manager->getSites();
2024-12-02 09:23:01 +03:00
$progressBar = ProgressBarFactory::create(count($sites));
$progressBar->start();
$start = 0; $end = count($sites);
for ($i = $start; $i < $end; $i++) {
$manager->collectData($sites[$i]);
$progressBar->advance();
}
$progressBar->finish();
echo PHP_EOL;