<?php
require_once __DIR__ . '/../vendor/autoload.php';

use Blazemedia\Blackhole\Tools\DotEnv;
use Blazemedia\Blackhole\Tools\SimpleDB;
use Blazemedia\Blackhole\OfferListProvider;


define( 'USERS_THRESHOLD',              10 );
define( 'MONTHS_TO_CHECK_TRAFFIC_FROM', 2  );


/** prepara l'istanza del DB */
(new DotEnv(__DIR__ . '/../../../../../.env'))->load();
$db = SimpleDB::getInstance(  getenv('DB_HOST'), getenv('DB_NAME'), getenv('DB_USER'), getenv('DB_PASSWORD'), getenv('DB_PREFIX') );


echo "Scan websites offer posts\n";
( new OfferListProvider( $db, MONTHS_TO_CHECK_TRAFFIC_FROM, USERS_THRESHOLD ) )->scan();





