Only scrape properties which were found in the last six days
parent
2d88f463e4
commit
1cb6d633ab
|
@ -7,6 +7,7 @@ use App\Models\Extraction;
|
||||||
use App\Models\Exception;
|
use App\Models\Exception;
|
||||||
use App\Jobs\ScrapeProperty;
|
use App\Jobs\ScrapeProperty;
|
||||||
use App\Jobs\ScrapePropertyData;
|
use App\Jobs\ScrapePropertyData;
|
||||||
|
use Carbon\Carbon;
|
||||||
use Illuminate\Support\Facades\Http;
|
use Illuminate\Support\Facades\Http;
|
||||||
|
|
||||||
class Edomizil{
|
class Edomizil{
|
||||||
|
@ -37,8 +38,9 @@ class Edomizil{
|
||||||
|
|
||||||
public static function getAllProperties()
|
public static function getAllProperties()
|
||||||
{
|
{
|
||||||
// get all properties from model in random order.
|
// get all properties from model in random order,
|
||||||
return Property::select('id','property_platform_id')->inRandomOrder()->get();
|
// which where found at least in the last six days.
|
||||||
|
return Property::select('id','property_platform_id')->inRandomOrder()->where('last_found', '>=', Carbon::now()->subDays(6)->toDateTimeString())->get();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function dispatchPropertyJobs()
|
public static function dispatchPropertyJobs()
|
||||||
|
|
|
@ -9,7 +9,8 @@
|
||||||
"guzzlehttp/guzzle": "^7.2",
|
"guzzlehttp/guzzle": "^7.2",
|
||||||
"laravel/framework": "^10.10",
|
"laravel/framework": "^10.10",
|
||||||
"laravel/sanctum": "^3.3",
|
"laravel/sanctum": "^3.3",
|
||||||
"laravel/tinker": "^2.8"
|
"laravel/tinker": "^2.8",
|
||||||
|
"nesbot/carbon": "^2.72"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"fakerphp/faker": "^1.9.1",
|
"fakerphp/faker": "^1.9.1",
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "9c491b8531eec05ba41a11d9276a5749",
|
"content-hash": "bc5b2fc4cb90f140935255d65fb7ffb2",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "brick/math",
|
"name": "brick/math",
|
||||||
|
|
Loading…
Reference in New Issue