From 1ea0f95190dc568ba6bf7409ec40328c066742a4 Mon Sep 17 00:00:00 2001 From: Akamaru Date: Sun, 13 Jul 2025 18:58:39 +0200 Subject: [PATCH] =?UTF-8?q?Neue=20Bridge=20f=C3=BCr=20Stella=20Sora=20News?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- StellaSoraBridge.php | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 StellaSoraBridge.php diff --git a/StellaSoraBridge.php b/StellaSoraBridge.php new file mode 100644 index 0000000..db4433b --- /dev/null +++ b/StellaSoraBridge.php @@ -0,0 +1,42 @@ +data->rows)) { + returnServerError('Invalid API response structure.'); + } + foreach ($data->data->rows as $element) { + $item = array(); + $item['uri'] = $element->link; + $item['title'] = $element->title; + $item['timestamp'] = isset($element->publishTime) ? intval($element->publishTime / 1000) : time(); + $item['author'] = 'Stella Sora'; + $item['categories'] = array($element->typeLabel); + $item['enclosures'] = array($element->thumbnail); + $content = ''; + if (!empty($element->thumbnail)) { + $content .= '' . htmlspecialchars($element->title) . '
'; + } + if (!empty($element->description)) { + $desc = str_replace("\n", "
", $element->description); + $content .= '
' . $desc . '
'; + } + $item['content'] = $content; + $item['uid'] = $element->id; + $this->items[] = $item; + } + } +} \ No newline at end of file