2024-11-04 20:12:41 +03:00
|
|
|
<?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;
|
2024-11-04 20:12:41 +03:00
|
|
|
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);
|
2024-11-04 20:12:41 +03:00
|
|
|
|
|
|
|
require_once SVEDEN_PARSER . "/vendor/autoload.php";
|
|
|
|
|
2024-12-02 09:23:01 +03:00
|
|
|
/** @var Manager $manager */
|
|
|
|
$manager = ManagerFactory::create(TypeManger::CONTINGENT);
|
2024-11-04 20:12:41 +03:00
|
|
|
$sites = $manager->getSites();
|
2024-12-02 09:23:01 +03:00
|
|
|
$progressBar = ProgressBarFactory::create(count($sites));
|
2024-11-04 20:12:41 +03:00
|
|
|
$progressBar->start();
|
|
|
|
|
|
|
|
$start = 0; $end = count($sites);
|
|
|
|
for ($i = $start; $i < $end; $i++) {
|
|
|
|
$manager->collectData($sites[$i]);
|
|
|
|
$progressBar->advance();
|
|
|
|
}
|
|
|
|
$progressBar->finish();
|
|
|
|
echo PHP_EOL;
|