diff --git a/app/Models/parserSkripte/Radiobrowser.php b/app/Models/parserSkripte/Radiobrowser.php new file mode 100644 index 0000000000000000000000000000000000000000..1fbc12ae26009dc4180fdc78d3ad19b3834fe556 --- /dev/null +++ b/app/Models/parserSkripte/Radiobrowser.php @@ -0,0 +1,62 @@ +<?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 + ); + } + } +} diff --git a/resources/lang/de/plugin.php b/resources/lang/de/plugin.php new file mode 100644 index 0000000000000000000000000000000000000000..04def9978cf784378eaa4d6c0658ca7e56bc3280 --- /dev/null +++ b/resources/lang/de/plugin.php @@ -0,0 +1,5 @@ +<?php + +return [ + 'description' => 'MetaGer: Sicher suchen & finden, Privatsphäre schützen', +]; diff --git a/resources/views/plugin.blade.php b/resources/views/plugin.blade.php index 2f6c07d7fde99d5e0d0a5672db2b1c07aeb73b4a..6eb22f80b8e87137e53123a834435b4d47a5470e 100644 --- a/resources/views/plugin.blade.php +++ b/resources/views/plugin.blade.php @@ -1,7 +1,7 @@ <?xmlversion = "1.0"encoding = "UTF-8"?> <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"> <ShortName>MetaGer</ShortName> - <Description>MetaGer: Sicher suchen & finden, Privatsphäre schützen</Description> + <Description>{! trans('plugin.description') !}</Description> <Contact>office@suma-ev.de</Contact> <Image width="16" height="16" type="image/x-icon">{{ url('/favicon.ico') }}</Image> <Url type="text/html" template="{{ $link }}&eingabe={searchTerms}" method="{{$request}}"></Url>