From d3664a87d0ca1c02a0c74a0fa558523f90ad8946 Mon Sep 17 00:00:00 2001
From: Karl <Karl Hasselbring>
Date: Thu, 4 Aug 2016 09:49:13 +0200
Subject: [PATCH] Die Ebay-Produktsuche ist jetzt relativ instabil eingebaut,
 da sie nur das RSS parsed.

---
 app/Models/parserSkripte/Ebay.php | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/app/Models/parserSkripte/Ebay.php b/app/Models/parserSkripte/Ebay.php
index 313f69626..f41757fac 100644
--- a/app/Models/parserSkripte/Ebay.php
+++ b/app/Models/parserSkripte/Ebay.php
@@ -33,7 +33,13 @@ class Ebay extends Searchengine
 			$title = $result->{"title"}->__toString();
 			$link = $result->{"link"}->__toString();
 			$anzeigeLink = $link;
-			$descr = strip_tags($result->{"description"}->__toString());
+			if(preg_match("/.*?href=\"(.+?)\".*src=\"(.+?)\".*<strong><b>EUR<\/b> (.+?)<\/strong>.*?<span>(.+?)<\/span>.*/si", $result->{"description"}->__toString(), $matches) === 1);
+			$descr = "Ebay-Auktion: l&auml;uft bis " . $matches[4] . " | " . $matches[3] . " &euro;";
+			$image = $matches[2];
+			# die($result->{"description"}->__toString());
+			# $descr = strip_tags($result->{"description"}->__toString());
+			# $descr = $result->{"description"}->__toString();
+			# .*?href="(.+?)".*src="(.+?)".*<strong><b>EUR<\/b> (.+?)<\/strong>.*?<div>(.+?)<\/div>.*
 			$this->counter++;
 			$this->results[] = new \App\Models\Result(
 				$this->engine,
@@ -42,7 +48,9 @@ class Ebay extends Searchengine
 				$anzeigeLink,
 				$descr,
 				$this->gefVon,
-				$this->counter
+				$this->counter,
+				false,
+				$image
 			);
 			$count++;
 
-- 
GitLab