Start working on handling multiple countries at once

This commit is contained in:
2026-01-16 08:44:36 +01:00
parent ebe40785fa
commit f2a9bdf993
2 changed files with 12 additions and 0 deletions

View File

@@ -76,6 +76,17 @@ class Migrate extends Command
}); });
} }
} }
public function createCountriesTable(): void
{
if (!Capsule::schema()->hasTable('countries')) {
Capsule::schema()->create('countries', function (Blueprint $table) {
$table->increments('id');
$table->text('countryName');
$table->text('productsUrl');
$table->timestamps();
});
}
}
public function createStocksTable(): void public function createStocksTable(): void
{ {

View File

@@ -75,6 +75,7 @@ class ScrapeWebsite extends Command
$page = 0; $page = 0;
do { do {
try { try {
// $res = $this->client->request('POST', 'https://uk.ryobitools.eu/api/product-listing/get-products', [
$res = $this->client->request('POST', 'https://pl.ryobitools.eu/api/product-listing/get-products', [ $res = $this->client->request('POST', 'https://pl.ryobitools.eu/api/product-listing/get-products', [
'form_params' => [ 'form_params' => [
"includePreviousPages" => false, "includePreviousPages" => false,