[ForensicArchitectureBridge] Add Bridge (#4280)

This commit is contained in:
tillcash 2024-10-16 22:43:00 +05:30 committed by GitHub
parent bd823100cd
commit 5d83050673

View File

@ -0,0 +1,25 @@
<?php
class ForensicArchitectureBridge extends BridgeAbstract
{
const NAME = 'Forensic Architecture';
const URI = 'https://forensic-architecture.org/';
const DESCRIPTION = 'Generates content feeds from forensic-architecture.org';
const MAINTAINER = 'tillcash';
public function collectData()
{
$url = 'https://forensic-architecture.org/api/fa/v1/investigations';
$jsonData = json_decode(getContents($url));
foreach ($jsonData->investigations as $investigation) {
$this->items[] = [
'content' => $investigation->abstract,
'timestamp' => $investigation->publication_date,
'title' => $investigation->title,
'uid' => $investigation->id,
'uri' => self::URI . 'investigation/' . $investigation->slug,
];
}
}
}