diff --git a/app/MetaGer.php b/app/MetaGer.php index f347e00cb95e6bbba1fb667456f1f098f9e42d4a..18a72d8a3ca58c24c854217f6dbb479dd2789a98 100644 --- a/app/MetaGer.php +++ b/app/MetaGer.php @@ -349,7 +349,7 @@ class MetaGer { # Hier ist ein Advertiser: # Das Logo hinzufügen: - $result->image = "https://img.smartredirect.de/logos_v2/120x60/" . $hash . ".gif"; + $result->logo = "https://img.smartredirect.de/logos_v2/60x30/" . $hash . ".gif"; # Den Link hinzufügen: $publicKey = $publicKey; $targetUrl = $result->anzeigeLink; @@ -748,11 +748,6 @@ class MetaGer } $request->replace($newInput); } - if( $request->has('ebay') ) - { - $this->time = 2000; - $this->warnings[] = "Hinweis: Sie haben Ebay aktiviert. Die Suche kann deshalb länger dauern und die maximale Suchzeit wurde auf 2 Sekunden hochgesetzt."; - } if( App::isLocale("en") ) { $this->sprueche = "off"; diff --git a/app/Models/Result.php b/app/Models/Result.php index 9b2aecda5f509a711a7d7fa0e2332643e7a2df2f..b8424d984eaaaa35da9e8ca16bcf58b5c16879e4 100644 --- a/app/Models/Result.php +++ b/app/Models/Result.php @@ -7,12 +7,12 @@ namespace App\Models; class Result { - function __construct ( \SimpleXMLElement $provider, $titel, $link, $anzeigeLink , $descr, $gefVon, $sourceRank, $partnershop = false, $image = "" ) + function __construct ( \SimpleXMLElement $provider, $titel, $link, $anzeigeLink , $descr, $gefVon, $sourceRank, $partnershop = false, $image = "", $price = 0 ) { $this->titel = strip_tags(trim($titel)); $this->link = trim($link); $this->anzeigeLink = trim($anzeigeLink); - $this->descr = strip_tags(trim($descr)); + $this->descr = strip_tags(trim($descr), '<p>'); $this->descr = preg_replace("/\n+/si", " ", $this->descr); if( strlen($this->descr) > 250 ) { diff --git a/app/Models/parserSkripte/Ebay.php b/app/Models/parserSkripte/Ebay.php index f41757fac24324a7424a69fbb2589ef89dafb119..0494cc9a40acf38e68c556feefe73430479cfca9 100644 --- a/app/Models/parserSkripte/Ebay.php +++ b/app/Models/parserSkripte/Ebay.php @@ -2,6 +2,8 @@ namespace app\Models\parserSkripte; use App\Models\Searchengine; +use DateTimeZone; +use DateTime; class Ebay extends Searchengine { @@ -24,22 +26,26 @@ class Ebay extends Searchengine { return; } - $results = $content->xpath('//rss/channel/item'); + $results = $content; + + $results = $results->{"searchResult"}; $count = 0; - foreach($results as $result) + foreach($results->{"item"} as $result) { - if($count > 10) - break; $title = $result->{"title"}->__toString(); - $link = $result->{"link"}->__toString(); + $link = $result->{"viewItemURL"}->__toString(); $anzeigeLink = $link; - if(preg_match("/.*?href=\"(.+?)\".*src=\"(.+?)\".*<strong><b>EUR<\/b> (.+?)<\/strong>.*?<span>(.+?)<\/span>.*/si", $result->{"description"}->__toString(), $matches) === 1); - $descr = "Ebay-Auktion: läuft bis " . $matches[4] . " | " . $matches[3] . " €"; - $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>.* + $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>"; + $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, @@ -50,7 +56,8 @@ class Ebay extends Searchengine $this->gefVon, $this->counter, false, - $image + $image, + $price ); $count++; diff --git a/app/Models/parserSkripte/Exalead.php b/app/Models/parserSkripte/Exalead.php index 38be504f20b08e61e52178e841047d925a9114a5..3714ad9565d6fc50df9d12e014a1a0ba88c176d1 100644 --- a/app/Models/parserSkripte/Exalead.php +++ b/app/Models/parserSkripte/Exalead.php @@ -39,11 +39,12 @@ class Exalead extends Searchengine } $results->registerXPathNamespace($prefix,$namespace); try{ - $results = $results->xpath("//a:hits/a:Hit"); + $results = $results->xpath("//a:searchResult/a:item"); } catch(\ErrorException $e) { return; } + die(var_dump($results)); foreach($results as $result) { try{ diff --git a/app/Models/parserSkripte/Fairmondo.php b/app/Models/parserSkripte/Fairmondo.php index 9f09c06e4b2a8bf179d917910b0b476a18b72acd..270954a92d0bc1f1b92c0134f2f716f330c1fd92 100644 --- a/app/Models/parserSkripte/Fairmondo.php +++ b/app/Models/parserSkripte/Fairmondo.php @@ -23,10 +23,12 @@ class Fairmondo extends Searchengine $title = $result["title"]; $link = "https://www.fairmondo.de/articles/" . $result["id"]; $anzeigeLink = $link; - $descr = $result["slug"]; + $price = 0; + $descr = ""; if( isset($result['price_cents'])) { - $descr .= " | Preis: " . (intval($result['price_cents']) / 100.0) . " €"; + $price = intval($result['price_cents']); + $descr .= "<p>Preis: " . (intval($result['price_cents']) / 100.0) . " €</p>"; } if( isset($result['title_image_url']) ) { @@ -43,7 +45,8 @@ class Fairmondo extends Searchengine $this->gefVon, $this->counter, false, - $image + $image, + $price ); } } diff --git a/public/css/styleResultPage.css b/public/css/styleResultPage.css index 08d711ccc158c0842d0f74cc00523485c9ccd328..1fd4eca51aaf53bad948deee4f759c494c70a8c0 100644 --- a/public/css/styleResultPage.css +++ b/public/css/styleResultPage.css @@ -327,6 +327,11 @@ a:hover clear: both; } +.result .description p { + margin: 0; + margin-bottom: 4px; +} + .result .description img { margin:5px; margin-left:0; diff --git a/resources/views/layouts/result.blade.php b/resources/views/layouts/result.blade.php index 408d97e2cb0cd7359be5cd5dad3100a593743456..fbe0ea1aa7c63414e13ec475d45b163fc9d3c3c4 100644 --- a/resources/views/layouts/result.blade.php +++ b/resources/views/layouts/result.blade.php @@ -3,6 +3,7 @@ {{ $result->number }}) </div> <div class="resultInformation col-xs-12 col-sm-11"> + <div class="col-xs-10 col-sm-11" style="padding:0; "> <p class="title"> <a class="title" href="{{ $result->link }}" target="{{ $metager->getTab() }}" data-hoster="{{ strip_tags($result->gefVon) }}" data-count="{{ $result->number }}"> {{ $result->titel }} @@ -58,12 +59,20 @@ anonym öffnen </a> </div> + </div> + @if( isset($result->logo) ) + <div class="col-xs-2 col-sm-1" style="padding: 0;"> + <a href="{{ $result->link }}" target="{{ $metager->getTab() }}" data-hoster="{{ strip_tags($result->gefVon) }}" data-count="{{ $result->number }}"> + <img src="{{ $metager->getImageProxyLink($result->logo) }}" alt="" /> + </a> + </div> + @endif @if( $result->image !== "" ) <div class="description"> <a href="{{ $result->link }}" target="{{ $metager->getTab() }}" data-hoster="{{ strip_tags($result->gefVon) }}" data-count="{{ $result->number }}"> <img src="{{ $metager->getImageProxyLink($result->image) }}" align="left" width="120px" height="60px" alt="" /> </a> - {{ $result->descr }} + {!! $result->descr !!} </div> @else <div class="description">{{ $result->descr }}</div>