This commit is contained in:
Doar Mihai
2026-05-02 14:46:39 +03:00
parent 41b756a858
commit 693d8013be
@@ -55,7 +55,8 @@ class FetchAdzunaDescriptionCommand extends Command
'AdzunaFR', 'AdzunaFR',
]; ];
$jobSource = JobSource::where('name', 'Adzuna')->first(); //$jobSource = JobSource::where('name', 'Adzuna')->first();
$jobSource = JobSource::whereIn('name', $adzunaSources)->first();
$jobs = Job::where('job_source_id', $jobSource->id)->latest()->limit(50)->get(); $jobs = Job::where('job_source_id', $jobSource->id)->latest()->limit(50)->get();
@@ -67,7 +68,7 @@ class FetchAdzunaDescriptionCommand extends Command
echo "Processing $id (slug ".$job->slug.") \n"; echo "Processing $id (slug ".$job->slug.") \n";
$description = $this->executeScraper($id); $description = $this->executeScraper($id, $jobSource->name);
$description = $this->processDescription($description); $description = $this->processDescription($description);
if ( if (
@@ -93,9 +94,9 @@ class FetchAdzunaDescriptionCommand extends Command
return str_replace('Search for similar jobs in your region', '', $description); return str_replace('Search for similar jobs in your region', '', $description);
} }
private function executeScraper(string $id) private function executeScraper(string $id, string $sourceName)
{ {
$scraperUrl = 'https://jobifyscr.c0rrup7.net/adzuna/'.$id; $scraperUrl = 'https://jobifyscr.c0rrup7.net/adzuna/'.$id.'/'.$sourceName;
$guzzleClient = new \GuzzleHttp\Client(); $guzzleClient = new \GuzzleHttp\Client();
$response = $guzzleClient->request( $response = $guzzleClient->request(