Commit 0fe3b884 authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

Merge branch '124-openclipart-als-bildersuche' into 'development'

Openclipart ist jetzt eingebaut und liefert ganz annehmbare Ergebnisse

Closes #124

See merge request !211
parents 1fb3b2a8 439296a0
namespace app\Models\parserSkripte;
use App\Models\Searchengine;
use Symfony\Component\DomCrawler\Crawler;
class Openclipart 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 json string");
$results = $content->payload;
foreach($results as $result)
$title = $result->title;
$link = $result->detail_link;
$anzeigeLink = $link;
$descr = $result->description;
$image = $result->svg->url;
$this->results[] = new \App\Models\Result(
\ No newline at end of file
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