You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
809 B

<?php
include 'vendor/autoload.php';
define('APP_DIR', dirname(__FILE__));
define('DEALS_DIR', sprintf('%s/deals', APP_DIR));
$script_params = parse_ini_file(sprintf('%s/lbcreposter.ini', DEALS_DIR), true);
$config = new \Shikiryu\LBCReposter\Config($script_params);
$account = new \Shikiryu\LBCReposter\Account($config);
$actions = new \Shikiryu\LBCReposter\Actions($account);
//$deal = \Shikiryu\LBCReposter\Deal::fromJSON(sprintf('%s/deals/tmp/data.json', APP_DIR));
if ($actions->connect()) {
// existing deals
$deals = $actions->retrieve();
/** @var \Shikiryu\LBCReposter\Deal $deal */
foreach ($deals as $i => $deal) {
$deal->save(DEALS_DIR);
}
// $account->addDeal($deal);
var_dump($deals);
} else {
echo 'not connected';
}