🚚 Déplace dans Account
This commit is contained in:
parent
dbc5ea8d3c
commit
2750443612
@ -1,32 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
include 'vendor/autoload.php';
|
include 'vendor/autoload.php';
|
||||||
include 'library/Account.php';
|
|
||||||
|
|
||||||
$client = new \Goutte\Client();
|
|
||||||
$client->setClient(
|
|
||||||
new \GuzzleHttp\Client([
|
|
||||||
'timeout' => 90,
|
|
||||||
'verify' => false,
|
|
||||||
'curl' => [
|
|
||||||
CURLOPT_TIMEOUT => 60,
|
|
||||||
CURLOPT_TIMEOUT_MS => 60,
|
|
||||||
CURLOPT_CONNECTTIMEOUT => 60,
|
|
||||||
],
|
|
||||||
'headers' => [
|
|
||||||
'User-Agent' => 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:39.0) Gecko/20100101 Firefox/39.0',
|
|
||||||
],
|
|
||||||
])
|
|
||||||
);
|
|
||||||
$client->setMaxRedirects(10);
|
|
||||||
|
|
||||||
define('APP_DIR', dirname(__FILE__));
|
define('APP_DIR', dirname(__FILE__));
|
||||||
define('DEALS_DIR', sprintf('%s/deals', APP_DIR));
|
define('DEALS_DIR', sprintf('%s/deals', APP_DIR));
|
||||||
|
|
||||||
$script_params = parse_ini_file(sprintf('%s/lbcreposter.ini.dev', DEALS_DIR), true);
|
$script_params = parse_ini_file(sprintf('%s/lbcreposter.ini.dev', DEALS_DIR), true);
|
||||||
$config = new \Shikiryu\LBCReposter\Config($script_params);
|
$config = new \Shikiryu\LBCReposter\Config($script_params);
|
||||||
|
$account = new \Shikiryu\LBCReposter\Account($client, $config);
|
||||||
$account = new \Shikiryu\LBCReposter\Account($client, $config);
|
$deal = \Shikiryu\LBCReposter\Deal::fromJSON(sprintf('%s/deals/tmp/data.json', APP_DIR));
|
||||||
$deal = \Shikiryu\LBCReposter\Deal::fromJSON(sprintf('%s/deals/tmp/data.json', APP_DIR));
|
|
||||||
|
|
||||||
if ($account->connect()) {
|
if ($account->connect()) {
|
||||||
// existing deals
|
// existing deals
|
||||||
@ -39,4 +20,4 @@ if ($account->connect()) {
|
|||||||
$account->addDeal($deal);
|
$account->addDeal($deal);
|
||||||
|
|
||||||
var_dump($deals);
|
var_dump($deals);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user