Avas Feed improvements
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Services\Feeds;
|
namespace App\Services\Feeds;
|
||||||
|
|
||||||
use Goutte\Client;
|
use Goutte\Client;
|
||||||
@@ -30,8 +31,15 @@ class AvasFeed implements Feed
|
|||||||
];
|
];
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$crawler->filter('div[class*="flex md:-mx-4 flex-wrap md:px-0"] div[class*="w-full md:w-1/5 px-4 mb-8"] div a')->each(function ($node) use (&$feeds) {
|
||||||
|
$feeds[] = [
|
||||||
|
"title" => trim($node->text()),
|
||||||
|
"link" => "https://avas.mv" . $node->attr('href')
|
||||||
|
];
|
||||||
|
});
|
||||||
|
|
||||||
return array_slice($feeds,0,18);
|
|
||||||
|
|
||||||
|
|
||||||
|
return $feeds;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user