Commit 6d7e68fb authored by Karl Hasselbring's avatar Karl Hasselbring
Browse files

Merge branch '229-plugin-blade-php-ubersetzen' into 'development'

Radio-Browser ist als Suchmaschine für Radios eingebaut und funktioniert gut



See merge request !425
parents 39b7eb53 3e99056f
<?php
namespace app\Models\parserSkripte;
use App\Models\Searchengine;
class Radiobrowser extends Searchengine
{
public $results = [];
public function __construct(\SimpleXMLElement $engine, \App\MetaGer $metager)
{
parent::__construct($engine, $metager);
}
public function loadResults($result)
{
$result = preg_replace("/\r\n/si", "", $result);
try {
$content = json_decode($result);
} catch (\Exception $e) {
abort(500, "$result is not a valid json string");
}
if (!$content) {
return;
}
foreach ($content as $result) {
$title = $result->name;
$link = $result->homepage;
$anzeigeLink = $link;
$descr = "";
if ($result->tags != "") {
$descr .= "Tags: " . $result->tags;
}
if ($result->tags != "") {
if ($descr != "") {
$descr .= " - ";
}
$descr .= "Country: " . $result->country;
}
if ($result->tags != "") {
if ($descr != "") {
$descr .= " - ";
}
$descr .= "Language: " . $result->language;
}
$this->counter++;
$this->results[] = new \App\Models\Result(
$this->engine,
$title,
$link,
$anzeigeLink,
$descr,
$this->gefVon,
$this->counter,
false
);
}
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment