From f97a3fa4d9f0bbd5ce1b4541518664c21761b368 Mon Sep 17 00:00:00 2001 From: Park0 Date: Mon, 9 Oct 2023 08:46:24 +0200 Subject: [PATCH] Fia.com document bridge (#3733) * Create FiaBridge.php F1 documents from fia.com * Update FiaBridge.php Fixed concat --- bridges/FiaBridge.php | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 bridges/FiaBridge.php diff --git a/bridges/FiaBridge.php b/bridges/FiaBridge.php new file mode 100644 index 00000000..37d26267 --- /dev/null +++ b/bridges/FiaBridge.php @@ -0,0 +1,43 @@ +find('li.document-row'); + foreach ($items as $item) { + /** @var simple_html_dom $item */ + // Do something with each list item + $title = trim($item->find('div.title', 0)->plaintext); + $href = $item->find('a', 0)->href; + $url = 'https://www.fia.com' . $href; + + $date = $item->find('span.date-display-single', 0)->plaintext; + + $item = []; + $item['uri'] = $url; + $item['title'] = $title; + $item['timestamp'] = (string) DateTime::createFromFormat('d.m.y H:i', $date)->getTimestamp(); + ; + $item['author'] = 'Fia'; + $item['content'] = "Document on date $date: $title
$url"; + $item['categories'] = 'Document'; + $item['uid'] = $title . $date; + + $count = count($this->items); + if ($count > 20) { + break; + } else { + $this->items[] = $item; + } + } + } +}