2024-04-13 00:54:08 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Console\Commands;
|
|
|
|
|
2024-04-13 11:05:22 +02:00
|
|
|
use App\Scraper\Edomizil;
|
2024-04-13 00:54:08 +02:00
|
|
|
use Illuminate\Console\Command;
|
|
|
|
|
|
|
|
class scrapeProperty extends Command
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* The name and signature of the console command.
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
protected $signature = 'scrape:property';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The console command description.
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
2024-04-13 11:05:22 +02:00
|
|
|
protected $description = 'Scrapes for properties from seeds.';
|
2024-04-13 00:54:08 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Execute the console command.
|
|
|
|
*/
|
|
|
|
public function handle()
|
|
|
|
{
|
2024-04-13 11:05:22 +02:00
|
|
|
|
|
|
|
$seeds = Edomizil::getAllSeeds();
|
|
|
|
foreach($seeds as $seed){
|
2024-06-24 18:49:43 +02:00
|
|
|
$this->info('Scraping '.$seed);
|
|
|
|
$scraper = Edomizil::ScrapeProperty($seed);
|
|
|
|
$this->info($scraper.' properties were found.');
|
2024-04-13 11:05:22 +02:00
|
|
|
}
|
|
|
|
|
2024-06-24 18:49:43 +02:00
|
|
|
$this->info('Finished scraping.');
|
2024-04-13 11:05:22 +02:00
|
|
|
|
2024-04-13 00:54:08 +02:00
|
|
|
}
|
|
|
|
}
|