Thiladhun switch to virtual feed

This commit is contained in:
2021-02-05 03:58:14 +05:00
parent d33c727b68
commit 8ea594723f
3 changed files with 45 additions and 8 deletions

View File

@@ -10,7 +10,6 @@ class ThiladhunScraper
protected $title;
protected $content;
protected $guid;
protected $image;
protected $author;
protected $topics = [];
@@ -34,9 +33,8 @@ class ThiladhunScraper
*
* @return array
*/
public function extract($url)
public function extract($url, $date)
{
$this->guid = str_replace('https://thiladhun.com/', '', $url);
$crawler = $this->client->request('GET', $url);
@@ -75,10 +73,10 @@ class ThiladhunScraper
'og_title' => str_replace(" | Thiladhun", "", $crawler->filter('title')->first()->text('content')),
'image' => $this->image,
'content' => $this->content,
'date' => $crawler->filter('.entry-meta time')->attr('datetime'),
'date' => $date,
'url' => $url,
'author' => $this->author,
'guid' => $this->guid,
'guid' => basename($url),
'topics' => $this->topics ? : [
[
"name" => "ވަކި މަޢުލޫއެއް ނޭންގެ",