Start working on handling multiple countries at once
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
@@ -75,6 +75,7 @@ class ScrapeWebsite extends Command
|
||||
$page = 0;
|
||||
do {
|
||||
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', [
|
||||
'form_params' => [
|
||||
"includePreviousPages" => false,
|
||||
|
||||
Reference in New Issue
Block a user