diff --git a/app/Models/parserSkripte/Allesklar.php b/app/Models/parserSkripte/Allesklar.php index 6f78151e31556392f27acfa2667bd616a84ffdf4..2f5bb9e2c7f8dfc46fba1f8566eaae0a91931a12 100644 --- a/app/Models/parserSkripte/Allesklar.php +++ b/app/Models/parserSkripte/Allesklar.php @@ -20,36 +20,37 @@ class Allesklar extends Searchengine $crawler = $crawler ->filter('table[width=585]') ->reduce(function (Crawler $node, $i) { - if ($i < 5) { - return false; - } + // The first 5 elements are additional information + return $i >= 5; }); - $this->counter = 0; - $crawler->filter('table')->each(function (Crawler $node, $i) { - try { - $this->string = ""; - $titleTag = $node->filter('tr > td > a')->first(); - $title = trim($titleTag->filter('a')->text()); - $link = $titleTag->filter('a')->attr('href'); - if ($i === 0) { - $descr = trim($node->filter('tr > td.bodytext')->eq(3)->text()); - } else { + $crawler->each(function (Crawler $node, $i) { + // Only the first 20 elements are actual search results + if ($i < 20) { + try { + $titleTag = $node->filter('tr > td > a.katalogtitel')->first(); + $title = trim($titleTag->text()); + $link = $titleTag->attr('href'); + // Sometimes the description is in the 3rd element $descr = trim($node->filter('tr > td.bodytext')->eq(2)->text()); + if (strlen($descr) <= 2) { + $descr = trim($node->filter('tr > td.bodytext')->eq(3)->text()); + } + $this->counter++; + $this->results[] = new \App\Models\Result( + $this->engine, + $title, + $link, + $link, + $descr, + $this->gefVon, + $this->counter + ); + } catch (\Exception $e) { + Log::error("A problem occurred parsing results from $this->name:"); + Log::error($e->getMessage()); + return; } - $this->counter++; - $this->results[] = new \App\Models\Result( - $this->engine, - $title, - $link, - $link, - $descr, - $this->gefVon, - $this->counter - ); - } catch (\Exception $e) { - Log::error("A problem occurred parsing results from $this->name"); - return; } }); } diff --git a/app/Models/parserSkripte/BASE.php b/app/Models/parserSkripte/BASE.php index c1cf610a4c53ee40a15e8b37d9abe42411cddf4f..b63345cf2ea5d54e6a53d25c8185e7e0e84b7e5f 100644 --- a/app/Models/parserSkripte/BASE.php +++ b/app/Models/parserSkripte/BASE.php @@ -55,7 +55,8 @@ class BASE extends Searchengine } } } catch (\Exception $e) { - Log::error("A problem occurred parsing results from $this->name"); + Log::error("A problem occurred parsing results from $this->name:"); + Log::error($e->getMessage()); return; } } diff --git a/app/Models/parserSkripte/Bing.php b/app/Models/parserSkripte/Bing.php index fcdce0dcea311c3d8f9b9d40222f1c8f0811329f..b31946faae7fa990fbacf7a053d97631f40560a7 100644 --- a/app/Models/parserSkripte/Bing.php +++ b/app/Models/parserSkripte/Bing.php @@ -36,7 +36,8 @@ class Bing extends Searchengine ); }); } catch (\Exception $e) { - Log::error("A problem occurred parsing results from $this->name"); + Log::error("A problem occurred parsing results from $this->name:"); + Log::error($e->getMessage()); return; } diff --git a/app/Models/parserSkripte/Blogsearch.php b/app/Models/parserSkripte/Blogsearch.php index a6cc51d4ce692ef111444313bcbf93f8e326c6d1..3f6f16edb1728e598e1ada71ff438436d98ebc57 100644 --- a/app/Models/parserSkripte/Blogsearch.php +++ b/app/Models/parserSkripte/Blogsearch.php @@ -40,7 +40,8 @@ class Blogsearch extends Searchengine ); } } catch (\Exception $e) { - Log::error("A problem occurred parsing results from $this->name"); + Log::error("A problem occurred parsing results from $this->name:"); + Log::error($e->getMessage()); return; } } diff --git a/app/Models/parserSkripte/Dailymotion.php b/app/Models/parserSkripte/Dailymotion.php index f249c1038ff05d0112c4ef81666b1de9f9c035a4..fbd6247f0cbddbd0c7db56e8ee4836888d000aa7 100644 --- a/app/Models/parserSkripte/Dailymotion.php +++ b/app/Models/parserSkripte/Dailymotion.php @@ -43,7 +43,8 @@ class Dailymotion extends Searchengine ); } } catch (\Exception $e) { - Log::error("A problem occurred parsing results from $this->name"); + Log::error("A problem occurred parsing results from $this->name:"); + Log::error($e->getMessage()); return; } } diff --git a/app/Models/parserSkripte/Ebay.php b/app/Models/parserSkripte/Ebay.php index 8a1cfa342eea036eba4e35a0dc1540093b83f171..14c181b13fd07d04256fca87b8f54a2ce3954d41 100644 --- a/app/Models/parserSkripte/Ebay.php +++ b/app/Models/parserSkripte/Ebay.php @@ -59,7 +59,8 @@ class Ebay extends Searchengine $count++; } } catch (\Exception $e) { - Log::error("A problem occurred parsing results from $this->name"); + Log::error("A problem occurred parsing results from $this->name:"); + Log::error($e->getMessage()); return; } } diff --git a/app/Models/parserSkripte/Ecoshopper.php b/app/Models/parserSkripte/Ecoshopper.php index fca12fbbd84391aee4987edcda06271bdb66a110..47f0c4073163da5a7d5a78ff2863b945c8b22cfb 100644 --- a/app/Models/parserSkripte/Ecoshopper.php +++ b/app/Models/parserSkripte/Ecoshopper.php @@ -56,7 +56,8 @@ class Ecoshopper extends Searchengine ); } } catch (\Exception $e) { - Log::error("A problem occurred parsing results from $this->name"); + Log::error("A problem occurred parsing results from $this->name:"); + Log::error($e->getMessage()); return; } } diff --git a/app/Models/parserSkripte/Europeana.php b/app/Models/parserSkripte/Europeana.php index 3aa5d10d6304623571ea040dc817b79c4bad75a0..79ebc6c1477922e511f3a5675a2835b3f1bdb6f3 100644 --- a/app/Models/parserSkripte/Europeana.php +++ b/app/Models/parserSkripte/Europeana.php @@ -50,7 +50,8 @@ class Europeana extends Searchengine } } } catch (\Exception $e) { - Log::error("A problem occurred parsing results from $this->name"); + Log::error("A problem occurred parsing results from $this->name:"); + Log::error($e->getMessage()); return; } } @@ -72,7 +73,8 @@ class Europeana extends Searchengine $next->hash = md5($next->host . $next->getString . $next->port . $next->name); $this->next = $next; } catch (\Exception $e) { - Log::error("A problem occurred parsing results from $this->name"); + Log::error("A problem occurred parsing results from $this->name:"); + Log::error($e->getMessage()); return; } } diff --git a/app/Models/parserSkripte/Exalead.php b/app/Models/parserSkripte/Exalead.php index 6ba8b3b19caf5cb5e9b89a3eda85c9bd87c0f9cc..0418f497f6b471f0b990f120d831f143c0b9a5db 100644 --- a/app/Models/parserSkripte/Exalead.php +++ b/app/Models/parserSkripte/Exalead.php @@ -70,7 +70,8 @@ class Exalead extends Searchengine } } } catch (\Exception $e) { - Log::error("A problem occurred parsing results from $this->name"); + Log::error("A problem occurred parsing results from $this->name:"); + Log::error($e->getMessage()); return; } } diff --git a/app/Models/parserSkripte/Fernsehsuche.php b/app/Models/parserSkripte/Fernsehsuche.php index b195a89c45eac3358a141f118926036caf978dba..deb92f0c982b52c808775f9d8a19a5a8a22808e2 100644 --- a/app/Models/parserSkripte/Fernsehsuche.php +++ b/app/Models/parserSkripte/Fernsehsuche.php @@ -47,7 +47,8 @@ class Fernsehsuche extends Searchengine } } } catch (\Exception $e) { - Log::error("A problem occurred parsing results from $this->name"); + Log::error("A problem occurred parsing results from $this->name:"); + Log::error($e->getMessage()); return; } } diff --git a/app/Models/parserSkripte/Flickr.php b/app/Models/parserSkripte/Flickr.php index ad6c00f6ff808554d42702cdfc198a0c2bd3b418..55540a35099dec9e5f6b193ac149f9831ebbb9b3 100644 --- a/app/Models/parserSkripte/Flickr.php +++ b/app/Models/parserSkripte/Flickr.php @@ -44,7 +44,8 @@ class Flickr extends Searchengine ); } } catch (\Exception $e) { - Log::error("A problem occurred parsing results from $this->name"); + Log::error("A problem occurred parsing results from $this->name:"); + Log::error($e->getMessage()); return; } } @@ -68,7 +69,8 @@ class Flickr extends Searchengine $next->hash = md5($next->host . $next->getString . $next->port . $next->name); $this->next = $next; } catch (\Exception $e) { - Log::error("A problem occurred parsing results from $this->name"); + Log::error("A problem occurred parsing results from $this->name:"); + Log::error($e->getMessage()); return; } } diff --git a/app/Models/parserSkripte/Mg_produkt2.php b/app/Models/parserSkripte/Mg_produkt2.php index 4e1751cf5ab70dd81a6c0be6fb237301368052dc..f6e39e48fea8bf4857b1694064cf4f59690f45eb 100644 --- a/app/Models/parserSkripte/Mg_produkt2.php +++ b/app/Models/parserSkripte/Mg_produkt2.php @@ -49,7 +49,8 @@ class Mg_produkt2 extends Searchengine ); } } catch (\Exception $e) { - Log::error("A problem occurred parsing results from $this->name"); + Log::error("A problem occurred parsing results from $this->name:"); + Log::error($e->getMessage()); return; } } diff --git a/app/Models/parserSkripte/Openclipart.php b/app/Models/parserSkripte/Openclipart.php index f2b44ce1fdc2daa5cbc122bf23258171525c457c..6f81354877778c9e3ff156bbe59435309b68e47a 100644 --- a/app/Models/parserSkripte/Openclipart.php +++ b/app/Models/parserSkripte/Openclipart.php @@ -44,7 +44,8 @@ class Openclipart extends Searchengine ); } } catch (\Exception $e) { - Log::error("A problem occurred parsing results from $this->name"); + Log::error("A problem occurred parsing results from $this->name:"); + Log::error($e->getMessage()); return; } } @@ -65,7 +66,8 @@ class Openclipart extends Searchengine $next->hash = md5($next->host . $next->getString . $next->port . $next->name); $this->next = $next; } catch (\Exception $e) { - Log::error("A problem occurred parsing results from $this->name"); + Log::error("A problem occurred parsing results from $this->name:"); + Log::error($e->getMessage()); return; } } diff --git a/app/Models/parserSkripte/Opencrawlastronomie.php b/app/Models/parserSkripte/Opencrawlastronomie.php index 47d101249e79b98407d2756c23b44b43c38b1f8b..4667e241ab01dbbeb1d118939ba940154bda0a26 100644 --- a/app/Models/parserSkripte/Opencrawlastronomie.php +++ b/app/Models/parserSkripte/Opencrawlastronomie.php @@ -46,7 +46,8 @@ class Opencrawlastronomie extends Searchengine $count++; } } catch (\Exception $e) { - Log::error("A problem occurred parsing results from $this->name"); + Log::error("A problem occurred parsing results from $this->name:"); + Log::error($e->getMessage()); return; } } diff --git a/app/Models/parserSkripte/Opencrawlregengergie.php b/app/Models/parserSkripte/Opencrawlregengergie.php index b261b3151007973c02663055962b8056546553b7..92dee253ca03e4dc32ad2b4fcbf05be1417333fc 100644 --- a/app/Models/parserSkripte/Opencrawlregengergie.php +++ b/app/Models/parserSkripte/Opencrawlregengergie.php @@ -46,7 +46,8 @@ class Opencrawlregengergie extends Searchengine $count++; } } catch (\Exception $e) { - Log::error("A problem occurred parsing results from $this->name"); + Log::error("A problem occurred parsing results from $this->name:"); + Log::error($e->getMessage()); return; } } diff --git a/app/Models/parserSkripte/Opencrawltauchen.php b/app/Models/parserSkripte/Opencrawltauchen.php index b947c36f78cc8c1a0d2b59737b594b03414fcd24..4339487563816b912337a8b6a0c6c8a044d7d060 100644 --- a/app/Models/parserSkripte/Opencrawltauchen.php +++ b/app/Models/parserSkripte/Opencrawltauchen.php @@ -46,7 +46,8 @@ class Opencrawltauchen extends Searchengine $count++; } } catch (\Exception $e) { - Log::error("A problem occurred parsing results from $this->name"); + Log::error("A problem occurred parsing results from $this->name:"); + Log::error($e->getMessage()); return; } } diff --git a/app/Models/parserSkripte/Overture.php b/app/Models/parserSkripte/Overture.php index 4685f4837392eac1898bca3e102e47a8ca0db316..791e5b41fae6e4503af53b851aaaa9fbfd5b2726 100644 --- a/app/Models/parserSkripte/Overture.php +++ b/app/Models/parserSkripte/Overture.php @@ -60,7 +60,8 @@ class Overture extends Searchengine ); } } catch (\Exception $e) { - Log::error("A problem occurred parsing results from $this->name"); + Log::error("A problem occurred parsing results from $this->name:"); + Log::error($e->getMessage()); return; } } @@ -73,10 +74,9 @@ class Overture extends Searchengine if (!$content) { return; } - - /////////////////// } catch (\Exception $e) { - Log::error("A problem occurred parsing results from $this->name"); + Log::error("A problem occurred parsing results from $this->name:"); + Log::error($e->getMessage()); return; } diff --git a/app/Models/parserSkripte/OvertureAds.php b/app/Models/parserSkripte/OvertureAds.php index d11b42b062276c343f0695685cdd2b2095bae3ae..dcca4fa386259957037415f489a77532d43d6e2d 100644 --- a/app/Models/parserSkripte/OvertureAds.php +++ b/app/Models/parserSkripte/OvertureAds.php @@ -39,7 +39,8 @@ class OvertureAds extends Searchengine ); } } catch (\Exception $e) { - Log::error("A problem occurred parsing results from $this->name"); + Log::error("A problem occurred parsing results from $this->name:"); + Log::error($e->getMessage()); return; } } diff --git a/app/Models/parserSkripte/Pixabay.php b/app/Models/parserSkripte/Pixabay.php index ea0cd2d1a9b344bfc633ca6a40e31b9e9201a23e..8fd7087729234c4a6a6b11bf373f668412db0f4c 100644 --- a/app/Models/parserSkripte/Pixabay.php +++ b/app/Models/parserSkripte/Pixabay.php @@ -44,7 +44,8 @@ class Pixabay extends Searchengine ); } } catch (\Exception $e) { - Log::error("A problem occurred parsing results from $this->name"); + Log::error("A problem occurred parsing results from $this->name:"); + Log::error($e->getMessage()); return; } } @@ -75,7 +76,8 @@ class Pixabay extends Searchengine $next->hash = md5($next->host . $next->getString . $next->port . $next->name); $this->next = $next; } catch (\Exception $e) { - Log::error("A problem occurred parsing results from $this->name"); + Log::error("A problem occurred parsing results from $this->name:"); + Log::error($e->getMessage()); return; } } diff --git a/app/Models/parserSkripte/Qip.php b/app/Models/parserSkripte/Qip.php index b786656eefd5a850b40ea5120b885421180d077b..7e818042aee0d01ef8222cf9d0b0839993af040c 100644 --- a/app/Models/parserSkripte/Qip.php +++ b/app/Models/parserSkripte/Qip.php @@ -40,7 +40,8 @@ class Qip extends Searchengine ); } } catch (\Exception $e) { - Log::error("A problem occurred parsing results from $this->name"); + Log::error("A problem occurred parsing results from $this->name:"); + Log::error($e->getMessage()); return; } } diff --git a/app/Models/parserSkripte/Radiobrowser.php b/app/Models/parserSkripte/Radiobrowser.php index fb9d5edcd015fac02c6d71131dc7e310186952d6..ba49319b9267e4ab95df448f5a2e1ef60309590a 100644 --- a/app/Models/parserSkripte/Radiobrowser.php +++ b/app/Models/parserSkripte/Radiobrowser.php @@ -56,7 +56,8 @@ class Radiobrowser extends Searchengine ); } } catch (\Exception $e) { - Log::error("A problem occurred parsing results from $this->name"); + Log::error("A problem occurred parsing results from $this->name:"); + Log::error($e->getMessage()); return; } } diff --git a/app/Models/parserSkripte/Tuhh.php b/app/Models/parserSkripte/Tuhh.php index 05c8bc326910bc0529ab152c6242b7dfee02c149..75cf37c5921d3717612639825a81e9bfed98046c 100644 --- a/app/Models/parserSkripte/Tuhh.php +++ b/app/Models/parserSkripte/Tuhh.php @@ -45,7 +45,8 @@ class Tuhh extends Searchengine $count++; } } catch (\Exception $e) { - Log::error("A problem occurred parsing results from $this->name"); + Log::error("A problem occurred parsing results from $this->name:"); + Log::error($e->getMessage()); return; } } diff --git a/app/Models/parserSkripte/Yacy.php b/app/Models/parserSkripte/Yacy.php index 83f0c5a6de669ca2fe25f695dd8b50b7bbe08a29..57558f992279e4fcc6a4515bdae249a45d1311f4 100644 --- a/app/Models/parserSkripte/Yacy.php +++ b/app/Models/parserSkripte/Yacy.php @@ -45,7 +45,8 @@ class Yacy extends Searchengine ); } } catch (\Exception $e) { - Log::error("A problem occurred parsing results from $this->name"); + Log::error("A problem occurred parsing results from $this->name:"); + Log::error($e->getMessage()); return; } } diff --git a/app/Models/parserSkripte/Yacyunih.php b/app/Models/parserSkripte/Yacyunih.php index a8585f4f3bf6f6c5fc0cf132a060f6dd3afc48a3..58c5531acb7e96de11bbcba3a4b3bc1e21dbe49e 100644 --- a/app/Models/parserSkripte/Yacyunih.php +++ b/app/Models/parserSkripte/Yacyunih.php @@ -48,7 +48,8 @@ class Yacyunih extends Searchengine $count++; } } catch (\Exception $e) { - Log::error("A problem occurred parsing results from $this->name"); + Log::error("A problem occurred parsing results from $this->name:"); + Log::error($e->getMessage()); return; } } diff --git a/app/Models/parserSkripte/Yandex.php b/app/Models/parserSkripte/Yandex.php index acf4bc0bc99cdeef1e243c9ebd63b0ee3b16db8e..6553d09cf3a3775969813a18ecd2a118ae11d5f5 100644 --- a/app/Models/parserSkripte/Yandex.php +++ b/app/Models/parserSkripte/Yandex.php @@ -44,7 +44,8 @@ class Yandex extends Searchengine ); } } catch (\Exception $e) { - Log::error("A problem occurred parsing results from $this->name"); + Log::error("A problem occurred parsing results from $this->name:"); + Log::error($e->getMessage()); return; } } @@ -68,7 +69,8 @@ class Yandex extends Searchengine $next->getString .= "&page=" . ($metager->getPage() + 1); $next->hash = md5($next->host . $next->getString . $next->port . $next->name); } catch (\Exception $e) { - Log::error("A problem occurred parsing results from $this->name"); + Log::error("A problem occurred parsing results from $this->name:"); + Log::error($e->getMessage()); return; } }