From cf21fe1c2633ff4e25fb6d4920cce69a11abea21 Mon Sep 17 00:00:00 2001
From: Karl <Karl Hasselbring>
Date: Thu, 15 Dec 2016 08:58:16 +0100
Subject: [PATCH] =?UTF-8?q?Alle=20Parser=20die=20Json-=20oder=20XML-Ergebn?=
 =?UTF-8?q?isse=20benutzen=20sind=20jetzt=20durch=20ein=20try-catch=20vor?=
 =?UTF-8?q?=20abst=C3=BCrzen=20gesichert.=20Es=20fehlen=20lediglich=20die?=
 =?UTF-8?q?=20Parser=20die=20andere=20Methoden=20verwenden.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 app/Models/parserSkripte/Blogsearch.php       | 46 +++++----
 app/Models/parserSkripte/Dailymotion.php      | 50 +++++-----
 app/Models/parserSkripte/Ebay.php             | 82 ++++++++--------
 app/Models/parserSkripte/Ecoshopper.php       | 69 +++++++-------
 app/Models/parserSkripte/Europeana.php        | 86 +++++++++--------
 app/Models/parserSkripte/Exalead.php          | 95 ++++++++++---------
 app/Models/parserSkripte/Fernsehsuche.php     | 58 +++++------
 app/Models/parserSkripte/Flickr.php           | 79 +++++++--------
 app/Models/parserSkripte/Mg_produkt2.php      | 56 +++++------
 .../parserSkripte/Opencrawlastronomie.php     | 58 +++++------
 .../parserSkripte/Opencrawlregengergie.php    | 58 +++++------
 app/Models/parserSkripte/Opencrawltauchen.php | 57 +++++------
 app/Models/parserSkripte/Overture.php         | 94 ++++++++++--------
 app/Models/parserSkripte/Pixabay.php          | 85 +++++++++--------
 app/Models/parserSkripte/Qip.php              | 43 +++++----
 app/Models/parserSkripte/Radiobrowser.php     | 69 +++++++-------
 app/Models/parserSkripte/Tuhh.php             | 55 +++++------
 app/Models/parserSkripte/Yacy.php             | 56 +++++------
 app/Models/parserSkripte/Yacyunih.php         | 64 ++++++-------
 app/Models/parserSkripte/Yandex.php           | 61 ++++++------
 20 files changed, 670 insertions(+), 651 deletions(-)

diff --git a/app/Models/parserSkripte/Blogsearch.php b/app/Models/parserSkripte/Blogsearch.php
index c167afc24..a6cc51d4c 100644
--- a/app/Models/parserSkripte/Blogsearch.php
+++ b/app/Models/parserSkripte/Blogsearch.php
@@ -16,34 +16,32 @@ class Blogsearch extends Searchengine
     public function loadResults($result)
     {
         $result = preg_replace("/\r\n/si", "", $result);
-
         try {
             $content = simplexml_load_string($result);
+            if (!$content) {
+                return;
+            }
+
+            $results = $content->xpath('//xml/docs/doc');
+            foreach ($results as $result) {
+                $title       = $result->{"title"}->__toString();
+                $link        = $result->{"url"}->__toString();
+                $anzeigeLink = $link;
+                $descr       = $result->{"content"}->__toString();
+                $this->counter++;
+                $this->results[] = new \App\Models\Result(
+                    $this->engine,
+                    $title,
+                    $link,
+                    $anzeigeLink,
+                    $descr,
+                    $this->gefVon,
+                    $this->counter
+                );
+            }
         } catch (\Exception $e) {
-            abort(500, "$result is not a valid xml string");
-        }
-
-        if (!$content) {
+            Log::error("A problem occurred parsing results from $this->name");
             return;
         }
-        $results = $content->xpath('//xml/docs/doc');
-        # die(var_dump($results));
-        foreach ($results as $result) {
-            $title       = $result->{"title"}->__toString();
-            $link        = $result->{"url"}->__toString();
-            $anzeigeLink = $link;
-            $descr       = $result->{"content"}->__toString();
-            $this->counter++;
-            $this->results[] = new \App\Models\Result(
-                $this->engine,
-                $title,
-                $link,
-                $anzeigeLink,
-                $descr,
-                $this->gefVon,
-                $this->counter
-            );
-        }
     }
-
 }
diff --git a/app/Models/parserSkripte/Dailymotion.php b/app/Models/parserSkripte/Dailymotion.php
index e21138d77..f249c1038 100644
--- a/app/Models/parserSkripte/Dailymotion.php
+++ b/app/Models/parserSkripte/Dailymotion.php
@@ -18,33 +18,33 @@ class Dailymotion extends Searchengine
         $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;
+            }
 
-        if (!$content) {
+            $results = $content->list;
+            foreach ($results as $result) {
+                $title       = $result->title;
+                $link        = $result->url;
+                $anzeigeLink = $link;
+                $descr       = $result->description;
+                $image       = $result->thumbnail_240_url;
+                $this->counter++;
+                $this->results[] = new \App\Models\Result(
+                    $this->engine,
+                    $title,
+                    $link,
+                    $anzeigeLink,
+                    $descr,
+                    $this->gefVon,
+                    $this->counter,
+                    false,
+                    $image
+                );
+            }
+        } catch (\Exception $e) {
+            Log::error("A problem occurred parsing results from $this->name");
             return;
         }
-
-        $results = $content->list;
-        foreach ($results as $result) {
-            $title       = $result->title;
-            $link        = $result->url;
-            $anzeigeLink = $link;
-            $descr       = $result->description;
-            $image       = $result->thumbnail_240_url;
-            $this->counter++;
-            $this->results[] = new \App\Models\Result(
-                $this->engine,
-                $title,
-                $link,
-                $anzeigeLink,
-                $descr,
-                $this->gefVon,
-                $this->counter,
-                false,
-                $image
-            );
-        }
     }
 }
diff --git a/app/Models/parserSkripte/Ebay.php b/app/Models/parserSkripte/Ebay.php
index f3c6de876..8a1cfa342 100644
--- a/app/Models/parserSkripte/Ebay.php
+++ b/app/Models/parserSkripte/Ebay.php
@@ -15,54 +15,52 @@ class Ebay extends Searchengine
 
     public function loadResults($result)
     {
+        $result = preg_replace("/\r\n/si", "", $result);
         try {
             $content = simplexml_load_string($result);
-        } catch (\Exception $e) {
-            abort(500, "$result is not a valid xml string");
-        }
-
-        if (!$content) {
-            return;
-        }
-        $results = $content;
-
-        $results = $results->{"searchResult"};
-        $count   = 0;
-        foreach ($results->{"item"} as $result) {
-            $title       = $result->{"title"}->__toString();
-            $link        = $result->{"viewItemURL"}->__toString();
-            $anzeigeLink = $link;
-            $time        = $result->{"listingInfo"}->{"endTime"}->__toString();
-            $time        = date(DATE_RFC2822, strtotime($time));
-            $price       = intval($result->{"sellingStatus"}->{"convertedCurrentPrice"}->__toString()) * 100;
-            $descr       = "<p>Preis: " . $result->{"sellingStatus"}->{"convertedCurrentPrice"}->__toString() . " €</p>";
-            $descr .= "<p>Versandkosten: " . $result->{"shippingInfo"}->{"shippingServiceCost"}->__toString() . " €</p>";
-            if (isset($result->{"listingInfo"}->{"listingType"})) {
-                $descr .= "<p>Auktionsart: " . $result->{"listingInfo"}->{"listingType"}->__toString() . "</p>";
+            if (!$content) {
+                return;
             }
 
-            $descr .= "<p>Auktionsende: " . $time . "</p>";
-            if (isset($result->{"primaryCategory"}->{"categoryName"})) {
-                $descr .= "<p class=\"text-muted\">Kategorie: " . $result->{"primaryCategory"}->{"categoryName"}->__toString() . "</p>";
-            }
+            $results = $content->{"searchResult"};
+            $count   = 0;
+            foreach ($results->{"item"} as $result) {
+                $title       = $result->{"title"}->__toString();
+                $link        = $result->{"viewItemURL"}->__toString();
+                $anzeigeLink = $link;
+                $time        = $result->{"listingInfo"}->{"endTime"}->__toString();
+                $time        = date(DATE_RFC2822, strtotime($time));
+                $price       = intval($result->{"sellingStatus"}->{"convertedCurrentPrice"}->__toString()) * 100;
+                $descr       = "<p>Preis: " . $result->{"sellingStatus"}->{"convertedCurrentPrice"}->__toString() . " €</p>";
+                $descr .= "<p>Versandkosten: " . $result->{"shippingInfo"}->{"shippingServiceCost"}->__toString() . " €</p>";
+                if (isset($result->{"listingInfo"}->{"listingType"})) {
+                    $descr .= "<p>Auktionsart: " . $result->{"listingInfo"}->{"listingType"}->__toString() . "</p>";
+                }
 
-            $image = $result->{"galleryURL"}->__toString();
-            $this->counter++;
-            $this->results[] = new \App\Models\Result(
-                $this->engine,
-                $title,
-                $link,
-                $anzeigeLink,
-                $descr,
-                $this->gefVon,
-                $this->counter,
-                false,
-                $image,
-                $price
-            );
-            $count++;
+                $descr .= "<p>Auktionsende: " . $time . "</p>";
+                if (isset($result->{"primaryCategory"}->{"categoryName"})) {
+                    $descr .= "<p class=\"text-muted\">Kategorie: " . $result->{"primaryCategory"}->{"categoryName"}->__toString() . "</p>";
+                }
 
+                $image = $result->{"galleryURL"}->__toString();
+                $this->counter++;
+                $this->results[] = new \App\Models\Result(
+                    $this->engine,
+                    $title,
+                    $link,
+                    $anzeigeLink,
+                    $descr,
+                    $this->gefVon,
+                    $this->counter,
+                    false,
+                    $image,
+                    $price
+                );
+                $count++;
+            }
+        } catch (\Exception $e) {
+            Log::error("A problem occurred parsing results from $this->name");
+            return;
         }
-
     }
 }
diff --git a/app/Models/parserSkripte/Ecoshopper.php b/app/Models/parserSkripte/Ecoshopper.php
index 3b013d142..fca12fbbd 100644
--- a/app/Models/parserSkripte/Ecoshopper.php
+++ b/app/Models/parserSkripte/Ecoshopper.php
@@ -16,47 +16,48 @@ class Ecoshopper extends Searchengine
 
     public function loadResults($result)
     {
+        $result = preg_replace("/\r\n/si", "", $result);
         try {
             $content = simplexml_load_string($result);
-        } catch (\Exception $e) {
-            Log::error("Ergebnisse von Ecoshopper konnten nicht eingelesen werden");
-            return;
-        }
+            if (!$content) {
+                return;
+            }
+
+            $results = $content->xpath('//response/result[@name="response"]/doc');
+            foreach ($results as $result) {
+                $result      = simplexml_load_string($result->saveXML());
+                $title       = $result->xpath('//doc/str[@name="artikelName"]')[0]->__toString();
+                $link        = $result->xpath('//doc/str[@name="artikelDeeplink"]')[0]->__toString();
+                $anzeigeLink = parse_url($link);
+                if (isset($anzeigeLink['query'])) {
+                    parse_str($anzeigeLink['query'], $query);
+                    if (isset($query['diurl'])) {
+                        $anzeigeLink = $query['diurl'];
+                    } else {
+                        $anzeigeLink = $link;
+                    }
 
-        if (!$content) {
-            return;
-        }
-        $results = $content->xpath('//response/result[@name="response"]/doc');
-        foreach ($results as $result) {
-            $result      = simplexml_load_string($result->saveXML());
-            $title       = $result->xpath('//doc/str[@name="artikelName"]')[0]->__toString();
-            $link        = $result->xpath('//doc/str[@name="artikelDeeplink"]')[0]->__toString();
-            $anzeigeLink = parse_url($link);
-            if (isset($anzeigeLink['query'])) {
-                parse_str($anzeigeLink['query'], $query);
-                if (isset($query['diurl'])) {
-                    $anzeigeLink = $query['diurl'];
                 } else {
                     $anzeigeLink = $link;
                 }
-
-            } else {
-                $anzeigeLink = $link;
+                $descr = $result->xpath('//doc/str[@name="artikelBeschreibung"]')[0]->__toString();
+                $image = $result->xpath('//doc/str[@name="artikelImageurl"]')[0]->__toString();
+                $this->counter++;
+                $this->results[] = new \App\Models\Result(
+                    $this->engine,
+                    $title,
+                    $link,
+                    $anzeigeLink,
+                    $descr,
+                    $this->gefVon,
+                    $this->counter,
+                    false,
+                    $image
+                );
             }
-            $descr = $result->xpath('//doc/str[@name="artikelBeschreibung"]')[0]->__toString();
-            $image = $result->xpath('//doc/str[@name="artikelImageurl"]')[0]->__toString();
-            $this->counter++;
-            $this->results[] = new \App\Models\Result(
-                $this->engine,
-                $title,
-                $link,
-                $anzeigeLink,
-                $descr,
-                $this->gefVon,
-                $this->counter,
-                false,
-                $image
-            );
+        } catch (\Exception $e) {
+            Log::error("A problem occurred parsing results from $this->name");
+            return;
         }
     }
 }
diff --git a/app/Models/parserSkripte/Europeana.php b/app/Models/parserSkripte/Europeana.php
index 0225cc873..3aa5d10d6 100644
--- a/app/Models/parserSkripte/Europeana.php
+++ b/app/Models/parserSkripte/Europeana.php
@@ -19,59 +19,61 @@ class Europeana extends Searchengine
         $result = preg_replace("/\r\n/si", "", $result);
         try {
             $content = json_decode($result);
-        } catch (\Exception $e) {
-            Log::error("Results from $this->name are not a valid json string");
-            return;
-        }
-        if (!$content) {
-            return;
-        }
-        $results = $content->items;
-        foreach ($results as $result) {
-            if (isset($result->edmPreview)) {
-                $title = $result->title[0];
-                if (preg_match("/(.+)\?.*/si", $result->guid, $match)) {
-                    $link = $match[1];
-                } else {
-                    $link = "";
+            if (!$content) {
+                return;
+            }
+
+            $results = $content->items;
+            foreach ($results as $result) {
+                if (isset($result->edmPreview)) {
+                    $title = $result->title[0];
+                    if (preg_match("/(.+)\?.*/si", $result->guid, $match)) {
+                        $link = $match[1];
+                    } else {
+                        $link = "";
+                    }
+                    $anzeigeLink = $link;
+                    $descr       = "";
+                    $image       = urldecode($result->edmPreview[0]);
+                    $this->counter++;
+                    $this->results[] = new \App\Models\Result(
+                        $this->engine,
+                        $title,
+                        $link,
+                        $anzeigeLink,
+                        $descr,
+                        $this->gefVon,
+                        $this->counter,
+                        false,
+                        $image
+                    );
                 }
-                $anzeigeLink = $link;
-                $descr       = "";
-                $image       = urldecode($result->edmPreview[0]);
-                $this->counter++;
-                $this->results[] = new \App\Models\Result(
-                    $this->engine,
-                    $title,
-                    $link,
-                    $anzeigeLink,
-                    $descr,
-                    $this->gefVon,
-                    $this->counter,
-                    false,
-                    $image
-                );
             }
+        } catch (\Exception $e) {
+            Log::error("A problem occurred parsing results from $this->name");
+            return;
         }
     }
 
     public function getNext(\App\MetaGer $metager, $result)
     {
-        $start = ($metager->getPage()) * 10 + 1;
         try {
             $content = json_decode($result);
+            if (!$content) {
+                return;
+            }
+
+            $start = ($metager->getPage()) * 10 + 1;
+            if ($start > $content->totalResults) {
+                return;
+            }
+            $next = new Europeana(simplexml_load_string($this->engine), $metager);
+            $next->getString .= "&start=" . $start;
+            $next->hash = md5($next->host . $next->getString . $next->port . $next->name);
+            $this->next = $next;
         } catch (\Exception $e) {
-            Log::error("Results from $this->name are not a valid json string");
-            return;
-        }
-        if (!$content) {
-            return;
-        }
-        if ($start > $content->totalResults) {
+            Log::error("A problem occurred parsing results from $this->name");
             return;
         }
-        $next = new Europeana(simplexml_load_string($this->engine), $metager);
-        $next->getString .= "&start=" . $start;
-        $next->hash = md5($next->host . $next->getString . $next->port . $next->name);
-        $this->next = $next;
     }
 }
diff --git a/app/Models/parserSkripte/Exalead.php b/app/Models/parserSkripte/Exalead.php
index 7a132b0be..6ba8b3b19 100644
--- a/app/Models/parserSkripte/Exalead.php
+++ b/app/Models/parserSkripte/Exalead.php
@@ -18,59 +18,60 @@ class Exalead extends Searchengine
         $result = preg_replace("/\r\n/si", "", $result);
         try {
             $content = simplexml_load_string($result);
-        } catch (\Exception $e) {
-            return;
-        }
+            if (!$content) {
+                return;
+            }
 
-        if (!$content) {
-            return;
-        }
-        $results   = $content;
-        $prefix    = "";
-        $namespace = "";
-        foreach ($results->getDocNamespaces() as $strPrefix => $strNamespace) {
-            if (strlen($strPrefix) == 0) {
-                $prefix = "a"; //Assign an arbitrary namespace prefix.
-            } else {
-                $prefix = "a";
+            $results   = $content;
+            $prefix    = "";
+            $namespace = "";
+            foreach ($results->getDocNamespaces() as $strPrefix => $strNamespace) {
+                if (strlen($strPrefix) == 0) {
+                    $prefix = "a"; //Assign an arbitrary namespace prefix.
+                } else {
+                    $prefix = "a";
+                }
+                $namespace = $strNamespace;
             }
-            $namespace = $strNamespace;
-        }
-        $results->registerXPathNamespace($prefix, $namespace);
-        try {
-            $results = $results->xpath("//a:searchResult/a:item");
-        } catch (\ErrorException $e) {
-            return;
-        }
-        foreach ($results as $result) {
+            $results->registerXPathNamespace($prefix, $namespace);
             try {
-                $result->registerXPathNamespace($prefix, $namespace);
-                $title       = $result->xpath("a:metas/a:Meta[@name='title']/a:MetaString[@name='value']")[0]->__toString();
-                $link        = $result->xpath("a:metas/a:Meta[@name='url']/a:MetaString[@name='value']")[0]->__toString();
-                $anzeigeLink = $link;
-                $descr       = "";
-                if (sizeOf($result->xpath("a:metas/a:Meta[@name='metadesc']/a:MetaString[@name='value']")) === 0 && sizeOf($result->xpath("a:metas/a:Meta[@name='summary']/a:MetaText[@name='value']")) !== 0) {
-                    $tmp = $result->xpath("a:metas/a:Meta[@name='summary']/a:MetaText[@name='value']");
-                    foreach ($tmp as $el) {
-                        $descr .= strip_tags($el->asXML());
+                $results = $results->xpath("//a:searchResult/a:item");
+            } catch (\ErrorException $e) {
+                return;
+            }
+            foreach ($results as $result) {
+                try {
+                    $result->registerXPathNamespace($prefix, $namespace);
+                    $title       = $result->xpath("a:metas/a:Meta[@name='title']/a:MetaString[@name='value']")[0]->__toString();
+                    $link        = $result->xpath("a:metas/a:Meta[@name='url']/a:MetaString[@name='value']")[0]->__toString();
+                    $anzeigeLink = $link;
+                    $descr       = "";
+                    if (sizeOf($result->xpath("a:metas/a:Meta[@name='metadesc']/a:MetaString[@name='value']")) === 0 && sizeOf($result->xpath("a:metas/a:Meta[@name='summary']/a:MetaText[@name='value']")) !== 0) {
+                        $tmp = $result->xpath("a:metas/a:Meta[@name='summary']/a:MetaText[@name='value']");
+                        foreach ($tmp as $el) {
+                            $descr .= strip_tags($el->asXML());
+                        }
+                    } else {
+                        $descr = $result->xpath("a:metas/a:Meta[@name='metadesc']/a:MetaString[@name='value']")[0]->__toString();
                     }
-                } else {
-                    $descr = $result->xpath("a:metas/a:Meta[@name='metadesc']/a:MetaString[@name='value']")[0]->__toString();
-                }
 
-                $this->counter++;
-                $this->results[] = new \App\Models\Result(
-                    $this->engine,
-                    $title,
-                    $link,
-                    $anzeigeLink,
-                    $descr,
-                    $this->gefVon,
-                    $this->counter
-                );
-            } catch (\ErrorException $e) {
-                continue;
+                    $this->counter++;
+                    $this->results[] = new \App\Models\Result(
+                        $this->engine,
+                        $title,
+                        $link,
+                        $anzeigeLink,
+                        $descr,
+                        $this->gefVon,
+                        $this->counter
+                    );
+                } catch (\ErrorException $e) {
+                    continue;
+                }
             }
+        } catch (\Exception $e) {
+            Log::error("A problem occurred parsing results from $this->name");
+            return;
         }
     }
 }
diff --git a/app/Models/parserSkripte/Fernsehsuche.php b/app/Models/parserSkripte/Fernsehsuche.php
index 817c64452..b195a89c4 100644
--- a/app/Models/parserSkripte/Fernsehsuche.php
+++ b/app/Models/parserSkripte/Fernsehsuche.php
@@ -18,37 +18,37 @@ class Fernsehsuche extends Searchengine
         $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) {
-            try {
-                $title       = $result->show . " : " . $result->title;
-                $link        = urldecode($result->url);
-                $anzeigeLink = $link;
-                $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
-                );
-            } catch (\ErrorException $e) {
+            if (!$content) {
+                return;
+            }
 
+            $results = $content->response->docs;
+            foreach ($results as $result) {
+                try {
+                    $title       = $result->show . " : " . $result->title;
+                    $link        = urldecode($result->url);
+                    $anzeigeLink = $link;
+                    $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
+                    );
+                } catch (\ErrorException $e) {
+
+                }
             }
+        } catch (\Exception $e) {
+            Log::error("A problem occurred parsing results from $this->name");
+            return;
         }
     }
 }
diff --git a/app/Models/parserSkripte/Flickr.php b/app/Models/parserSkripte/Flickr.php
index 744837e6c..ad6c00f6f 100644
--- a/app/Models/parserSkripte/Flickr.php
+++ b/app/Models/parserSkripte/Flickr.php
@@ -19,56 +19,57 @@ class Flickr extends Searchengine
         $result = preg_replace("/\r\n/si", "", $result);
         try {
             $content = simplexml_load_string($result);
+            if (!$content) {
+                return;
+            }
+
+            $results = $content->xpath('//photos/photo');
+            foreach ($results as $result) {
+                $title       = $result["title"]->__toString();
+                $link        = "https://www.flickr.com/photos/" . $result["owner"]->__toString() . "/" . $result["id"]->__toString();
+                $anzeigeLink = $link;
+                $descr       = "";
+                $image       = "http://farm" . $result["farm"]->__toString() . ".staticflickr.com/" . $result["server"]->__toString() . "/" . $result["id"]->__toString() . "_" . $result["secret"]->__toString() . "_t.jpg";
+                $this->counter++;
+                $this->results[] = new \App\Models\Result(
+                    $this->engine,
+                    $title,
+                    $link,
+                    $anzeigeLink,
+                    $descr,
+                    $this->gefVon,
+                    $this->counter,
+                    false,
+                    $image
+                );
+            }
         } catch (\Exception $e) {
-            Log::error("Results from $this->name are not a valid json string");
-            return;
-        }
-        if (!$content) {
+            Log::error("A problem occurred parsing results from $this->name");
             return;
         }
-        $results = $content->xpath('//photos/photo');
-        foreach ($results as $result) {
-            $title       = $result["title"]->__toString();
-            $link        = "https://www.flickr.com/photos/" . $result["owner"]->__toString() . "/" . $result["id"]->__toString();
-            $anzeigeLink = $link;
-            $descr       = "";
-            $image       = "http://farm" . $result["farm"]->__toString() . ".staticflickr.com/" . $result["server"]->__toString() . "/" . $result["id"]->__toString() . "_" . $result["secret"]->__toString() . "_t.jpg";
-            $this->counter++;
-            $this->results[] = new \App\Models\Result(
-                $this->engine,
-                $title,
-                $link,
-                $anzeigeLink,
-                $descr,
-                $this->gefVon,
-                $this->counter,
-                false,
-                $image
-            );
-        }
     }
 
     public function getNext(\App\MetaGer $metager, $result)
     {
-        $page    = $metager->getPage() + 1;
-        $result  = preg_replace("/\r\n/si", "", $result);
-        $content = simplexml_load_string($result);
-        $results = $content->xpath('//photos')[0];
+        $result = preg_replace("/\r\n/si", "", $result);
         try {
             $content = simplexml_load_string($result);
+            if (!$content) {
+                return;
+            }
+
+            $page    = $metager->getPage() + 1;
+            $results = $content->xpath('//photos')[0];
+            if ($page >= intval($results["pages"]->__toString())) {
+                return;
+            }
+            $next = new Flickr(simplexml_load_string($this->engine), $metager);
+            $next->getString .= "&page=" . $page;
+            $next->hash = md5($next->host . $next->getString . $next->port . $next->name);
+            $this->next = $next;
         } catch (\Exception $e) {
-            Log::error("Results from $this->name are not a valid json string");
-            return;
-        }
-        if (!$content) {
-            return;
-        }
-        if ($page >= intval($results["pages"]->__toString())) {
+            Log::error("A problem occurred parsing results from $this->name");
             return;
         }
-        $next = new Flickr(simplexml_load_string($this->engine), $metager);
-        $next->getString .= "&page=" . $page;
-        $next->hash = md5($next->host . $next->getString . $next->port . $next->name);
-        $this->next = $next;
     }
 }
diff --git a/app/Models/parserSkripte/Mg_produkt2.php b/app/Models/parserSkripte/Mg_produkt2.php
index 839a20025..831daf7ef 100644
--- a/app/Models/parserSkripte/Mg_produkt2.php
+++ b/app/Models/parserSkripte/Mg_produkt2.php
@@ -19,36 +19,36 @@ class Mg_produkt2 extends Searchengine
         $result = preg_replace("/\r\n/si", "", $result);
         try {
             $content = simplexml_load_string($result);
-        } catch (\Exception $e) {
-            Log::error("MG_Produkt konnte keine Ergebnisse bekommen");
-            return;
-        }
+            if (!$content) {
+                return;
+            }
 
-        if (!$content) {
+            $results = $content->xpath('//response/result[@name="response"]/doc');
+            foreach ($results as $result) {
+                $result      = simplexml_load_string($result->saveXML());
+                $title       = $result->xpath('/doc/arr[@name="artikelName"]')[0]->{"str"}->__toString();
+                $link        = $result->xpath('/doc/arr[@name="artikelDeeplink"]')[0]->{"str"}->__toString();
+                $anzeigeLink = parse_url($link);
+                parse_str($anzeigeLink['query'], $query);
+                $anzeigeLink = $query['diurl'];
+                $descr       = $result->xpath('/doc/arr[@name="artikelBeschreibung"]')[0]->{"str"}->__toString();
+                $image       = $result->xpath('/doc/arr[@name="artikelImageurl"]')[0]->{"str"}->__toString();
+                $this->counter++;
+                $this->results[] = new \App\Models\Result(
+                    $this->engine,
+                    $title,
+                    $link,
+                    $anzeigeLink,
+                    $descr,
+                    $this->gefVon,
+                    $this->counter,
+                    false,
+                    $image
+                );
+            }
+        } catch (\Exception $e) {
+            Log::error("A problem occurred parsing results from $this->name");
             return;
         }
-        $results = $content->xpath('//response/result[@name="response"]/doc');
-        foreach ($results as $result) {
-            $result      = simplexml_load_string($result->saveXML());
-            $title       = $result->xpath('/doc/arr[@name="artikelName"]')[0]->{"str"}->__toString();
-            $link        = $result->xpath('/doc/arr[@name="artikelDeeplink"]')[0]->{"str"}->__toString();
-            $anzeigeLink = parse_url($link);
-            parse_str($anzeigeLink['query'], $query);
-            $anzeigeLink = $query['diurl'];
-            $descr       = $result->xpath('/doc/arr[@name="artikelBeschreibung"]')[0]->{"str"}->__toString();
-            $image       = $result->xpath('/doc/arr[@name="artikelImageurl"]')[0]->{"str"}->__toString();
-            $this->counter++;
-            $this->results[] = new \App\Models\Result(
-                $this->engine,
-                $title,
-                $link,
-                $anzeigeLink,
-                $descr,
-                $this->gefVon,
-                $this->counter,
-                false,
-                $image
-            );
-        }
     }
 }
diff --git a/app/Models/parserSkripte/Opencrawlastronomie.php b/app/Models/parserSkripte/Opencrawlastronomie.php
index 2cb36444d..47d101249 100644
--- a/app/Models/parserSkripte/Opencrawlastronomie.php
+++ b/app/Models/parserSkripte/Opencrawlastronomie.php
@@ -15,39 +15,39 @@ class Opencrawlastronomie extends Searchengine
 
     public function loadResults($result)
     {
+        $result = preg_replace("/\r\n/si", "", $result);
         try {
             $content = simplexml_load_string($result);
-        } catch (\Exception $e) {
-            abort(500, "$result is not a valid xml string");
-        }
-
-        if (!$content) {
-            return;
-        }
-        $results = $content->xpath('//rss/channel/item');
-        $count   = 0;
-        foreach ($results as $result) {
-            if ($count > 10) {
-                break;
+            if (!$content) {
+                return;
             }
 
-            $title       = $result->{"title"}->__toString();
-            $link        = $result->{"link"}->__toString();
-            $anzeigeLink = $link;
-            $descr       = strip_tags($result->{"description"}->__toString());
-            $this->counter++;
-            $this->results[] = new \App\Models\Result(
-                $this->engine,
-                $title,
-                $link,
-                $anzeigeLink,
-                $descr,
-                $this->gefVon,
-                $this->counter
-            );
-            $count++;
-
+            $results = $content->xpath('//rss/channel/item');
+            $count   = 0;
+            foreach ($results as $result) {
+                if ($count > 10) {
+                    break;
+                }
+
+                $title       = $result->{"title"}->__toString();
+                $link        = $result->{"link"}->__toString();
+                $anzeigeLink = $link;
+                $descr       = strip_tags($result->{"description"}->__toString());
+                $this->counter++;
+                $this->results[] = new \App\Models\Result(
+                    $this->engine,
+                    $title,
+                    $link,
+                    $anzeigeLink,
+                    $descr,
+                    $this->gefVon,
+                    $this->counter
+                );
+                $count++;
+            }
+        } catch (\Exception $e) {
+            Log::error("A problem occurred parsing results from $this->name");
+            return;
         }
-
     }
 }
diff --git a/app/Models/parserSkripte/Opencrawlregengergie.php b/app/Models/parserSkripte/Opencrawlregengergie.php
index e601ce52b..b261b3151 100644
--- a/app/Models/parserSkripte/Opencrawlregengergie.php
+++ b/app/Models/parserSkripte/Opencrawlregengergie.php
@@ -15,39 +15,39 @@ class Opencrawlregengergie extends Searchengine
 
     public function loadResults($result)
     {
+        $result = preg_replace("/\r\n/si", "", $result);
         try {
             $content = simplexml_load_string($result);
-        } catch (\Exception $e) {
-            abort(500, "$result is not a valid xml string");
-        }
-
-        if (!$content) {
-            return;
-        }
-        $results = $content->xpath('//rss/channel/item');
-        $count   = 0;
-        foreach ($results as $result) {
-            if ($count > 10) {
-                break;
+            if (!$content) {
+                return;
             }
 
-            $title       = $result->{"title"}->__toString();
-            $link        = $result->{"link"}->__toString();
-            $anzeigeLink = $link;
-            $descr       = strip_tags($result->{"description"}->__toString());
-            $this->counter++;
-            $this->results[] = new \App\Models\Result(
-                $this->engine,
-                $title,
-                $link,
-                $anzeigeLink,
-                $descr,
-                $this->gefVon,
-                $this->counter
-            );
-            $count++;
-
+            $results = $content->xpath('//rss/channel/item');
+            $count   = 0;
+            foreach ($results as $result) {
+                if ($count > 10) {
+                    break;
+                }
+
+                $title       = $result->{"title"}->__toString();
+                $link        = $result->{"link"}->__toString();
+                $anzeigeLink = $link;
+                $descr       = strip_tags($result->{"description"}->__toString());
+                $this->counter++;
+                $this->results[] = new \App\Models\Result(
+                    $this->engine,
+                    $title,
+                    $link,
+                    $anzeigeLink,
+                    $descr,
+                    $this->gefVon,
+                    $this->counter
+                );
+                $count++;
+            }
+        } catch (\Exception $e) {
+            Log::error("A problem occurred parsing results from $this->name");
+            return;
         }
-
     }
 }
diff --git a/app/Models/parserSkripte/Opencrawltauchen.php b/app/Models/parserSkripte/Opencrawltauchen.php
index db07e29d1..b947c36f7 100644
--- a/app/Models/parserSkripte/Opencrawltauchen.php
+++ b/app/Models/parserSkripte/Opencrawltauchen.php
@@ -15,38 +15,39 @@ class Opencrawltauchen extends Searchengine
 
     public function loadResults($result)
     {
+        $result = preg_replace("/\r\n/si", "", $result);
         try {
             $content = simplexml_load_string($result);
-        } catch (\Exception $e) {
-            abort(500, "$result is not a valid xml string");
-        }
-
-        if (!$content) {
-            return;
-        }
-        $results = $content->xpath('//rss/channel/item');
-        $count   = 0;
-        foreach ($results as $result) {
-            if ($count > 10) {
-                break;
+            if (!$content) {
+                return;
             }
 
-            $title       = $result->{"title"}->__toString();
-            $link        = $result->{"link"}->__toString();
-            $anzeigeLink = $link;
-            $descr       = strip_tags($result->{"description"}->__toString());
-            $this->counter++;
-            $this->results[] = new \App\Models\Result(
-                $this->engine,
-                $title,
-                $link,
-                $anzeigeLink,
-                $descr,
-                $this->gefVon,
-                $this->counter
-            );
-            $count++;
-
+            $results = $content->xpath('//rss/channel/item');
+            $count   = 0;
+            foreach ($results as $result) {
+                if ($count > 10) {
+                    break;
+                }
+
+                $title       = $result->{"title"}->__toString();
+                $link        = $result->{"link"}->__toString();
+                $anzeigeLink = $link;
+                $descr       = strip_tags($result->{"description"}->__toString());
+                $this->counter++;
+                $this->results[] = new \App\Models\Result(
+                    $this->engine,
+                    $title,
+                    $link,
+                    $anzeigeLink,
+                    $descr,
+                    $this->gefVon,
+                    $this->counter
+                );
+                $count++;
+            }
+        } catch (\Exception $e) {
+            Log::error("A problem occurred parsing results from $this->name");
+            return;
         }
     }
 }
diff --git a/app/Models/parserSkripte/Overture.php b/app/Models/parserSkripte/Overture.php
index 108e55690..4685f4837 100644
--- a/app/Models/parserSkripte/Overture.php
+++ b/app/Models/parserSkripte/Overture.php
@@ -19,53 +19,67 @@ class Overture extends Searchengine
         $result = preg_replace("/\r\n/si", "", $result);
         try {
             $content = simplexml_load_string($result);
+            if (!$content) {
+                return;
+            }
+
+            $results = $content->xpath('//Results/ResultSet[@id="inktomi"]/Listing');
+            foreach ($results as $result) {
+                $title       = $result["title"];
+                $link        = $result->{"ClickUrl"}->__toString();
+                $anzeigeLink = $result["siteHost"];
+                $descr       = $result["description"];
+                $this->counter++;
+                $this->results[] = new \App\Models\Result(
+                    $this->engine,
+                    $title,
+                    $link,
+                    $anzeigeLink,
+                    $descr,
+                    $this->gefVon,
+                    $this->counter
+                );
+            }
+
+            # Nun noch die Werbeergebnisse:
+            $ads = $content->xpath('//Results/ResultSet[@id="searchResults"]/Listing');
+            foreach ($ads as $ad) {
+                $title       = $ad["title"];
+                $link        = $ad->{"ClickUrl"}->__toString();
+                $anzeigeLink = $ad["siteHost"];
+                $descr       = $ad["description"];
+                $this->counter++;
+                $this->ads[] = new \App\Models\Result(
+                    $this->engine,
+                    $title,
+                    $link,
+                    $anzeigeLink,
+                    $descr,
+                    $this->gefVon,
+                    $this->counter
+                );
+            }
         } catch (\Exception $e) {
-            Log::error("Results from $this->name are not a valid json string");
-            return;
-        }
-        if (!$content) {
+            Log::error("A problem occurred parsing results from $this->name");
             return;
         }
-        $results = $content->xpath('//Results/ResultSet[@id="inktomi"]/Listing');
-        foreach ($results as $result) {
-            $title       = $result["title"];
-            $link        = $result->{"ClickUrl"}->__toString();
-            $anzeigeLink = $result["siteHost"];
-            $descr       = $result["description"];
-            $this->counter++;
-            $this->results[] = new \App\Models\Result(
-                $this->engine,
-                $title,
-                $link,
-                $anzeigeLink,
-                $descr,
-                $this->gefVon,
-                $this->counter
-            );
-        }
-
-        # Nun noch die Werbeergebnisse:
-        $ads = $content->xpath('//Results/ResultSet[@id="searchResults"]/Listing');
-        foreach ($ads as $ad) {
-            $title       = $ad["title"];
-            $link        = $ad->{"ClickUrl"}->__toString();
-            $anzeigeLink = $ad["siteHost"];
-            $descr       = $ad["description"];
-            $this->counter++;
-            $this->ads[] = new \App\Models\Result(
-                $this->engine,
-                $title,
-                $link,
-                $anzeigeLink,
-                $descr,
-                $this->gefVon,
-                $this->counter
-            );
-        }
     }
 
     public function getNext(\App\MetaGer $metager, $result)
     {
+        $result = preg_replace("/\r\n/si", "", $result);
+        try {
+            $content = simplexml_load_string($result);
+            if (!$content) {
+                return;
+            }
+
+            ///////////////////
+        } catch (\Exception $e) {
+            Log::error("A problem occurred parsing results from $this->name");
+            return;
+        }
+
         # Auslesen der Argumente für die nächste Suchseite:
         $result = preg_replace("/\r\n/si", "", $result);
         try {
diff --git a/app/Models/parserSkripte/Pixabay.php b/app/Models/parserSkripte/Pixabay.php
index 7ed67f4b5..ea0cd2d1a 100644
--- a/app/Models/parserSkripte/Pixabay.php
+++ b/app/Models/parserSkripte/Pixabay.php
@@ -19,55 +19,64 @@ class Pixabay extends Searchengine
         $result = preg_replace("/\r\n/si", "", $result);
         try {
             $content = json_decode($result);
-        } catch (\Exception $e) {
-            Log::error("Results from $this->name are not a valid json string");
-            return;
-        }
+            if (!$content) {
+                return;
+            }
 
-        if (!$content) {
+            $results = $content->hits;
+            foreach ($results as $result) {
+                $title       = $result->tags;
+                $link        = $result->pageURL;
+                $anzeigeLink = $link;
+                $descr       = "";
+                $image       = $result->previewURL;
+                $this->counter++;
+                $this->results[] = new \App\Models\Result(
+                    $this->engine,
+                    $title,
+                    $link,
+                    $anzeigeLink,
+                    $descr,
+                    $this->gefVon,
+                    $this->counter,
+                    false,
+                    $image
+                );
+            }
+        } catch (\Exception $e) {
+            Log::error("A problem occurred parsing results from $this->name");
             return;
         }
-
-        $results = $content->hits;
-        foreach ($results as $result) {
-            $title       = $result->tags;
-            $link        = $result->pageURL;
-            $anzeigeLink = $link;
-            $descr       = "";
-            $image       = $result->previewURL;
-            $this->counter++;
-            $this->results[] = new \App\Models\Result(
-                $this->engine,
-                $title,
-                $link,
-                $anzeigeLink,
-                $descr,
-                $this->gefVon,
-                $this->counter,
-                false,
-                $image
-            );
-        }
     }
 
     public function getNext(\App\MetaGer $metager, $result)
     {
-        $page = $metager->getPage() + 1;
         try {
             $content = json_decode($result);
+            if (!$content) {
+                return;
+            }
+
+            $page = $metager->getPage() + 1;
+            try {
+                $content = json_decode($result);
+            } catch (\Exception $e) {
+                Log::error("Results from $this->name are not a valid json string");
+                return;
+            }
+            if (!$content) {
+                return;
+            }
+            if ($page * 20 > $content->total) {
+                return;
+            }
+            $next = new Pixabay(simplexml_load_string($this->engine), $metager);
+            $next->getString .= "&page=" . $page;
+            $next->hash = md5($next->host . $next->getString . $next->port . $next->name);
+            $this->next = $next;
         } catch (\Exception $e) {
-            Log::error("Results from $this->name are not a valid json string");
-            return;
-        }
-        if (!$content) {
-            return;
-        }
-        if ($page * 20 > $content->total) {
+            Log::error("A problem occurred parsing results from $this->name");
             return;
         }
-        $next = new Pixabay(simplexml_load_string($this->engine), $metager);
-        $next->getString .= "&page=" . $page;
-        $next->hash = md5($next->host . $next->getString . $next->port . $next->name);
-        $this->next = $next;
     }
 }
diff --git a/app/Models/parserSkripte/Qip.php b/app/Models/parserSkripte/Qip.php
index c043b7f27..b786656ee 100644
--- a/app/Models/parserSkripte/Qip.php
+++ b/app/Models/parserSkripte/Qip.php
@@ -18,29 +18,30 @@ class Qip extends Searchengine
         $result = preg_replace("/\r\n/si", "", $result);
         try {
             $content = simplexml_load_string($result);
-        } catch (\Exception $e) {
-            abort(500, "$result is not a valid xml string");
-        }
+            if (!$content) {
+                return;
+            }
 
-        if (!$content) {
+            $results = $content->xpath('//channel/item');
+            foreach ($results as $result) {
+                $title       = $result->{"title"}->__toString();
+                $link        = $result->{"link"}->__toString();
+                $anzeigeLink = $link;
+                $descr       = $result->{"description"}->__toString();
+                $this->counter++;
+                $this->results[] = new \App\Models\Result(
+                    $this->engine,
+                    $title,
+                    $link,
+                    $anzeigeLink,
+                    $descr,
+                    $this->gefVon,
+                    $this->counter
+                );
+            }
+        } catch (\Exception $e) {
+            Log::error("A problem occurred parsing results from $this->name");
             return;
         }
-        $results = $content->xpath('//channel/item');
-        foreach ($results as $result) {
-            $title       = $result->{"title"}->__toString();
-            $link        = $result->{"link"}->__toString();
-            $anzeigeLink = $link;
-            $descr       = $result->{"description"}->__toString();
-            $this->counter++;
-            $this->results[] = new \App\Models\Result(
-                $this->engine,
-                $title,
-                $link,
-                $anzeigeLink,
-                $descr,
-                $this->gefVon,
-                $this->counter
-            );
-        }
     }
 }
diff --git a/app/Models/parserSkripte/Radiobrowser.php b/app/Models/parserSkripte/Radiobrowser.php
index 6e78eb1f9..fb9d5edcd 100644
--- a/app/Models/parserSkripte/Radiobrowser.php
+++ b/app/Models/parserSkripte/Radiobrowser.php
@@ -19,44 +19,45 @@ class Radiobrowser extends Searchengine
         $result = preg_replace("/\r\n/si", "", $result);
         try {
             $content = json_decode($result);
-        } catch (\Exception $e) {
-            Log::error("Results from $this->name are not a valid json string");
-            return;
-        }
-        if (!$content) {
-            return;
-        }
-        foreach ($content as $result) {
-            $title       = $result->name;
-            $link        = $result->homepage;
-            $anzeigeLink = $link;
-            $descr       = "";
-            if ($result->tags != "") {
-                $descr .= "Tags: " . $result->tags;
+            if (!$content) {
+                return;
             }
-            if ($result->tags != "") {
-                if ($descr != "") {
-                    $descr .= " - ";
+
+            foreach ($content as $result) {
+                $title       = $result->name;
+                $link        = $result->homepage;
+                $anzeigeLink = $link;
+                $descr       = "";
+                if ($result->tags != "") {
+                    $descr .= "Tags: " . $result->tags;
                 }
-                $descr .= "Country: " . $result->country;
-            }
-            if ($result->tags != "") {
-                if ($descr != "") {
-                    $descr .= " - ";
+                if ($result->tags != "") {
+                    if ($descr != "") {
+                        $descr .= " - ";
+                    }
+                    $descr .= "Country: " . $result->country;
+                }
+                if ($result->tags != "") {
+                    if ($descr != "") {
+                        $descr .= " - ";
+                    }
+                    $descr .= "Language: " . $result->language;
                 }
-                $descr .= "Language: " . $result->language;
+                $this->counter++;
+                $this->results[] = new \App\Models\Result(
+                    $this->engine,
+                    $title,
+                    $link,
+                    $anzeigeLink,
+                    $descr,
+                    $this->gefVon,
+                    $this->counter,
+                    false
+                );
             }
-            $this->counter++;
-            $this->results[] = new \App\Models\Result(
-                $this->engine,
-                $title,
-                $link,
-                $anzeigeLink,
-                $descr,
-                $this->gefVon,
-                $this->counter,
-                false
-            );
+        } catch (\Exception $e) {
+            Log::error("A problem occurred parsing results from $this->name");
+            return;
         }
     }
 }
diff --git a/app/Models/parserSkripte/Tuhh.php b/app/Models/parserSkripte/Tuhh.php
index 6c9150910..05c8bc326 100644
--- a/app/Models/parserSkripte/Tuhh.php
+++ b/app/Models/parserSkripte/Tuhh.php
@@ -15,37 +15,38 @@ class Tuhh extends Searchengine
 
     public function loadResults($result)
     {
+        $result = preg_replace("/\r\n/si", "", $result);
         try {
             $content = simplexml_load_string($result);
-        } catch (\Exception $e) {
-            abort(500, "$result is not a valid xml string");
-        }
-
-        if (!$content) {
-            return;
-        }
-        $count = 0;
-        foreach ($content->{"entry"} as $result) {
-            if ($count > 10) {
-                break;
+            if (!$content) {
+                return;
             }
 
-            $title       = $result->{"title"}->__toString();
-            $link        = $result->{"link"}["href"]->__toString();
-            $anzeigeLink = $link;
-            $descr       = strip_tags($result->{"summary"}->__toString());
-            $this->counter++;
-            $this->results[] = new \App\Models\Result(
-                $this->engine,
-                $title,
-                $link,
-                $anzeigeLink,
-                $descr,
-                $this->gefVon,
-                $this->counter
-            );
-            $count++;
+            $count = 0;
+            foreach ($content->{"entry"} as $result) {
+                if ($count > 10) {
+                    break;
+                }
+
+                $title       = $result->{"title"}->__toString();
+                $link        = $result->{"link"}["href"]->__toString();
+                $anzeigeLink = $link;
+                $descr       = strip_tags($result->{"summary"}->__toString());
+                $this->counter++;
+                $this->results[] = new \App\Models\Result(
+                    $this->engine,
+                    $title,
+                    $link,
+                    $anzeigeLink,
+                    $descr,
+                    $this->gefVon,
+                    $this->counter
+                );
+                $count++;
+            }
+        } catch (\Exception $e) {
+            Log::error("A problem occurred parsing results from $this->name");
+            return;
         }
-
     }
 }
diff --git a/app/Models/parserSkripte/Yacy.php b/app/Models/parserSkripte/Yacy.php
index 05ac7e562..83f0c5a6d 100644
--- a/app/Models/parserSkripte/Yacy.php
+++ b/app/Models/parserSkripte/Yacy.php
@@ -15,38 +15,38 @@ class Yacy extends Searchengine
 
     public function loadResults($result)
     {
-
+        $result = preg_replace("/\r\n/si", "", $result);
         try {
             $content = simplexml_load_string($result);
+            if (!$content) {
+                return;
+            }
+
+            $results = $content->xpath("//rss/channel/item");
+            if (!$results) {
+                return;
+            }
+
+            foreach ($results as $res) {
+                $title       = $res->{"title"};
+                $link        = $res->{"link"};
+                $anzeigeLink = $link;
+                $descr       = $res->{"description"};
+
+                $this->counter++;
+                $this->results[] = new \App\Models\Result(
+                    $this->engine,
+                    $title,
+                    $link,
+                    $anzeigeLink,
+                    $descr,
+                    $this->gefVon,
+                    $this->counter
+                );
+            }
         } catch (\Exception $e) {
-            abort(500, "$result is not a valid xml string");
-        }
-
-        if (!$content) {
-            return;
-        }
-
-        $results = $content->xpath("//rss/channel/item");
-        if (!$results) {
+            Log::error("A problem occurred parsing results from $this->name");
             return;
         }
-
-        foreach ($results as $res) {
-            $title       = $res->{"title"};
-            $link        = $res->{"link"};
-            $anzeigeLink = $link;
-            $descr       = $res->{"description"};
-
-            $this->counter++;
-            $this->results[] = new \App\Models\Result(
-                $this->engine,
-                $title,
-                $link,
-                $anzeigeLink,
-                $descr,
-                $this->gefVon,
-                $this->counter
-            );
-        }
     }
 }
diff --git a/app/Models/parserSkripte/Yacyunih.php b/app/Models/parserSkripte/Yacyunih.php
index beefd276e..a8585f4f3 100644
--- a/app/Models/parserSkripte/Yacyunih.php
+++ b/app/Models/parserSkripte/Yacyunih.php
@@ -15,43 +15,41 @@ class Yacyunih extends Searchengine
 
     public function loadResults($result)
     {
+        $result = preg_replace("/\r\n/si", "", $result);
         try {
             $content = simplexml_load_string($result);
-        } catch (\Exception $e) {
-            abort(500, "$result is not a valid xml string");
-        }
-
-        if (!$content) {
-            return;
-        }
-        $results = $content->xpath('//rss/channel/item');
-        if (!$results) {
-            return;
-        }
-
-        $count = 0;
-        foreach ($results as $result) {
-            if ($count > 10) {
-                break;
+            if (!$content) {
+                return;
             }
 
-            $title       = $result->{"title"}->__toString();
-            $link        = $result->{"link"}->__toString();
-            $anzeigeLink = $link;
-            $descr       = strip_tags($result->{"description"}->__toString());
-            $this->counter++;
-            $this->results[] = new \App\Models\Result(
-                $this->engine,
-                $title,
-                $link,
-                $anzeigeLink,
-                $descr,
-                $this->gefVon,
-                $this->counter
-            );
-            $count++;
-
+            $results = $content->xpath('//rss/channel/item');
+            if (!$results) {
+                return;
+            }
+            $count = 0;
+            foreach ($results as $result) {
+                if ($count > 10) {
+                    break;
+                }
+                $title       = $result->{"title"}->__toString();
+                $link        = $result->{"link"}->__toString();
+                $anzeigeLink = $link;
+                $descr       = strip_tags($result->{"description"}->__toString());
+                $this->counter++;
+                $this->results[] = new \App\Models\Result(
+                    $this->engine,
+                    $title,
+                    $link,
+                    $anzeigeLink,
+                    $descr,
+                    $this->gefVon,
+                    $this->counter
+                );
+                $count++;
+            }
+        } catch (\Exception $e) {
+            Log::error("A problem occurred parsing results from $this->name");
+            return;
         }
-
     }
 }
diff --git a/app/Models/parserSkripte/Yandex.php b/app/Models/parserSkripte/Yandex.php
index dbdf3688f..acf4bc0bc 100644
--- a/app/Models/parserSkripte/Yandex.php
+++ b/app/Models/parserSkripte/Yandex.php
@@ -19,44 +19,39 @@ class Yandex extends Searchengine
         $result = preg_replace("/\r\n/si", "", $result);
         try {
             $content = simplexml_load_string($result);
-        } catch (\Exception $e) {
-            Log::error("Results from $this->name are not a valid json string");
-            return;
-        }
-        if (!$content) {
-            return;
-        }
+            if (!$content) {
+                return;
+            }
 
-        $results = $content;
-        try {
-            $results = $results->xpath("//yandexsearch/response/results/grouping/group");
-        } catch (\ErrorException $e) {
-            return;
-        }
-        foreach ($results as $result) {
-            $title       = strip_tags($result->{"doc"}->{"title"}->asXML());
-            $link        = $result->{"doc"}->{"url"}->__toString();
-            $anzeigeLink = $link;
-            $descr       = strip_tags($result->{"doc"}->{"headline"}->asXML());
-            if (!$descr) {
-                $descr = strip_tags($result->{"doc"}->{"passages"}->asXML());
+            $results = $content->xpath("//yandexsearch/response/results/grouping/group");
+            foreach ($results as $result) {
+                $title       = strip_tags($result->{"doc"}->{"title"}->asXML());
+                $link        = $result->{"doc"}->{"url"}->__toString();
+                $anzeigeLink = $link;
+                $descr       = strip_tags($result->{"doc"}->{"headline"}->asXML());
+                if (!$descr) {
+                    $descr = strip_tags($result->{"doc"}->{"passages"}->asXML());
+                }
+                $this->counter++;
+                $this->results[] = new \App\Models\Result(
+                    $this->engine,
+                    $title,
+                    $link,
+                    $anzeigeLink,
+                    $descr,
+                    $this->gefVon,
+                    $this->counter
+                );
             }
-            $this->counter++;
-            $this->results[] = new \App\Models\Result(
-                $this->engine,
-                $title,
-                $link,
-                $anzeigeLink,
-                $descr,
-                $this->gefVon,
-                $this->counter
-            );
+        } catch (\Exception $e) {
+            Log::error("A problem occurred parsing results from $this->name");
+            return;
         }
     }
 
     public function getNext(\App\MetaGer $metager, $result)
     {
-        # Wir müssen herausfinden, ob es überhaupt noch weitere Ergebnisse von Yandex gibt:
+        $result = preg_replace("/\r\n/si", "", $result);
         try {
             $content = simplexml_load_string($result);
             if (!$content) {
@@ -72,11 +67,9 @@ class Yandex extends Searchengine
             $next = new Yandex(simplexml_load_string($this->engine), $metager);
             $next->getString .= "&page=" . ($metager->getPage() + 1);
             $next->hash = md5($next->host . $next->getString . $next->port . $next->name);
-            $this->next = $next;
         } catch (\Exception $e) {
-            Log::error("Results from $this->name are not a valid json string");
+            Log::error("A problem occurred parsing results from $this->name");
             return;
         }
-
     }
 }
-- 
GitLab