diff --git a/src/Command/ScrapeWebsite.php b/src/Command/ScrapeWebsite.php index 8178b64..fa7b719 100644 --- a/src/Command/ScrapeWebsite.php +++ b/src/Command/ScrapeWebsite.php @@ -27,11 +27,13 @@ class ScrapeWebsite extends Command public function __construct(protected Capsule $database) { parent::__construct(); + $this->client = new Client(); + $this->getCurrencyExchange(); + die(); } protected function configure(): void { - $this->client = new Client(); $this->addOption(self::COUNTRY_ID, 'c', InputOption::VALUE_OPTIONAL, 'Country id'); } @@ -147,4 +149,12 @@ class ScrapeWebsite extends Command $productModel->stock()->save($stock); } } + + public function getCurrencyExchange(): void { + + $result = $this->client->request('GET', 'https://api.nbp.pl/api/exchangerates/tables/A/?format=json'); + dd(json_decode($result->getBody()->getContents())); + + + } }