Skip to content
Snippets Groups Projects
Commit 007ac73c authored by Karl Hasselbring's avatar Karl Hasselbring
Browse files

Merge branch '137-mediathekensuche-fernsehsuche-de' into 'development'

Die Fernsehsuche ist jetzt unter Nachrichten eingebaut.

Closes #137

See merge request !264
parents 3f8e726b 84d24f8e
No related branches found
No related tags found
2 merge requests!265Development,!264Die Fernsehsuche ist jetzt unter Nachrichten eingebaut.
<?php
namespace app\Models\parserSkripte;
use App\Models\Searchengine;
class Fernsehsuche extends Searchengine
{
public $results = [];
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 xml string");
}
if(!$content)
{
return;
}
$results = $content->response->docs;
foreach($results as $result)
{
$title = $result->show . " : " . $result->title;
$link = urldecode($result->url);
$anzeigeLink = $link; #$result->stream_url_q1;die("hu");
$descr = $result->description;
$image = "http://api-resources.fernsehsuche.de" . $result->thumbnail;
$this->counter++;
$this->results[] = new \App\Models\Result(
$this->engine,
$title,
$link,
$anzeigeLink,
$descr,
$this->gefVon,
$this->counter,
false,
$image
);
}
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment