sveden-parser/scripts/contingent_parser.php

23 lines
734 B
PHP

<?php
use SvedenParser\Color;
use SvedenParser\ContingentParser\ContingentFacade;
use SvedenParser\Printer;
use Symfony\Component\Yaml\Yaml;
require_once __DIR__ . "/vendor/autoload.php";
$facade = new ContingentFacade();
$sites = $facade->getSitesFromLog('sites-http.log');
// $sites = $facade->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);
$facade->collectDataFromContingent($sites[--$i]);
}
Printer::println();
// require __DIR__ . "/add_recording.php";