sveden-parser/scripts/contingent_parser.php

26 lines
792 B
PHP

<?php
use SvedenParser\Color;
use SvedenParser\ContingentParser\ContingentManager;
use SvedenParser\Printer;
use Symfony\Component\Yaml\Yaml;
define('SVEDEN_PARSER', '/home/developer/sveden_parser');
require_once SVEDEN_PARSER . "/vendor/autoload.php";
$manager = new ContingentManager();
// $sites = $manager->getSitesFromLog('sites-http.log');
$sites = $manager->getSites();
// $sites = Yaml::parse(file_get_contents(dirname(__FILE__) ."/sites.yaml"));
$start = 0; $end = count($sites);
// $start = 0; $end = (int)(count($sites) / 2);
// $start = (int)(count($sites) / 2); $end = count($sites);
for ($i = $start; $i < $end; $i++) {
Printer::print(++$i . ". ", Color::GREEN);
$manager->collectData($sites[--$i]);
}
Printer::println();
// require __DIR__ . "/add_recording.php";