diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 95aedbd35282e0f616398b7c969c15863d81118c..1638ba2049a1c683ef167786bca28922ff4cc3dd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,7 +2,7 @@ update(144.76.113.134): tags: - 144.76.113.134 only: - - master + - master@open-source/MetaGer before_script: # Abhängigkeiten überprüfen - which composer @@ -39,7 +39,7 @@ update(metager2): tags: - metager2 only: - - master + - master@open-source/MetaGer before_script: # Abhängigkeiten überprüfen - which composer @@ -76,7 +76,7 @@ update(metager3.de): tags: - metager3 only: - - development + - development@open-source/MetaGer before_script: # Abhängigkeiten überprüfen - which composer diff --git a/app/Http/Controllers/LogController.php b/app/Http/Controllers/LogController.php index 8a2302ed08898e6b8328393b30fb90f54c79b458..be4b0e7bcbf232f841773735e693ead65362ebfc 100644 --- a/app/Http/Controllers/LogController.php +++ b/app/Http/Controllers/LogController.php @@ -26,4 +26,22 @@ class LogController extends Controller return ''; } + function pluginClose() + { + $redis = Redis::connection('redisLogs'); + if( $redis ) + { + $redis->incr('logs.plugin.close'); + } + } + + function pluginInstall() + { + $redis = Redis::connection('redisLogs'); + if( $redis ) + { + $redis->incr('logs.plugin.install'); + } + } + } \ No newline at end of file diff --git a/app/Http/Controllers/MailController.php b/app/Http/Controllers/MailController.php index a914ea40bea5f0157db2778bd0096fa74700ba87..a536f3b8c35ca147e46ac99c0231536e3bf64083 100644 --- a/app/Http/Controllers/MailController.php +++ b/app/Http/Controllers/MailController.php @@ -4,6 +4,7 @@ namespace App\Http\Controllers; use App\Http\Controllers\Controller; use Illuminate\Http\Request; +use LaravelLocalization; use Mail; class MailController extends Controller @@ -14,56 +15,56 @@ class MailController extends Controller * @param int $id * @return Response */ - public function contactMail(Request $request){ + public function contactMail(Request $request) + { # Nachricht, die wir an den Nutzer weiterleiten: - $messageType = ""; # [success|error] + $messageType = ""; # [success|error] $returnMessage = ''; - $replyTo = $request->input('email', 'noreply@metager.de'); - if($replyTo === ""){ + $replyTo = $request->input('email', 'noreply@metager.de'); + if ($replyTo === "") { $replyTo = "noreply@metager.de"; - }else{ + } else { $replyTo = $request->input('email'); } - if(!$request->has('message')){ - $messageType = "error"; + if (!$request->has('message')) { + $messageType = "error"; $returnMessage = "Tut uns leid, aber leider haben wir mit Ihrer Kontaktanfrage keine Daten erhalten. Die Email wurde nicht versand"; - }else{ + } else { # Wir versenden die Mail des Benutzers an uns: $message = $request->input('message'); $subject = "[Ticket " . date("Y") . date("d") . date("m") . date("H") . date("i") . date("s") . "] MetaGer - Kontaktanfrage"; - if( Mail::send(['text' => 'kontakt.mail'], ['messageText'=>$message], function($message) use($replyTo, $subject){ + if (Mail::send(['text' => 'kontakt.mail'], ['messageText' => $message], function ($message) use ($replyTo, $subject) { $message->to("office@suma-ev.de", $name = null); $message->from($replyTo, $name = null); $message->replyTo($replyTo, $name = null); $message->subject($subject); - }) ){ + })) { # Mail erfolgreich gesendet - $messageType = "success"; + $messageType = "success"; $returnMessage = 'Ihre Email wurde uns erfolgreich zugestellt. Vielen Dank dafür! Wir werden diese schnellstmöglich bearbeiten und uns dann ggf. wieder bei Ihnen melden.'; - }else{ + } else { # Fehler beim senden der Email - $messageType = "error"; + $messageType = "error"; $returnMessage = 'Beim Senden Ihrer Email ist ein Fehler aufgetreten. Bitte schicken Sie eine Email an: office@suma-ev.de, damit wir uns darum kümmern können.'; } $messageType = "success"; } - return view('kontakt.kontakt') - ->with('title', 'Kontakt') - ->with('css', 'kontakt.css') - ->with('js', ['openpgp.min.js','kontakt.js']) - ->with( $messageType, $returnMessage ); + ->with('title', 'Kontakt') + ->with('css', 'kontakt.css') + ->with('js', ['openpgp.min.js', 'kontakt.js']) + ->with($messageType, $returnMessage); } public function donation(Request $request) { # Der enthaltene String wird dem Benutzer nach der Spende ausgegeben $messageToUser = ""; - $messageType = ""; # [success|error] + $messageType = ""; # [success|error] # Folgende Felder werden vom Spendenformular als Input übergeben: # Name @@ -72,10 +73,10 @@ class MailController extends Controller # Kontonummer ( IBAN ) # Bankleitzahl ( BIC ) # Nachricht - if(!$request->has('Kontonummer') || !$request->has('Bankleitzahl') || !$request->has('Nachricht')){ + if (!$request->has('Kontonummer') || !$request->has('Bankleitzahl') || !$request->has('Nachricht')) { $messageToUser = "Sie haben eins der folgenden Felder nicht ausgefüllt: IBAN, BIC, Nachricht. Bitte korrigieren Sie Ihre Eingabe und versuchen es erneut.\n"; - $messageType = "error"; - }else{ + $messageType = "error"; + } else { $message = "\r\nName: " . $request->input('Name', 'Keine Angabe'); $message .= "\r\nTelefon: " . $request->input('Telefon', 'Keine Angabe'); $message .= "\r\nKontonummer: " . $request->input('Kontonummer'); @@ -87,29 +88,35 @@ class MailController extends Controller $messageToUser .= "Die eingegebene Email-Addresse ($replyTo) scheint nicht korrekt zu sein."; } - try{ - if(Mail::send(['text' => 'kontakt.mail'], ['messageText'=>$message], function($message) use($replyTo){ + try { + if (Mail::send(['text' => 'kontakt.mail'], ['messageText' => $message], function ($message) use ($replyTo) { $message->to("office@suma-ev.de", $name = null); $message->from($replyTo, $name = null); $message->replyTo($replyTo, $name = null); $message->subject("MetaGer - Spende"); })) { - $messageType = "success"; - $messageToUser = "Wir haben Ihre Spendenbenachrichtigung dankend erhalten. Eine persönliche Nachricht erhalten Sie in nächster Zeit, falls sie Ihre Kontaktdaten angegeben haben."; - }else{ - $messageType = "error"; + $messageType = "success"; + $messageToUser = "Herzlichen Dank!! Wir haben Ihre Spendenbenachrichtigung erhalten."; + } else { + $messageType = "error"; $messageToUser = 'Beim Senden Ihrer Spendenbenachrichtigung ist ein Fehler auf unserer Seite aufgetreten. Bitte schicken Sie eine Email an: office@suma-ev.de, damit wir uns darum kümmern können.'; } - } catch( \Swift_TransportException $e ){ - $messageType = "error"; + } catch (\Swift_TransportException $e) { + $messageType = "error"; $messageToUser = 'Beim Senden Ihrer Spendenbenachrichtigung ist ein Fehler auf unserer Seite aufgetreten. Bitte schicken Sie eine Email an: office@suma-ev.de, damit wir uns darum kümmern können.'; } } - - return view('spende.spende') + if ($messageType === "error") { + return view('spende.danke') ->with('title', 'Kontakt') ->with('css', 'donation.css') - ->with($messageType,$messageToUser); + ->with($messageType, $messageToUser); + } else { + $data = ['name' => $request->input('Name', 'Keine Angabe'), 'telefon' => $request->input('Telefon', 'Keine Angabe'), 'kontonummer' => $request->input('Kontonummer'), 'bankleitzahl' => $request->input('Bankleitzahl'), 'email' => $request->input('email', 'anonymous-user@metager.de'), 'nachricht' => $request->input('Nachricht')]; + $data = base64_encode(serialize($data)); + return redirect(LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), route("danke", ['data' => $data]))); + } + } -} \ No newline at end of file +} diff --git a/app/Http/Controllers/MetaGerSearch.php b/app/Http/Controllers/MetaGerSearch.php index d1b179e30ee8b9040ea413a9ff117767eb76903a..b659fe161aef9e5303eec84dac9221337b42f29c 100644 --- a/app/Http/Controllers/MetaGerSearch.php +++ b/app/Http/Controllers/MetaGerSearch.php @@ -4,9 +4,6 @@ namespace App\Http\Controllers; use App\Http\Controllers\Controller; use Illuminate\Http\Request; -#use App\MetaGer\Forwarder; -#use App\MetaGer\Results; -#use App\MetaGer\Search; use App; use App\MetaGer; diff --git a/app/Http/Controllers/StartpageController.php b/app/Http/Controllers/StartpageController.php index 6a22e7a6f3e4aa3c13279bedcbd179a3efcb7863..0725cc28990486194103244cfa25c3eb43da83e0 100644 --- a/app/Http/Controllers/StartpageController.php +++ b/app/Http/Controllers/StartpageController.php @@ -75,9 +75,10 @@ class StartpageController extends Controller return loadPage($subpage); } - public function loadPlugin(Request $request, $locale = "de") + public function loadPlugin($params, $locale = "de") { - $requests = $request->all(); + $params = unserialize(base64_decode($params)); + $requests = $params; $params = []; foreach($requests as $key => $value) { @@ -94,9 +95,9 @@ class StartpageController extends Controller $params['encoding'] = 'utf8'; if(!isset($params['lang'])) $params['lang'] = 'all'; - $params["eingabe"] = ""; - - + array_forget($params, 'eingabe'); + array_forget($params, 'out'); + array_forget($params, 'page'); $link = action('MetaGerSearch@search', $params); $response = Response::make( diff --git a/app/Http/routes.php b/app/Http/routes.php index 4dd8541736b73701673aaf25c6a3846fde7fc561..3e6a31676bc5ddae7baf2a86dee2a0bc607e029e 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -9,110 +9,112 @@ | It's a breeze. Simply tell Laravel the URIs it should respond to | and give it the controller to call when that URI is requested. | -*/ - - Route::group( - [ - 'prefix' => LaravelLocalization::setLocale()/*, - 'middleware' => [ 'localeSessionRedirect', 'localizationRedirect' ]*/ - ], - function() - { - /** ADD ALL LOCALIZED ROUTES INSIDE THIS GROUP **/ + */ - Route::get('/', 'StartpageController@loadStartPage'); +Route::group( + [ + 'prefix' => LaravelLocalization::setLocale(), /*, + 'middleware' => [ 'localeSessionRedirect', 'localizationRedirect' ]*/ + ], + function () { + /** ADD ALL LOCALIZED ROUTES INSIDE THIS GROUP **/ - Route::get('img/piwik.png', 'ImageController@generateImage'); + Route::get('/', 'StartpageController@loadStartPage'); - Route::get('impressum', function() - { - return view('impressum') - ->with('title', trans('titles.impressum')) - ->with('css', 'impressum.css') - ->with('navbarFocus', 'kontakt'); - }); + Route::get('img/piwik.png', 'ImageController@generateImage'); - Route::get('about', function() - { - return view('about') - ->with('title', trans('titles.about')) - ->with('css', 'about.css') - ->with('navbarFocus', 'kontakt'); - }); - Route::get('team', function() - { - return view('team.team') - ->with('title', trans('titles.team')) - ->with('css', 'team.css') - ->with('navbarFocus', 'kontakt'); - }); - Route::get('team/pubkey-wsb', function() - { - return view('team.pubkey-wsb') - ->with('title', trans('titles.team')) - ->with('navbarFocus', 'kontakt'); - }); + Route::get('impressum', function () { + return view('impressum') + ->with('title', trans('titles.impressum')) + ->with('css', 'impressum.css') + ->with('navbarFocus', 'kontakt'); + }); + Route::get('impressum.html', function () { + return redirect(url('impressum')); + }); - Route::get('kontakt', function() - { - return view('kontakt.kontakt') - ->with('title', trans('titles.kontakt')) - ->with('css', 'kontakt.css') - ->with('js', ['openpgp.min.js','kontakt.js']) - ->with('navbarFocus', 'kontakt'); - }); + Route::get('about', function () { + return view('about') + ->with('title', trans('titles.about')) + ->with('css', 'about.css') + ->with('navbarFocus', 'kontakt'); + }); + Route::get('team', function () { + return view('team.team') + ->with('title', trans('titles.team')) + ->with('css', 'team.css') + ->with('navbarFocus', 'kontakt'); + }); + Route::get('team/pubkey-wsb', function () { + return view('team.pubkey-wsb') + ->with('title', trans('titles.team')) + ->with('navbarFocus', 'kontakt'); + }); - Route::post('kontakt', 'MailController@contactMail'); + Route::get('kontakt', function () { + return view('kontakt.kontakt') + ->with('title', trans('titles.kontakt')) + ->with('css', 'kontakt.css') + ->with('js', ['openpgp.min.js', 'kontakt.js']) + ->with('navbarFocus', 'kontakt'); + }); - Route::get('tor', function() - { - return view('tor') - ->with('title', 'tor hidden service - MetaGer') - ->with('navbarFocus', 'dienste'); - }); - Route::get('spende', function() - { - return view('spende.spende') - ->with('title', trans('titles.spende')) - ->with('css', 'donation.css') - ->with('navbarFocus', 'foerdern'); - }); + Route::post('kontakt', 'MailController@contactMail'); - Route::get('beitritt', function () - { - return view('spende.beitritt') - ->with('title', trans('titles.beitritt')) - ->with('css', 'beitritt.css') - ->with('navbarFocus', 'foerdern'); - }); + Route::get('tor', function () { + return view('tor') + ->with('title', 'tor hidden service - MetaGer') + ->with('navbarFocus', 'dienste'); + }); + Route::get('spende', function () { + return view('spende.spende') + ->with('title', trans('titles.spende')) + ->with('css', 'donation.css') + ->with('navbarFocus', 'foerdern'); + }); + Route::get('spende/danke/{data}', ['as' => 'danke', function ($data) { + return view('spende.danke') + ->with('title', trans('titles.spende')) + ->with('css', ['donation.css', 'danke.css']) + ->with('navbarFocus', 'foerdern') + ->with('data', unserialize(base64_decode($data))); + }]); + Route::get('partnershops', function () { + return view('spende.partnershops') + ->with('title', trans('titles.partnershops')) + ->with('navbarFocus', 'foerdern') + ->with('css', 'partnershops.css'); + }); - Route::get('bform1.htm', function() - { - return redirect('beitritt'); - }); - Route::get('spendenaufruf', function() - { - return view('spende.spendenaufruf') - ->with('title', 'Spendenaufruf - MetaGer') - ->with('navbarFocus', 'foerdern'); - }); + Route::get('beitritt', function () { + return view('spende.beitritt') + ->with('title', trans('titles.beitritt')) + ->with('css', 'beitritt.css') + ->with('navbarFocus', 'foerdern'); + }); - Route::post('spende', 'MailController@donation'); + Route::get('bform1.htm', function () { + return redirect('beitritt'); + }); + Route::get('spendenaufruf', function () { + return view('spende.spendenaufruf') + ->with('title', 'Spendenaufruf - MetaGer') + ->with('navbarFocus', 'foerdern'); + }); + Route::post('spende', 'MailController@donation'); - Route::get('datenschutz', function() - { - return view('datenschutz') - ->with('title', trans('titles.datenschutz')) - ->with('css', 'privacy.css') - ->with('navbarFocus', 'datenschutz'); - }); + Route::get('datenschutz', function () { + return view('datenschutz') + ->with('title', trans('titles.datenschutz')) + ->with('css', 'privacy.css') + ->with('navbarFocus', 'datenschutz'); + }); - Route::get('hilfe', function() - { - return view('hilfe') - ->with('title', trans('titles.hilfe')) - ->with('css', 'help.css') + Route::get('hilfe', function () { + return view('hilfe') + ->with('title', trans('titles.hilfe')) + ->with('css', 'help.css') ->with('navbarFocus', 'hilfe'); }); @@ -122,42 +124,40 @@ ->with('title', trans('titles.faq')) ->with('css', 'help.css') ->with('navbarFocus', 'hilfe'); - }); + }); - Route::get('widget', function() - { + Route::get('widget', function () { return view('widget.widget') - ->with('title', trans('titles.widget')) - ->with('css', 'widget.css') - ->with('navbarFocus', 'dienste'); + ->with('title', trans('titles.widget')) + ->with('css', 'widget.css') + ->with('navbarFocus', 'dienste'); }); Route::get('sitesearch', 'SitesearchController@loadPage'); - Route::get('websearch', function() - { + Route::get('websearch', function () { return view('widget.websearch') ->with('title', trans('titles.websearch')) ->with('css', 'websearch.css') ->with('navbarFocus', 'dienste'); - }); - + }); + Route::get('admin', 'AdminInterface@index'); Route::get('admin/count', 'AdminInterface@count'); Route::get('admin/check', 'AdminInterface@check'); - Route::get('settings', 'StartpageController@loadSettings'); + Route::get('settings', 'StartpageController@loadSettings'); - - Route::get('meta/meta.ger3', 'MetaGerSearch@search'); - Route::get('meta/picture', 'Pictureproxy@get'); - Route::get('clickstats', 'LogController@clicklog'); + Route::get('meta/meta.ger3', 'MetaGerSearch@search'); + Route::get('meta/picture', 'Pictureproxy@get'); + Route::get('clickstats', 'LogController@clicklog'); + Route::get('pluginClose', 'LogController@pluginClose'); + Route::get('pluginInstall', 'LogController@pluginInstall'); - Route::get('qt', 'MetaGerSearch@quicktips'); - Route::get('tips', 'MetaGerSearch@tips'); - Route::get('opensearch.xml', 'StartpageController@loadPlugin'); - Route::get('owi', function() - { - return redirect('https://metager.de/klassik/en/owi/'); - }); - }); + Route::get('qt', 'MetaGerSearch@quicktips'); + Route::get('tips', 'MetaGerSearch@tips'); + Route::get('/plugins/{params}/opensearch.xml', 'StartpageController@loadPlugin'); + Route::get('owi', function () { + return redirect('https://metager.de/klassik/en/owi/'); + }); + }); diff --git a/app/Jobs/Search.php b/app/Jobs/Search.php index 62fc6b289a31bca00015f1d3e6a7397b3f9ef57b..18541f20d7a2c8fde66e4e875772d57cf85f2220 100644 --- a/app/Jobs/Search.php +++ b/app/Jobs/Search.php @@ -3,17 +3,17 @@ namespace App\Jobs; use App\Jobs\Job; -use Illuminate\Queue\SerializesModels; -use Illuminate\Queue\InteractsWithQueue; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Http\Request; +use Illuminate\Queue\InteractsWithQueue; +use Illuminate\Queue\SerializesModels; use Redis; class Search extends Job implements ShouldQueue { use InteractsWithQueue, SerializesModels; - - protected $hash, $host, $port, $name, $getString, $useragent, $fp, $sumaFile; + + protected $hash, $host, $port, $name, $getString, $useragent, $fp; protected $buffer_length = 8192; /** @@ -21,15 +21,14 @@ class Search extends Job implements ShouldQueue * * @return void */ - public function __construct($hash, $host, $port, $name, $getString, $useragent, $sumaFile) + public function __construct($hash, $host, $port, $name, $getString, $useragent) { - $this->hash = $hash; - $this->host = $host; - $this->port = $port; - $this->name = $name; + $this->hash = $hash; + $this->host = $host; + $this->port = $port; + $this->name = $name; $this->getString = $getString; $this->useragent = $useragent; - $this->sumaFile = $sumaFile; } /** @@ -40,79 +39,66 @@ class Search extends Job implements ShouldQueue public function handle(Request $request) { $this->fp = $this->getFreeSocket(); - - if($this->fp) - { - if($this->writeRequest()) - { + + if ($this->fp) { + if ($this->writeRequest()) { $this->readAnswer(); } } } - public function disable($sumaFile, $message) + private function readAnswer() { - $xml = simplexml_load_file($sumaFile); - $xml->xpath("//sumas/suma[@name='" . $this->name . "']")['0']['disabled'] = date(DATE_RFC822, mktime(date("H")+1,date("i"), date("s"), date("m"), date("d"), date("Y"))); - $xml->saveXML($sumaFile); - } - - private function readAnswer () - { - $time = microtime(true); + $time = microtime(true); $headers = ''; - $body = ''; - $length = 0; + $body = ''; + $length = 0; - if(!$this->fp) - { + if (!$this->fp) { return; } // get headers FIRST $c = 0; stream_set_blocking($this->fp, 1); - do - { + do { // use fgets() not fread(), fgets stops reading at first newline // or buffer which ever one is reached first $data = fgets($this->fp, 8192); // a sincle CRLF indicates end of headers - if ($data === false || $data == "\r\n" || feof($this->fp) ) { + if ($data === false || $data == "\r\n" || feof($this->fp)) { // break BEFORE OUTPUT break; } - if( sizeof(($tmp = explode(": ", $data))) === 2 ) + if (sizeof(($tmp = explode(": ", $data))) === 2) { $headers[strtolower(trim($tmp[0]))] = trim($tmp[1]); + } + $c++; - } - while (true); + } while (true); // end of headers - if(sizeof($headers) > 1){ + if (sizeof($headers) > 1) { $bodySize = 0; - if( isset($headers["transfer-encoding"]) && $headers["transfer-encoding"] === "chunked" ) - { + if (isset($headers["transfer-encoding"]) && $headers["transfer-encoding"] === "chunked") { $body = $this->readChunked(); - - }elseif( isset($headers['content-length']) ) - { + + } elseif (isset($headers['content-length'])) { $length = trim($headers['content-length']); - if(is_numeric($length) && $length >= 1) + if (is_numeric($length) && $length >= 1) { $body = $this->readBody($length); + } + $bodySize = strlen($body); - }else - { + } else { exit; } - }else - { + } else { return; } Redis::del($this->host . "." . $this->socketNumber); - if( isset($headers["content-encoding"]) && $headers['content-encoding'] === "gzip") - { + if (isset($headers["content-encoding"]) && $headers['content-encoding'] === "gzip") { $body = $this->gunzip($body); } Redis::hset('search.' . $this->hash, $this->name, $body); @@ -122,12 +108,11 @@ class Search extends Job implements ShouldQueue private function readBody($length) { $theData = ''; - $done = false; + $done = false; stream_set_blocking($this->fp, 0); $startTime = time(); - $lastTime = $startTime; - while (!feof($this->fp) && !$done && (($startTime + 1) > time()) && $length !== 0) - { + $lastTime = $startTime; + while (!feof($this->fp) && !$done && (($startTime + 1) > time()) && $length !== 0) { usleep(100); $theNewData = fgets($this->fp, 8192); $theData .= $theNewData; @@ -143,8 +128,7 @@ class Search extends Job implements ShouldQueue $body = ''; // read from chunked stream // loop though the stream - do - { + do { // NOTE: for chunked encoding to work properly make sure // there is NOTHING (besides newlines) before the first hexlength @@ -170,15 +154,16 @@ class Search extends Job implements ShouldQueue // zero is sent when at the end of the chunks // or the end of the stream or error if ($line === false || $length < 1 || feof($this->fp)) { - if($length <= 0) - fgets($this->fp, 8192); + if ($length <= 0) { + fgets($this->fp, 8192); + } + // break out of the streams loop break; } // loop though the chunk - do - { + do { // read $length amount of data // (use fread here) $data = fread($this->fp, $length); @@ -194,42 +179,42 @@ class Search extends Job implements ShouldQueue $body .= $data; // zero or less or end of connection break - if ($length <= 0 || feof($this->fp)) - { + if ($length <= 0 || feof($this->fp)) { // break out of the chunk loop - if($length <= 0) + if ($length <= 0) { fgets($this->fp, 8192); + } + break; } - } - while (true); + } while (true); // end of chunk loop - } - while (true); + } while (true); // end of stream loop return $body; } - private function gunzip($zipped) { - $offset = 0; - if (substr($zipped,0,2) == "\x1f\x8b") - $offset = 2; - if (substr($zipped,$offset,1) == "\x08") - { - try - { - return gzinflate(substr($zipped, $offset + 8)); - } catch (\Exception $e) - { - abort(500, "Fehler beim unzip des Ergebnisses von folgendem Anbieter: " . $this->name); + private function gunzip($zipped) + { + $offset = 0; + if (substr($zipped, 0, 2) == "\x1f\x8b") { + $offset = 2; } - } - return "Unknown Format"; - } - private function writeRequest () + if (substr($zipped, $offset, 1) == "\x08") { + try + { + return gzinflate(substr($zipped, $offset + 8)); + } catch (\Exception $e) { + abort(500, "Fehler beim unzip des Ergebnisses von folgendem Anbieter: " . $this->name); + } + } + return "Unknown Format"; + } + + private function writeRequest() { - + $out = "GET " . $this->getString . " HTTP/1.1\r\n"; $out .= "Host: " . $this->host . "\r\n"; $out .= "User-Agent: " . $this->useragent . "\r\n"; @@ -238,51 +223,69 @@ class Search extends Job implements ShouldQueue $out .= "Accept-Encoding: gzip, deflate, br\r\n"; $out .= "Connection: keep-alive\r\n\r\n"; # Anfrage senden: - $sent = 0; $string = $out; $time = microtime(true); - while(true) - { - try{ + $sent = 0; + $string = $out; + $time = microtime(true); + while (true) { + $timeElapsed = microtime(true) - $time; + if ($timeElapsed > 0.5) { + # Irgendwas ist mit unserem Socket passiert. Wir brauchen einen neuen: + if ($this->fp) { + fclose($this->fp); + } + + Redis::del($this->name . "." . $this->socketNumber); + $this->fp = $this->getFreeSocket(); + $sent = 0; + $string = $out; + break; + } + try { $tmp = fwrite($this->fp, $string); - }catch(\ErrorException $e) - { + } catch (\ErrorException $e) { # Irgendwas ist mit unserem Socket passiert. Wir brauchen einen neuen: - fclose($this->fp); + try { + fclose($this->fp); + } catch (\ErrorException $e) { + + } + Redis::del($this->name . "." . $this->socketNumber); $this->fp = $this->getFreeSocket(); - $sent = 0; - $string = $out; + $sent = 0; + $string = $out; continue; } - if($tmp){ + if ($tmp) { $sent += $tmp; $string = substr($string, $tmp); } - if($sent >= strlen($out)) + if ($sent >= strlen($out)) { break; + } + } - if( $sent === strlen($out) ) - { + if ($sent === strlen($out)) { return true; } return false; } - private function getFreeSocket() + public function getFreeSocket() { # Je nach Auslastung des Servers ( gleichzeitige Abfragen ), kann es sein, dass wir mehrere Sockets benötigen um die Abfragen ohne Wartezeit beantworten zu können. - # pfsockopen öffnet dabei einen persistenten Socket, der also auch zwischen den verschiedenen php Prozessen geteilt werden kann. + # pfsockopen öffnet dabei einen persistenten Socket, der also auch zwischen den verschiedenen php Prozessen geteilt werden kann. # Wenn der Hostname mit einem bereits erstellten Socket übereinstimmt, wird die Verbindung also aufgegriffen und fortgeführt. # Allerdings dürfen wir diesen nur verwenden, wenn er nicht bereits von einem anderen Prozess zur Kommunikation verwendet wird. # Wenn dem so ist, probieren wir den nächsten Socket zu verwenden. # Dies festzustellen ist komplizierter, als man sich das vorstellt. Folgendes System sollte funktionieren: # 1. Stelle fest, ob dieser Socket neu erstellt wurde, oder ob ein existierender geöffnet wurde. - $counter = 0; $fp = null; - do - { - - if( intval(Redis::exists($this->host . ".$counter")) === 0 ) - { + $counter = 0; + $fp = null; + do { + + if (intval(Redis::exists($this->host . ".$counter")) === 0) { Redis::set($this->host . ".$counter", 1); Redis::expire($this->host . ".$counter", 5); $this->socketNumber = $counter; @@ -290,33 +293,29 @@ class Search extends Job implements ShouldQueue try { $fp = pfsockopen($this->getHost() . ":" . $this->port . "/$counter", $this->port, $errstr, $errno, 1); - }catch(\ErrorException $e) - { + } catch (\ErrorException $e) { break; } # Wir gucken, ob der Lesepuffer leer ist: stream_set_blocking($fp, 0); $string = fgets($fp, 8192); - if( $string !== false || feof($fp) ) - { + if ($string !== false || feof($fp)) { fclose($fp); continue; } break; } $counter++; - }while(true); + } while (true); return $fp; } - private function getHost() + public function getHost() { $return = ""; - if( $this->port === "443" ) - { + if ($this->port === "443") { $return .= "tls://"; - }else - { + } else { $return .= "tcp://"; } $return .= $this->host; diff --git a/app/MetaGer.php b/app/MetaGer.php index 30f421f9c87b4ab59ed545174c90f388aa4fcd4c..f787c4296989cebb3771cb883e56e8197e633a56 100644 --- a/app/MetaGer.php +++ b/app/MetaGer.php @@ -1,105 +1,113 @@ <?php namespace App; +use App; +use App\lib\TextLanguageDetect\TextLanguageDetect; +use Cache; use Illuminate\Http\Request; use Jenssegers\Agent\Agent; -use App; -use Storage; +use LaravelLocalization; use Log; -use Config; +use Predis\Connection\ConnectionException; use Redis; -use App\lib\TextLanguageDetect\TextLanguageDetect; -use App\lib\TextLanguageDetect\LanguageDetect\TextLanguageDetectException; -use Illuminate\Pagination\LengthAwarePaginator; -use Illuminate\Support\Collection; -#use \Illuminate\Pagination\Paginator; class MetaGer { - # Einstellungen für die Suche - protected $fokus; - protected $eingabe; - protected $q; - protected $category; - protected $time; - protected $page; - protected $lang; - protected $cache = ""; - protected $site; - protected $hostBlacklist = []; - protected $domainBlacklist = []; - protected $stopWords = []; - protected $phrases = []; - protected $engines = []; - protected $results = []; - protected $ads = []; - protected $warnings = []; - protected $errors = []; - protected $addedHosts = []; - # Daten über die Abfrage - protected $ip; - protected $language; - protected $agent; - # Konfigurationseinstellungen: - protected $sumaFile; - protected $mobile; - protected $resultCount; - protected $sprueche; + # Einstellungen für die Suche + protected $fokus; + protected $eingabe; + protected $q; + protected $category; + protected $time; + protected $page; + protected $lang; + protected $cache = ""; + protected $site; + protected $hostBlacklist = []; + protected $domainBlacklist = []; + protected $stopWords = []; + protected $phrases = []; + protected $engines = []; + protected $results = []; + protected $ads = []; + protected $warnings = []; + protected $errors = []; + protected $addedHosts = []; + protected $startCount = 0; + protected $canCache = false; + # Daten über die Abfrage + protected $ip; + protected $language; + protected $agent; + # Konfigurationseinstellungen: + protected $sumaFile; + protected $mobile; + protected $resultCount; + protected $sprueche; protected $domainsBlacklisted = []; - protected $urlsBlacklisted = []; + protected $urlsBlacklisted = []; protected $url; protected $languageDetect; - function __construct() - { - $this->starttime = microtime(true); - if( file_exists(config_path() . "/blacklistDomains.txt") && file_exists(config_path() . "/blacklistUrl.txt") ) - { + public function __construct() + { + $this->starttime = microtime(true); + if (file_exists(config_path() . "/blacklistDomains.txt") && file_exists(config_path() . "/blacklistUrl.txt")) { # Blacklists einlesen: - $tmp = file_get_contents(config_path() . "/blacklistDomains.txt"); + $tmp = file_get_contents(config_path() . "/blacklistDomains.txt"); $this->domainsBlacklisted = explode("\n", $tmp); - $tmp = file_get_contents(config_path() . "/blacklistUrl.txt"); - $this->urlsBlacklisted = explode("\n", $tmp); - }else - { + $tmp = file_get_contents(config_path() . "/blacklistUrl.txt"); + $this->urlsBlacklisted = explode("\n", $tmp); + } else { Log::warning("Achtung: Eine, oder mehrere Blacklist Dateien, konnten nicht geöffnet werden"); } + $dir = app_path() . "/Models/parserSkripte/"; + foreach (scandir($dir) as $filename) { + $path = $dir . $filename; + if (is_file($path)) { + require $path; + } + } + $this->languageDetect = new TextLanguageDetect(); $this->languageDetect->setNameMode("2"); - } - public function getHashCode () + try { + Cache::has('test'); + $this->canCache = true; + } catch (ConnectionException $e) { + $this->canCache = false; + } + } + + public function getHashCode() { $string = url()->full(); return md5($string); } - public function rankAll () + public function rankAll() { - foreach( $this->engines as $engine ) - { + foreach ($this->engines as $engine) { $engine->rank($this); } } - public function createView() - { - $viewResults = []; + public function createView() + { + $viewResults = []; # Wir extrahieren alle notwendigen Variablen und geben Sie an unseren View: - foreach($this->results as $result) - { + foreach ($this->results as $result) { $viewResults[] = get_object_vars($result); } # Wir müssen natürlich noch den Log für die durchgeführte Suche schreiben: $this->createLogs(); - if( $this->fokus === "bilder" ) - { - switch ($this->out) - { + if ($this->fokus === "bilder") { + switch ($this->out) { case 'results': return view('metager3bilderresults') ->with('results', $viewResults) @@ -107,7 +115,8 @@ class MetaGer ->with('mobile', $this->mobile) ->with('warnings', $this->warnings) ->with('errors', $this->errors) - ->with('metager', $this); + ->with('metager', $this) + ->with('browser', (new Agent())->browser()); default: return view('metager3bilder') ->with('results', $viewResults) @@ -115,7 +124,8 @@ class MetaGer ->with('mobile', $this->mobile) ->with('warnings', $this->warnings) ->with('errors', $this->errors) - ->with('metager', $this); + ->with('metager', $this) + ->with('browser', (new Agent())->browser()); } } @@ -127,7 +137,8 @@ class MetaGer ->with('mobile', $this->mobile) ->with('warnings', $this->warnings) ->with('errors', $this->errors) - ->with('metager', $this); + ->with('metager', $this) + ->with('browser', (new Agent())->browser()); break; case 'results-with-style': return view('metager3') @@ -137,7 +148,8 @@ class MetaGer ->with('warnings', $this->warnings) ->with('errors', $this->errors) ->with('metager', $this) - ->with('suspendheader', "yes"); + ->with('suspendheader', "yes") + ->with('browser', (new Agent())->browser()); break; default: return view('metager3') @@ -145,10 +157,11 @@ class MetaGer ->with('mobile', $this->mobile) ->with('warnings', $this->warnings) ->with('errors', $this->errors) - ->with('metager', $this); + ->with('metager', $this) + ->with('browser', (new Agent())->browser()); break; } - } + } private function createLogs() { @@ -156,155 +169,174 @@ class MetaGer try { $logEntry = ""; - $logEntry .= "[" . date(DATE_RFC822, mktime(date("H"),date("i"), date("s"), date("m"), date("d"), date("Y"))) . "]"; - $logEntry .= " From=" . $this->ip; + $logEntry .= "[" . date(DATE_RFC822, mktime(date("H"), date("i"), date("s"), date("m"), date("d"), date("Y"))) . "]"; $logEntry .= " pid=" . getmypid(); - $anonId= md5("MySeCrEtSeEdFoRmd5" - .$this->request->header('Accept') - .$this->request->header('Accept-Charset') - .$this->request->header('Accept-Encoding') - .$this->request->header('HTTP_LANGUAGE') - .$this->request->header('User-Agent') - .$this->request->header('Keep-Alive') - .$this->request->header('X-Forwarded-For') - .date("H")); # Wichtig!! Den Parameter um die aktuelle Stunde erweitern. Ansonsten wäre die anonId dauerhaft einem Nutzer zuzuordnen. - $logEntry .= " anonId=$anonId"; $logEntry .= " ref=" . $this->request->header('Referer'); $useragent = $this->request->header('User-Agent'); $useragent = str_replace("(", " ", $useragent); $useragent = str_replace(")", " ", $useragent); $useragent = str_replace(" ", "", $useragent); - $logEntry .= " ua=" . $useragent; - $logEntry .= " iter= mm= time=" . round((microtime(true)-$this->starttime), 2) . " serv=" . $this->fokus . " which= hits= stringSearch= QuickTips= SSS= check="; + $logEntry .= " time=" . round((microtime(true) - $this->starttime), 2) . " serv=" . $this->fokus; $logEntry .= " search=" . $this->eingabe; $redis->rpush('logs.search', $logEntry); - }catch( \Exception $e) - { + } catch (\Exception $e) { return; } } - public function removeInvalids () + public function removeInvalids() { $results = []; - foreach($this->results as $result) - { - if($result->isValid($this)) + foreach ($this->results as $result) { + if ($result->isValid($this)) { $results[] = $result; + } + } #$this->results = $results; } - public function combineResults () - { - foreach($this->engines as $engine) - { - foreach($engine->results as $result) - { - if($result->valid) + public function combineResults() + { + foreach ($this->engines as $engine) { + if (isset($engine->next)) { + $this->next[] = $engine->next; + } + if (isset($engine->last)) { + $this->last[] = $engine->last; + } + foreach ($engine->results as $result) { + if ($result->valid) { $this->results[] = $result; + } } - foreach($engine->ads as $ad) - { + foreach ($engine->ads as $ad) { $this->ads[] = $ad; } - } - uasort($this->results, function($a, $b){ - if($a->getRank() == $b->getRank()) + } + + uasort($this->results, function ($a, $b) { + if ($a->getRank() == $b->getRank()) { return 0; + } + return ($a->getRank() < $b->getRank()) ? 1 : -1; }); # Validate Results $newResults = []; - foreach($this->results as $result) - { - if($result->isValid($this)) + foreach ($this->results as $result) { + if ($result->isValid($this)) { $newResults[] = $result; + } + } $this->results = $newResults; - $counter = 0; + # Boost implementation + $this->results = $this->parseBoost($this->results); + + #Adgoal Implementation + $this->results = $this->parseAdgoal($this->results); + + $counter = 0; $firstRank = 0; - foreach($this->results as $result) - { - if($counter === 0) + + if (isset($this->startForwards)) { + $this->startCount = $this->startForwards; + } elseif (isset($this->startBackwards)) { + $this->startCount = $this->startBackwards - count($this->results) - 1; + } else { + $this->startCount = 0; + } + + foreach ($this->results as $result) { + if ($counter === 0) { $firstRank = $result->rank; + } + $counter++; - $result->number = $counter; - $confidence = 0; - if($firstRank > 0) - $confidence = $result->rank/$firstRank; - else + $result->number = $counter + $this->startCount; + $confidence = 0; + if ($firstRank > 0) { + $confidence = $result->rank / $firstRank; + } else { $confidence = 0; - if($confidence > 0.65) + } + + if ($confidence > 0.65) { $result->color = "#FF4000"; - elseif($confidence > 0.4) + } elseif ($confidence > 0.4) { $result->color = "#FF0080"; - elseif($confidence > 0.2) + } elseif ($confidence > 0.2) { $result->color = "#C000C0"; - else + } else { $result->color = "#000000"; - } - - //Get current page form url e.g. &page=6 - $currentPage = LengthAwarePaginator::resolveCurrentPage(); - $offset= $currentPage-1; - - //Create a new Laravel collection from the array data - $collection = new Collection($this->results); - - //Define how many items we want to be visible in each page - $perPage = $this->resultCount; - - //Slice the collection to get the items to display in current page - $currentPageSearchResults = $collection->slice($offset * $perPage, $perPage)->all(); - - # Für diese 20 Links folgt nun unsere Adgoal Implementation. - $currentPageSearchResults = $this->parseAdgoal($currentPageSearchResults); + } - //Create our paginator and pass it to the view - $paginatedSearchResults= new LengthAwarePaginator($currentPageSearchResults, count($collection), $perPage); - $paginatedSearchResults->setPath('/meta/meta.ger3'); - foreach($this->request->all() as $key => $value) - { - if( $key === "out" ) - continue; - $paginatedSearchResults->addQuery($key, $value); } - $this->results = $paginatedSearchResults; + if (LaravelLocalization::getCurrentLocale() === "en") { + $this->ads = []; + } $this->validated = false; - if( isset($this->password) ) - { + if (isset($this->password)) { # Wir bieten einen bezahlten API-Zugriff an, bei dem dementsprechend die Werbung ausgeblendet wurde: # Aktuell ist es nur die Uni-Mainz. Deshalb überprüfen wir auch nur diese. $password = getenv('mainz'); - $eingabe = $this->eingabe; + $eingabe = $this->eingabe; $password = md5($eingabe . $password); - if( $this->password === $password ) - { - $this->ads = []; + if ($this->password === $password) { + $this->ads = []; $this->validated = true; } } - } + if (count($this->results) <= 0) { + $this->errors[] = "Leider konnten wir zu Ihrer Sucheingabe keine passenden Ergebnisse finden."; + } + + if ($this->canCache() && isset($this->next) && count($this->next) > 0 && count($this->results) > 0) { + $page = $this->page + 1; + $this->next = [ + 'page' => $page, + 'startForwards' => $this->results[count($this->results) - 1]->number, + 'engines' => $this->next, + ]; + Cache::put(md5(serialize($this->next)), serialize($this->next), 60); + } else { + $this->next = []; + } + + } + + public function parseBoost($results) + { + foreach ($results as $result) { + if (preg_match('/^(http[s]?\:\/\/)?(www.)?amazon\.de/', $result->anzeigeLink)) { + if (preg_match('/\?/', $result->anzeigeLink)) { + $result->link .= '&tag=boostmg01-21'; + } else { + $result->link .= '?tag=boostmg01-21'; + } + $result->partnershop = true; + + } + } + return $results; + } public function parseAdgoal($results) { - $publicKey = getenv('adgoal_public'); + $publicKey = getenv('adgoal_public'); $privateKey = getenv('adgoal_private'); - if( $publicKey === FALSE ) - { + if ($publicKey === false) { return $results; } $tldList = ""; - try{ - foreach($results as $result) - { + try { + foreach ($results as $result) { $link = $result->anzeigeLink; - if(strpos($link, "http") !== 0) - { + if (strpos($link, "http") !== 0) { $link = "http://" . $link; } $tldList .= parse_url($link, PHP_URL_HOST) . ","; @@ -315,102 +347,103 @@ class MetaGer # Hashwert $hash = md5("meta" . $publicKey . $tldList . "GER"); - # Query + # Query $query = urlencode($this->q); - $link = "https://api.smartredirect.de/api_v2/CheckForAffiliateUniversalsearchMetager.php?p=" . $publicKey . "&k=" . $hash . "&tld=" . $tldList . "&q=" . $query; + $link = "https://api.smartredirect.de/api_v2/CheckForAffiliateUniversalsearchMetager.php?p=" . $publicKey . "&k=" . $hash . "&tld=" . $tldList . "&q=" . $query; $answer = json_decode(file_get_contents($link)); - # Nun müssen wir nur noch die Links für die Advertiser ändern: - foreach($answer as $el) - { + foreach ($answer as $el) { $hoster = $el[0]; - $hash = $el[1]; + $hash = $el[1]; - foreach($results as $result) - { - if( $hoster === $result->tld ) - { + foreach ($results as $result) { + if ($hoster === $result->tld) { # Hier ist ein Advertiser: # Das Logo hinzufügen: - $result->image = "https://img.smartredirect.de/logos_v2/120x60/" . $hash . ".gif"; + if ($result->image !== "") { + $result->logo = "https://img.smartredirect.de/logos_v2/60x30/" . $hash . ".gif"; + } else { + $result->image = "https://img.smartredirect.de/logos_v2/120x60/" . $hash . ".gif"; + } + # Den Link hinzufügen: $publicKey = $publicKey; $targetUrl = $result->anzeigeLink; - if(strpos($targetUrl, "http") !== 0) + if (strpos($targetUrl, "http") !== 0) { $targetUrl = "http://" . $targetUrl; - $hash = md5($targetUrl . $privateKey); - $newLink = "https://api.smartredirect.de/api_v2/ClickGate.php?p=" . $publicKey . "&k=" . $hash . "&url=" . urlencode($targetUrl) . "&q=" . $query; - $result->link = $newLink; + } + + $gateHash = md5($targetUrl . $privateKey); + $newLink = "https://api.smartredirect.de/api_v2/ClickGate.php?p=" . $publicKey . "&k=" . $gateHash . "&url=" . urlencode($targetUrl) . "&q=" . $query; + $result->link = $newLink; $result->partnershop = true; } } } - }catch(\ErrorException $e) - { + } catch (\ErrorException $e) { return $results; } return $results; } - public function createSearchEngines (Request $request) - { + public function createSearchEngines(Request $request) + { - if( !$request->has("eingabe") ) + if (!$request->has("eingabe")) { return; + } - # Ãœberprüfe, welche Sumas eingeschaltet sind - $xml = simplexml_load_file($this->sumaFile); + # Ãœberprüfe, welche Sumas eingeschaltet sind + $xml = simplexml_load_file($this->sumaFile); $enabledSearchengines = []; - $overtureEnabled = FALSE; - $countSumas = 0; - $sumas = $xml->xpath("suma"); - if($this->fokus === "angepasst") - { - foreach($sumas as $suma) - { - if($request->has($suma["name"]) - || ( $this->fokus !== "bilder" - && ($suma["name"]->__toString() === "qualigo" - || $suma["name"]->__toString() === "similar_product_ads" - || ( !$overtureEnabled && $suma["name"]->__toString() === "overtureAds" ) - ) - ) - ){ - - if(!(isset($suma['disabled']) && $suma['disabled']->__toString() === "1")) - { - if($suma["name"]->__toString() === "overture" || $suma["name"]->__toString() === "overtureAds") - { - $overtureEnabled = TRUE; + $overtureEnabled = false; + $countSumas = 0; + $sumas = $xml->xpath("suma"); + if ($this->fokus === "angepasst") { + foreach ($sumas as $suma) { + if ($request->has($suma["name"]) + || ($this->fokus !== "bilder" + && ($suma["name"]->__toString() === "qualigo" + || $suma["name"]->__toString() === "similar_product_ads" + || (!$overtureEnabled && $suma["name"]->__toString() === "overtureAds") + ) + ) + ) { + + if (!(isset($suma['disabled']) && $suma['disabled']->__toString() === "1")) { + if ($suma["name"]->__toString() === "overture" || $suma["name"]->__toString() === "overtureAds") { + $overtureEnabled = true; } - if( $suma["name"]->__toString() !== "qualigo" && $suma["name"]->__toString() !== "similar_product_ads" && $suma["name"]->__toString() !== "overtureAds" ) + if ($suma["name"]->__toString() !== "qualigo" && $suma["name"]->__toString() !== "similar_product_ads" && $suma["name"]->__toString() !== "overtureAds") { $countSumas += 1; + } + $enabledSearchengines[] = $suma; } } } - }else{ - foreach($sumas as $suma){ - $types = explode(",",$suma["type"]); - if(in_array($this->fokus, $types) - || ( $this->fokus !== "bilder" - && ($suma["name"]->__toString() === "qualigo" - || $suma["name"]->__toString() === "similar_product_ads" - || ( !$overtureEnabled && $suma["name"]->__toString() === "overtureAds" ) - ) - ) - ){ - if(!(isset($suma['disabled']) && $suma['disabled']->__toString() === "1")) - { - if($suma["name"]->__toString() === "overture" || $suma["name"]->__toString() === "overtureAds") - { - $overtureEnabled = TRUE; + } else { + foreach ($sumas as $suma) { + $types = explode(",", $suma["type"]); + if (in_array($this->fokus, $types) + || ($this->fokus !== "bilder" + && ($suma["name"]->__toString() === "qualigo" + || $suma["name"]->__toString() === "similar_product_ads" + || (!$overtureEnabled && $suma["name"]->__toString() === "overtureAds") + ) + ) + ) { + if (!(isset($suma['disabled']) && $suma['disabled']->__toString() === "1")) { + if ($suma["name"]->__toString() === "overture" || $suma["name"]->__toString() === "overtureAds") { + $overtureEnabled = true; } - if( $suma["name"]->__toString() !== "qualigo" && $suma["name"]->__toString() !== "similar_product_ads" && $suma["name"]->__toString() !== "overtureAds" ) + if ($suma["name"]->__toString() !== "qualigo" && $suma["name"]->__toString() !== "similar_product_ads" && $suma["name"]->__toString() !== "overtureAds") { $countSumas += 1; + } + $enabledSearchengines[] = $suma; } } @@ -419,142 +452,118 @@ class MetaGer # Sonderregelung für alle Suchmaschinen, die zu den Minisuchern gehören. Diese können alle gemeinsam über einen Link abgefragt werden $subcollections = []; - $tmp = []; - foreach($enabledSearchengines as $engine ) - { - if( isset($engine['minismCollection']) ) + $tmp = []; + foreach ($enabledSearchengines as $engine) { + if (isset($engine['minismCollection'])) { $subcollections[] = $engine['minismCollection']->__toString(); - else + } else { $tmp[] = $engine; + } + } $enabledSearchengines = $tmp; - if( sizeof($subcollections) > 0) - { - $count = sizeof($subcollections) * 10; - $minisucherEngine = $xml->xpath('suma[@name="minism"]')[0]; - $subcollections = urlencode("(" . implode(" OR ", $subcollections) . ")"); + if (sizeof($subcollections) > 0) { + $count = sizeof($subcollections) * 10; + $minisucherEngine = $xml->xpath('suma[@name="minism"]')[0]; + $subcollections = urlencode("(" . implode(" OR ", $subcollections) . ")"); $minisucherEngine["formData"] = str_replace("<<SUBCOLLECTIONS>>", $subcollections, $minisucherEngine["formData"]); $minisucherEngine["formData"] = str_replace("<<COUNT>>", $count, $minisucherEngine["formData"]); - $enabledSearchengines[] = $minisucherEngine; + $enabledSearchengines[] = $minisucherEngine; } #die(var_dump($enabledSearchengines)); - if( $countSumas <= 0 ) - { + if ($countSumas <= 0) { $this->errors[] = "Achtung: Sie haben in ihren Einstellungen keine Suchmaschine ausgewählt."; } - $engines = []; + $engines = []; $siteSearchFailed = false; - if( strlen($this->site) > 0 ) - { + if (strlen($this->site) > 0) { # Wenn eine Sitesearch durchgeführt werden soll, überprüfen wir ob eine der Suchmaschinen überhaupt eine Sitesearch unterstützt: $enginesWithSite = 0; - foreach($enabledSearchengines as $engine) - { - if( isset($engine['hasSiteSearch']) && $engine['hasSiteSearch']->__toString() === "1" ) - { + foreach ($enabledSearchengines as $engine) { + if (isset($engine['hasSiteSearch']) && $engine['hasSiteSearch']->__toString() === "1") { $enginesWithSite++; } } - if( $enginesWithSite === 0 ) - { - $this->errors[] = "Sie wollten eine Sitesearch auf " . $this->site . " durchführen. Leider unterstützen die eingestellten Suchmaschinen diese nicht. Sie können <a href=\"" . $this->generateSearchLink("web", false) . "\">hier</a> die Sitesearch im Web-Fokus durchführen. Es werden ihnen Ergebnisse ohne Sitesearch angezeigt."; + if ($enginesWithSite === 0) { + $this->errors[] = "Sie wollten eine Sitesearch auf " . $this->site . " durchführen. Leider unterstützen die eingestellten Suchmaschinen diese nicht. Sie können <a href=\"" . $this->generateSearchLink("web", false) . "\">hier</a> die Sitesearch im Web-Fokus durchführen. Es werden ihnen Ergebnisse ohne Sitesearch angezeigt."; $siteSearchFailed = true; - }else - { + } else { $this->warnings[] = "Sie führen eine Sitesearch durch. Es werden nur Ergebnisse von der Seite: <a href=\"http://" . $this->site . "\" target=\"_blank\">\"" . $this->site . "\"</a> angezeigt."; } } $typeslist = []; - $counter = 0; - - foreach($enabledSearchengines as $engine){ + $counter = 0; + + if ($request->has('next') && Cache::has($request->input('next')) && unserialize(Cache::get($request->input('next')))['page'] > 1) { + $next = unserialize(Cache::get($request->input('next'))); + $this->page = $next['page']; + $engines = $next['engines']; + if (isset($next['startForwards'])) { + $this->startForwards = $next['startForwards']; + } - if( !$siteSearchFailed && strlen($this->site) > 0 && ( !isset($engine['hasSiteSearch']) || $engine['hasSiteSearch']->__toString() === "0") ) - { - - continue; + if (isset($next['startBackwards'])) { + $this->startBackwards = $next['startBackwards']; } - # Wenn diese Suchmaschine gar nicht eingeschaltet sein soll - $path = "App\Models\parserSkripte\\" . ucfirst($engine["package"]->__toString()); - $time = microtime(); - $tmp = new $path($engine, $this); + } else { + foreach ($enabledSearchengines as $engine) { - if($tmp->enabled && isset($this->debug)) - { - $this->warnings[] = $tmp->service . " Connection_Time: " . $tmp->connection_time . " Write_Time: " . $tmp->write_time . " Insgesamt:" . ((microtime()-$time)/1000); - } + if (!$siteSearchFailed && strlen($this->site) > 0 && (!isset($engine['hasSiteSearch']) || $engine['hasSiteSearch']->__toString() === "0")) { - if($tmp->isEnabled()) - { - $engines[] = $tmp; - $this->sockets[$tmp->name] = $tmp->fp; - } + continue; + } + # Wenn diese Suchmaschine gar nicht eingeschaltet sein soll + $path = "App\Models\parserSkripte\\" . ucfirst($engine["package"]->__toString()); - # Alternativ - # Hier wird direkt eine Liste der Fokustypen erstellt, die bei der Suche verwendet werden: [0] => [web, nachrichten] - /*if($engine["name"] !== "overtureAds") { - $type = explode(",", $engine["type"]); - if(!$type[0] == "") { - $typeslist[$counter++] = $type; + if (!file_exists(app_path() . "/Models/parserSkripte/" . ucfirst($engine["package"]->__toString()) . ".php")) { + Log::error("Konnte " . $engine["name"] . " nicht abfragen, da kein Parser existiert"); + continue; } - }*/ - } + $time = microtime(); - # Alternativ - # Jetzt wird geguckt, ob diese Liste überhaupt Typen enthält und für jeden Typen des ersten Eintrags (oder späteren falls dieser "" ist) wird geguckt, ob sich dieser Typ in allen folgenden Einträgen finden lässt. Diese Einträge sind nie "web", da diese Suche meist eh auch möglich ist und ohnehin wie die angepasste Suche funktioniert. Am Ende wird geguckt ob es einen Typen gab, der in allen Elementen enthalten ist. Dieser wird als Fokus gesetzt. - /*if(!empty($typeslist)) { - foreach($typeslist as $matchTypeSearch) { - if(!empty($matchTypeSearch) && $matchTypeSearch[0] !== "") { - $toMatch = $matchTypeSearch; - break; + try + { + $tmp = new $path($engine, $this); + } catch (\ErrorException $e) { + Log::error("Konnte " . $engine["name"] . " nicht abfragen." . var_dump($e)); + continue; } - } - $toMatch = $typeslist[0]; - array_shift($typeslist); - $matchedType = ""; - foreach($toMatch as $matchType) { - if($matchType !== "web" && $matchType !== "") { - $matched = true; - foreach($typeslist as $otherTypes) { - if(!in_array($matchType, $otherTypes)) { - $matched = false; - } - } - if($matched) { - $matchedType = $matchType; - break; - } + + if ($tmp->enabled && isset($this->debug)) { + $this->warnings[] = $tmp->service . " Connection_Time: " . $tmp->connection_time . " Write_Time: " . $tmp->write_time . " Insgesamt:" . ((microtime() - $time) / 1000); } + + if ($tmp->isEnabled()) { + $engines[] = $tmp; + } + } - if($matchedType !== "") { - $this->fokus = $matchedType; - } - }*/ + } + + # Wir starten die Suche manuell: + foreach ($engines as $engine) { + $engine->startSearch($this); + } # Jetzt werden noch alle Kategorien der Settings durchgegangen und die jeweils enthaltenen namen der Suchmaschinen gespeichert. $foki = []; - foreach($sumas as $suma) - { - if( (!isset($suma['disabled']) || $suma['disabled'] === "") && ( !isset($suma['userSelectable']) || $suma['userSelectable']->__toString() === "1") ) - { - if( isset($suma['type']) ) - { + foreach ($sumas as $suma) { + if ((!isset($suma['disabled']) || $suma['disabled'] === "") && (!isset($suma['userSelectable']) || $suma['userSelectable']->__toString() === "1")) { + if (isset($suma['type'])) { $f = explode(",", $suma['type']->__toString()); - foreach($f as $tmp) - { - $name = $suma['name']->__toString(); + foreach ($f as $tmp) { + $name = $suma['name']->__toString(); $foki[$tmp][$suma['name']->__toString()] = $name; } - }else - { - $name = $suma['name']->__toString(); + } else { + $name = $suma['name']->__toString(); $foki["andere"][$suma['name']->__toString()] = $name; } } @@ -562,30 +571,30 @@ class MetaGer # Es werden auch die Namen der aktuell aktiven Suchmaschinen abgespeichert. $realEngNames = []; - foreach($enabledSearchengines as $realEng) { + foreach ($enabledSearchengines as $realEng) { $nam = $realEng["name"]->__toString(); - if($nam !== "qualigo" && $nam !== "overtureAds") { + if ($nam !== "qualigo" && $nam !== "overtureAds") { $realEngNames[] = $nam; } } # Anschließend werden diese beiden Listen verglichen (jeweils eine der Fokuslisten für jeden Fokus), um herauszufinden ob sie vielleicht identisch sind. Ist dies der Fall, so hat der Nutzer anscheinend Suchmaschinen eines kompletten Fokus eingestellt. Der Fokus wird dementsprechend angepasst. - foreach($foki as $fok => $engs) { - $isFokus = true; + foreach ($foki as $fok => $engs) { + $isFokus = true; $fokiEngNames = []; - foreach($engs as $eng) { + foreach ($engs as $eng) { $fokiEngNames[] = $eng; } - foreach($fokiEngNames as $fen) { - if(!in_array($fen, $realEngNames)) { + foreach ($fokiEngNames as $fen) { + if (!in_array($fen, $realEngNames)) { $isFokus = false; } } - foreach($realEngNames as $ren) { - if(!in_array($ren, $fokiEngNames)) { + foreach ($realEngNames as $ren) { + if (!in_array($ren, $fokiEngNames)) { $isFokus = false; } } - if($isFokus) { + if ($isFokus) { $this->fokus = $fok; } } @@ -595,97 +604,100 @@ class MetaGer # aber natürlich nicht ewig. # Die Verbindung steht zu diesem Zeitpunkt und auch unsere Request wurde schon gesendet. # Wir geben der Suchmaschine nun bis zu 500ms Zeit zu antworten. - $enginesToLoad = count($engines); - $loadedEngines = 0; - $timeStart = microtime(true); - while( true ) - { - $time = (microtime(true) - $timeStart) * 1000; - $loadedEngines = intval(Redis::hlen('search.' . $this->getHashCode())); - $canBreak = true; - if( $overtureEnabled && !Redis::hexists('search.' . $this->getHashCode(), 'overture') && !Redis::hexists('search.' . $this->getHashCode(), 'overtureAds')) - $canBreak = false; + # Wir zählen die Suchmaschinen, die durch den Cache beantwortet wurden: + $enginesToLoad = 0; + $canBreak = false; + foreach ($engines as $engine) { + if ($engine->cached) { + $enginesToLoad--; + if ($overtureEnabled && ($engine->name === "overture" || $engine->name === "overtureAds")) { + $canBreak = true; + } + } + } + $enginesToLoad += count($engines); + $loadedEngines = 0; + $timeStart = microtime(true); + while (true) { + $time = (microtime(true) - $timeStart) * 1000; + $loadedEngines = intval(Redis::hlen('search.' . $this->getHashCode())); + if ($overtureEnabled && (Redis::hexists('search.' . $this->getHashCode(), 'overture') || Redis::hexists('search.' . $this->getHashCode(), 'overtureAds'))) { + $canBreak = true; + } # Abbruchbedingung - if($time < 500) - { - if(($enginesToLoad === 0 || $loadedEngines >= $enginesToLoad) && $canBreak) + if ($time < 500) { + if (($enginesToLoad === 0 || $loadedEngines >= $enginesToLoad) && $canBreak) { break; - }elseif( $time >= 500 && $time < $this->time) - { - if( ($enginesToLoad === 0 || ($loadedEngines / ($enginesToLoad * 1.0)) >= 0.8) && $canBreak ) + } + + } elseif ($time >= 500 && $time < $this->time) { + if (($enginesToLoad === 0 || ($loadedEngines / ($enginesToLoad * 1.0)) >= 0.8) && $canBreak) { break; - }else - { + } + + } else { break; } usleep(50000); } - - foreach($engines as $engine) - { - if(!$engine->loaded) - { - try{ - $engine->retrieveResults(); - } catch(\ErrorException $e) - { + foreach ($engines as $engine) { + if (!$engine->loaded) { + try { + $engine->retrieveResults($this); + } catch (\ErrorException $e) { Log::error($e); - + } } } - + # und verwerfen den Rest: - foreach( $engines as $engine ) - { - if( !$engine->loaded ) + foreach ($engines as $engine) { + if (!$engine->loaded) { $engine->shutdown(); + } + } $this->engines = $engines; - } - - public function parseFormData (Request $request) - { - if($request->input('encoding', '') !== "utf8") - { - # In früheren Versionen, als es den Encoding Parameter noch nicht gab, wurden die Daten in ISO-8859-1 übertragen - $input = $request->all(); - foreach($input as $key => $value) - { - $input[$key] = mb_convert_encoding("$value", "UTF-8", "ISO-8859-1"); - } - $request->replace($input); - } + } + + public function parseFormData(Request $request) + { + if ($request->input('encoding', '') !== "utf8") { + # In früheren Versionen, als es den Encoding Parameter noch nicht gab, wurden die Daten in ISO-8859-1 übertragen + $input = $request->all(); + foreach ($input as $key => $value) { + $input[$key] = mb_convert_encoding("$value", "UTF-8", "ISO-8859-1"); + } + $request->replace($input); + } $this->url = $request->url(); - # Zunächst überprüfen wir die eingegebenen Einstellungen: + # Zunächst überprüfen wir die eingegebenen Einstellungen: # FOKUS $this->fokus = trans('fokiNames.' - . $request->input('focus', 'web')); - if(strpos($this->fokus,".")) - { + . $request->input('focus', 'web')); + if (strpos($this->fokus, ".")) { $this->fokus = trans('fokiNames.web'); } # SUMA-FILE - if(App::isLocale("en")){ + if (App::isLocale("en")) { $this->sumaFile = config_path() . "/sumas.xml"; - }else{ + } else { $this->sumaFile = config_path() . "/sumas.xml"; } - if(!file_exists($this->sumaFile)) - { + if (!file_exists($this->sumaFile)) { die("Suma-File konnte nicht gefunden werden"); } # Sucheingabe: $this->eingabe = trim($request->input('eingabe', '')); - if(strlen($this->eingabe) === 0) - { + if (strlen($this->eingabe) === 0) { $this->warnings[] = 'Achtung: Sie haben keinen Suchbegriff eingegeben. Sie können ihre Suchbegriffe oben eingeben und es erneut versuchen.'; } $this->q = $this->eingabe; @@ -694,305 +706,301 @@ class MetaGer $this->ip = $request->ip(); # Language: - if( isset($_SERVER['HTTP_LANGUAGE']) ) - { + if (isset($_SERVER['HTTP_LANGUAGE'])) { $this->language = $_SERVER['HTTP_LANGUAGE']; - }else - { + } else { $this->language = ""; } # Category $this->category = $request->input('category', ''); # Request Times: $this->time = $request->input('time', 1000); - + # Page - $this->page = $request->input('page', 1); + $this->page = 1; # Lang $this->lang = $request->input('lang', 'all'); - if ( $this->lang !== "de" && $this->lang !== "en" && $this->lang !== "all" ) - { - $this->lang = "all"; + if ($this->lang !== "de" && $this->lang !== "en" && $this->lang !== "all") { + $this->lang = "all"; } - $this->agent = new Agent(); + $this->agent = new Agent(); $this->mobile = $this->agent->isMobile(); #Sprüche $this->sprueche = $request->input('sprueche', 'off'); - if($this->sprueche === "off" ) + if ($this->sprueche === "off") { $this->sprueche = true; - else + } else { $this->sprueche = false; + } + # Ergebnisse pro Seite: $this->resultCount = $request->input('resultCount', '20'); # Manchmal müssen wir Parameter anpassen um den Sucheinstellungen gerecht zu werden: - if( $request->has('dart') ) - { - $this->time = 10000; - $this->warnings[] = "Hinweis: Sie haben Dart-Europe aktiviert. Die Suche kann deshalb länger dauern und die maximale Suchzeit wurde auf 10 Sekunden hochgesetzt."; + if ($request->has('dart')) { + $this->time = 10000; + $this->warnings[] = "Hinweis: Sie haben Dart-Europe aktiviert. Die Suche kann deshalb länger dauern und die maximale Suchzeit wurde auf 10 Sekunden hochgesetzt."; } - if( $this->time <= 500 || $this->time > 20000 ) - { - $this->time = 1000; + if ($this->time <= 500 || $this->time > 20000) { + $this->time = 1000; } - if( $request->has('minism') && ( $request->has('fportal') || $request->has('harvest') ) ) - { - $input = $request->all(); - $newInput = []; - foreach($input as $key => $value) - { - if( $key !== "fportal" && $key !== "harvest" ) - { - $newInput[$key] = $value; - } - } - $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 ($request->has('minism') && ($request->has('fportal') || $request->has('harvest'))) { + $input = $request->all(); + $newInput = []; + foreach ($input as $key => $value) { + if ($key !== "fportal" && $key !== "harvest") { + $newInput[$key] = $value; + } + } + $request->replace($newInput); } - if( App::isLocale("en") ) - { - $this->sprueche = "off"; + if (App::isLocale("en")) { + $this->sprueche = "off"; } - if($this->resultCount <= 0 || $this->resultCount > 200 ) - { - $this->resultCount = 1000; + if ($this->resultCount <= 0 || $this->resultCount > 200) { + $this->resultCount = 1000; } - if( $request->has('onenewspageAll') || $request->has('onenewspageGermanyAll') ) - { - $this->time = 5000; - $this->cache = "cache"; + if ($request->has('onenewspageAll') || $request->has('onenewspageGermanyAll')) { + $this->time = 5000; + $this->cache = "cache"; } - if( $request->has('tab')) - { - if($request->input('tab') === "off") - { + if ($request->has('tab')) { + if ($request->input('tab') === "off") { $this->tab = "_blank"; - }else - { + } else { $this->tab = "_self"; } - }else - { + } else { $this->tab = "_blank"; } - if( $request->has('password') ) + if ($request->has('password')) { $this->password = $request->input('password'); - if( $request->has('quicktips') ) + } + + if ($request->has('quicktips')) { $this->quicktips = false; - else + } else { $this->quicktips = true; + } $this->out = $request->input('out', "html"); - if($this->out !== "html" && $this->out !== "json" && $this->out !== "results" && $this->out !== "results-with-style") + if ($this->out !== "html" && $this->out !== "json" && $this->out !== "results" && $this->out !== "results-with-style") { $this->out = "html"; + } + $this->request = $request; - } - - public function checkSpecialSearches (Request $request) - { - # Site Search: - if(preg_match("/(.*)\bsite:(\S+)(.*)/si", $this->q, $match)) - { - $this->site = $match[2]; - $this->q = $match[1] . $match[3]; - } - if( $request->has('site') ) - { + } + + public function checkSpecialSearches(Request $request) + { + # Site Search: + if (preg_match("/(.*)\bsite:(\S+)(.*)/si", $this->q, $match)) { + $this->site = $match[2]; + $this->q = $match[1] . $match[3]; + } + if ($request->has('site')) { $this->site = $request->input('site'); } - # Wenn die Suchanfrage um das Schlüsselwort "-host:*" ergänzt ist, sollen bestimmte Hosts nicht eingeblendet werden - # Wir prüfen, ob das hier der Fall ist: - while(preg_match("/(.*)(^|\s)-host:(\S+)(.*)/si", $this->q, $match)) - { - $this->hostBlacklist[] = $match[3]; - $this->q = $match[1] . $match[4]; - } - if( sizeof($this->hostBlacklist) > 0 ) - { - $hostString = ""; - foreach($this->hostBlacklist as $host) - { - $hostString .= $host . ", "; - } - $hostString = rtrim($hostString, ", "); - $this->warnings[] = "Ergebnisse von folgenden Hosts werden nicht angezeigt: \"" . $hostString . "\""; - } - # Wenn die Suchanfrage um das Schlüsselwort "-domain:*" ergänzt ist, sollen bestimmte Domains nicht eingeblendet werden - # Wir prüfen, ob das hier der Fall ist: - while(preg_match("/(.*)(^|\s)-domain:(\S+)(.*)/si", $this->q, $match)) - { - $this->domainBlacklist[] = $match[3]; - $this->q = $match[1] . $match[4]; - } - if( sizeof($this->domainBlacklist) > 0 ) - { - $domainString = ""; - foreach($this->domainBlacklist as $domain) - { - $domainString .= $domain . ", "; - } - $domainString = rtrim($domainString, ", "); - $this->warnings[] = "Ergebnisse von folgenden Domains werden nicht angezeigt: \"" . $domainString . "\""; - } - - # Alle mit "-" gepräfixten Worte sollen aus der Suche ausgeschlossen werden. - # Wir prüfen, ob das hier der Fall ist: - while(preg_match("/(.*)(^|\s)-(\S+)(.*)/si", $this->q, $match)) - { - $this->stopWords[] = $match[3]; - $this->q = $match[1] . $match[4]; - } - if( sizeof($this->stopWords) > 0 ) - { - $stopwordsString = ""; - foreach($this->stopWords as $stopword) - { - $stopwordsString .= $stopword . ", "; - } - $stopwordsString = rtrim($stopwordsString, ", "); - $this->warnings[] = "Sie machen eine Ausschlusssuche. Ergebnisse mit folgenden Wörtern werden nicht angezeigt: \"" . $stopwordsString . "\""; - } - - # Meldung über eine Phrasensuche - $p = ""; + # Wenn die Suchanfrage um das Schlüsselwort "-host:*" ergänzt ist, sollen bestimmte Hosts nicht eingeblendet werden + # Wir prüfen, ob das hier der Fall ist: + while (preg_match("/(.*)(^|\s)-host:(\S+)(.*)/si", $this->q, $match)) { + $this->hostBlacklist[] = $match[3]; + $this->q = $match[1] . $match[4]; + } + if (sizeof($this->hostBlacklist) > 0) { + $hostString = ""; + foreach ($this->hostBlacklist as $host) { + $hostString .= $host . ", "; + } + $hostString = rtrim($hostString, ", "); + $this->warnings[] = "Ergebnisse von folgenden Hosts werden nicht angezeigt: \"" . $hostString . "\""; + } + # Wenn die Suchanfrage um das Schlüsselwort "-domain:*" ergänzt ist, sollen bestimmte Domains nicht eingeblendet werden + # Wir prüfen, ob das hier der Fall ist: + while (preg_match("/(.*)(^|\s)-domain:(\S+)(.*)/si", $this->q, $match)) { + $this->domainBlacklist[] = $match[3]; + $this->q = $match[1] . $match[4]; + } + if (sizeof($this->domainBlacklist) > 0) { + $domainString = ""; + foreach ($this->domainBlacklist as $domain) { + $domainString .= $domain . ", "; + } + $domainString = rtrim($domainString, ", "); + $this->warnings[] = "Ergebnisse von folgenden Domains werden nicht angezeigt: \"" . $domainString . "\""; + } + + # Alle mit "-" gepräfixten Worte sollen aus der Suche ausgeschlossen werden. + # Wir prüfen, ob das hier der Fall ist: + while (preg_match("/(.*)(^|\s)-(\S+)(.*)/si", $this->q, $match)) { + $this->stopWords[] = $match[3]; + $this->q = $match[1] . $match[4]; + } + if (sizeof($this->stopWords) > 0) { + $stopwordsString = ""; + foreach ($this->stopWords as $stopword) { + $stopwordsString .= $stopword . ", "; + } + $stopwordsString = rtrim($stopwordsString, ", "); + $this->warnings[] = "Sie machen eine Ausschlusssuche. Ergebnisse mit folgenden Wörtern werden nicht angezeigt: \"" . $stopwordsString . "\""; + } + + # Meldung über eine Phrasensuche + $p = ""; $tmp = $this->q; - while(preg_match("/(.*)\"(.+)\"(.*)/si", $tmp, $match)){ - $tmp = $match[1] . $match[3]; + while (preg_match("/(.*)\"(.+)\"(.*)/si", $tmp, $match)) { + $tmp = $match[1] . $match[3]; $this->phrases[] = strtolower($match[2]); - } - foreach($this->phrases as $phrase) - { + } + foreach ($this->phrases as $phrase) { $p .= "\"$phrase\", "; } $p = rtrim($p, ", "); - if(sizeof($this->phrases) > 0) + if (sizeof($this->phrases) > 0) { $this->warnings[] = "Sie führen eine Phrasensuche durch: $p"; - } + } + + } - public function getFokus () + public function getFokus() { return $this->fokus; } - public function getIp () + public function getIp() { return $this->ip; } - public function getEingabe () + public function getEingabe() { return $this->eingabe; } - public function getQ () + public function getQ() { - return $this->q; + return $this->q; } - public function getUrl () + public function getUrl() { return $this->url; } - public function getTime () + public function getTime() { return $this->time; } - public function getLanguage () + public function getLanguage() { return $this->language; } - public function getLang () + public function getLang() { return $this->lang; } - public function getSprueche () + public function getSprueche() { return $this->sprueche; } - public function getCategory () + public function getCategory() { return $this->category; } - public function getPhrases () + public function getPhrases() { return $this->phrases; } + public function getPage() + { + return $this->page; + } - public function getSumaFile () + public function getSumaFile() { return $this->sumaFile; } - public function getUserHostBlacklist () + public function getUserHostBlacklist() { return $this->hostBlacklist; } - public function getUserDomainBlacklist () + public function getUserDomainBlacklist() { return $this->domainBlacklist; } - public function getDomainBlacklist () + public function getDomainBlacklist() { return $this->domainsBlacklisted; } - public function getUrlBlacklist () + public function getUrlBlacklist() { return $this->urlsBlacklisted; } - public function getLanguageDetect () + public function getLanguageDetect() { return $this->languageDetect; } - public function getStopWords () + public function getStopWords() { return $this->stopWords; } public function getHostCount($host) { - if(isset($this->addedHosts[$host])) - { + if (isset($this->addedHosts[$host])) { return $this->addedHosts[$host]; - }else - { + } else { return 0; } } + public function getStartCount() + { + return $this->startCount; + } public function addHostCount($host) { $hash = md5($host); - if(isset($this->addedHosts[$hash])) - { + if (isset($this->addedHosts[$hash])) { $this->addedHosts[$hash] += 1; - }else - { + } else { $this->addedHosts[$hash] = 1; } } + public function canCache() + { + return $this->canCache; + } public function getSite() { return $this->site; } public function addLink($link) { + if (strpos($link, "http://") === 0) { + $link = substr($link, 7); + } + + if (strpos($link, "https://") === 0) { + $link = substr($link, 8); + } + + if (strpos($link, "www.") === 0) { + $link = substr($link, 4); + } + + $link = trim($link, "/"); $hash = md5($link); - if(isset($this->addedLinks[$hash])) - { + if (isset($this->addedLinks[$hash])) { return false; - }else - { + } else { $this->addedLinks[$hash] = 1; return true; @@ -1001,12 +1009,14 @@ class MetaGer public function generateSearchLink($fokus, $results = true) { - $requestData = $this->request->except('page'); + $requestData = $this->request->except(['page', 'next']); $requestData['focus'] = $fokus; - if($results) + if ($results) { $requestData['out'] = "results"; - else + } else { $requestData['out'] = ""; + } + $link = action('MetaGerSearch@search', $requestData); return $link; } @@ -1020,56 +1030,70 @@ class MetaGer public function generateSiteSearchLink($host) { - $host = urlencode($host); - $requestData = $this->request->except(['page','out']); + $host = urlencode($host); + $requestData = $this->request->except(['page', 'out', 'next']); $requestData['eingabe'] .= " site:$host"; $requestData['focus'] = "web"; - $link = action('MetaGerSearch@search', $requestData); + $link = action('MetaGerSearch@search', $requestData); return $link; } - public function generateRemovedHostLink ($host) + public function generateRemovedHostLink($host) { - $host = urlencode($host); - $requestData = $this->request->except(['page','out']); + $host = urlencode($host); + $requestData = $this->request->except(['page', 'out', 'next']); $requestData['eingabe'] .= " -host:$host"; $link = action('MetaGerSearch@search', $requestData); return $link; } - public function generateRemovedDomainLink ($domain) + public function generateRemovedDomainLink($domain) { - $domain = urlencode($domain); - $requestData = $this->request->except(['page','out']); + $domain = urlencode($domain); + $requestData = $this->request->except(['page', 'out', 'next']); $requestData['eingabe'] .= " -domain:$domain"; $link = action('MetaGerSearch@search', $requestData); return $link; } - public function getTab () + public function nextSearchLink() + { + if (isset($this->next) && isset($this->next['engines']) && count($this->next['engines']) > 0) { + $requestData = $this->request->except(['page', 'out']); + $requestData['next'] = md5(serialize($this->next)); + $link = action('MetaGerSearch@search', $requestData); + } else { + $link = "#"; + } + return $link; + } + + public function getTab() { return $this->tab; } - public function getResults () + public function getResults() { return $this->results; } public function popAd() { - if(count($this->ads) > 0) + if (count($this->ads) > 0) { return get_object_vars(array_shift($this->ads)); - else + } else { return null; + } + } public function getImageProxyLink($link) { - $requestData = []; + $requestData = []; $requestData["url"] = $link; - $link = action('Pictureproxy@get', $requestData); + $link = action('Pictureproxy@get', $requestData); return $link; } - public function showQuicktips () + public function showQuicktips() { return $this->quicktips; } -} \ No newline at end of file +} diff --git a/app/Models/Result.php b/app/Models/Result.php index c85f14419fccdbd809d5e55cf06ef0a6f80cd1f7..70f5759752688009a9b8bc5229fe304867866b4f 100644 --- a/app/Models/Result.php +++ b/app/Models/Result.php @@ -2,256 +2,310 @@ namespace App\Models; - - +/* Die Klasse Result sammelt alle Informationen über ein einzelnes Suchergebnis. + * Die Results werden von den Suchmaschinenspezifischen Parser-Skripten erstellt. + */ class Result { - - function __construct ( \SimpleXMLElement $provider, $titel, $link, $anzeigeLink , $descr, $gefVon, $sourceRank, $partnershop = false, $image = "" ) - { - $this->titel = strip_tags(trim($titel)); - $this->link = trim($link); - $this->anzeigeLink = trim($anzeigeLink); - $this->descr = strip_tags(trim($descr)); - $this->descr = preg_replace("/\n+/si", " ", $this->descr); - if( strlen($this->descr) > 250 ) - { - $this->descr = wordwrap($this->descr, 250); - $this->descr = substr($this->descr, 0, strpos($this->descr, "\n")); - - } - $this->gefVon = trim($gefVon); - $this->proxyLink = $this->generateProxyLink($this->link); - $this->sourceRank = $sourceRank; - if($this->sourceRank <= 0 || $this->sourceRank > 20) - $this->sourceRank = 20; - $this->sourceRank = 20 - $this->sourceRank; - if(isset($provider["engineBoost"])) - { - $this->engineBoost = floatval($provider["engineBoost"]->__toString()); - }else - { - $this->engineBoost = 1; - } - - $this->valid = true; - $this->host = @parse_url($link, PHP_URL_HOST); - $this->strippedHost = $this->getStrippedHost($this->anzeigeLink); - $this->strippedDomain = $this->getStrippedDomain($this->strippedHost); - $this->strippedLink = $this->getStrippedLink($this->anzeigeLink); - $this->rank = 0; - $this->partnershop = $partnershop; - $this->image = $image; - - #die($this->anzeigeLink . "\r\n" . $this->strippedHost); - } - - public function rank (\App\MetaGer $metager) - { - - $rank = 0; - $rank += ($this->sourceRank * 0.02); - - #URL-Boost - $link = $this->anzeigeLink; - if(strpos($link, "http") !== 0) - { - $link = "http://" . $link; - } - $link = @parse_url($link, PHP_URL_HOST) . @parse_url($link, PHP_URL_PATH); - $tmpLi = $link; - $tmpEingabe = $metager->getQ(); - $count = 0; - $tmpLink = ""; - - $regex = [ - "/\s+/si", - "/http:/si", - "/https:/si", - "/www\./si", - "/\//si", - "/\./si", - "/-/si" - ]; - foreach($regex as $reg) - { - $link = preg_replace($regex, "", $link); - $tmpEingabe = preg_replace($regex, "", $tmpEingabe); - } - #die($tmpLi . "<br>" . $link . "<br>" . $tmpEingabe . "<br><br>"); - foreach(str_split($tmpEingabe) as $char) - { - if( !$char || !$tmpEingabe || strlen($tmpEingabe) === 0 || strlen($char) === 0 ) - continue; - if(strpos(strtolower($tmpLink), strtolower($char)) >= 0) - { - $count++; - $tmpLink = str_replace(urlencode($char), "", $tmpLink); - } - if(strlen($this->descr) > 80 && strlen($link) > 0) - { - $rank += $count /((strlen($link)) * 60); - } - } - - # Boost für Vorkommen der Suchwörter: - $maxRank = 0.1; - $tmpTitle = $this->titel; - $tmpDescription = $this->descr; - $isWithin = false; - $tmpRank = 0; - $tmpEingabe = $metager->getQ(); - $tmpEingabe = preg_replace("/\b\w{1,3}\b/si", "", $tmpEingabe); - $tmpEingabe = preg_replace("/\s+/si", " ", $tmpEingabe); - #die($tmpEingabe); - foreach(explode(" ", trim($tmpEingabe)) as $el) - { - if( strlen($tmpTitle) === 0 || strlen($el) === 0 || strlen($tmpDescription) === 0 ) - continue; - $el = preg_quote($el, "/"); - if(strlen($tmpTitle) > 0) - { - if(preg_match("/\b$el\b/si", $tmpTitle)) - { - $tmpRank += .7 * .6 * $maxRank; - }elseif (strpos($tmpTitle, $el) !== false) { - $tmpRank += .3 * .6 * $maxRank; - } - } - if( strlen($tmpDescription) > 0 ) - { - if(preg_match("/\b$el\b/si", $tmpDescription)) - { - $tmpRank += .7 * .4 * $maxRank; - }elseif (strpos($tmpDescription, $el) !== false) { - $tmpRank += .3 * .4 * $maxRank; - } - } - } - $tmpRank /= sizeof(explode(" ", trim($tmpEingabe))) * 10; - $rank += $tmpRank; - - if($this->engineBoost > 0) - { - $rank *= floatval($this->engineBoost); - } - - $this->rank = $rank; - } - - public function getRank () - { - return $this->rank; - } - - public function isValid (\App\MetaGer $metager) - { - # Zunächst die persönlich ( über URL-Parameter ) definierten Blacklists: - if(in_array($this->strippedHost, $metager->getUserHostBlacklist()) - || in_array($this->strippedDomain, $metager->getUserDomainBlacklist())) - return false; - - # Jetzt unsere URL und Domain Blacklist - if($this->strippedHost !== "" && (in_array($this->strippedHost, $metager->getDomainBlacklist()) || in_array($this->strippedLink, $metager->getUrlBlacklist()))) - { - return false; - } - - # Nun der Eventuelle Sprachfilter - if( $metager->getLang() !== "all" ) - { - $text = $this->titel . " " . $this->descr; - $path = app_path() . "/Models/lang.pl"; - $lang = exec("echo '$text' | $path"); - - if( $metager->getLang() !== $lang ) - return false; - } - - - - # Wir wenden die Stoppwortsuche an und schmeißen entsprechende Ergebnisse raus: - foreach($metager->getStopWords() as $stopWord) - { - $text = $this->titel . " " . $this->descr; - if(stripos($text, $stopWord) !== false) - { - return false; - } - } - - # Die Strinsuche: - $text = strtolower($this->titel) . " " . strtolower($this->descr); - foreach($metager->getPhrases() as $phrase) - { - if(strpos($text, $phrase) === FALSE) - return false; - } - - # Abschließend noch 2 Ãœberprüfungen. Einmal den Host filter, der Sicherstellt, dass von jedem Host maximal 3 Links angezeigt werden - # und dann noch den Dublettefilter, der sicher stellt, dass wir nach Möglichkeit keinen Link doppelt in der Ergebnisliste haben - # Diese Ãœberprüfung führen wir unter bestimmten Bedingungen nicht durch: - if($metager->getSite() === "" && - strpos($this->strippedHost, "ncbi.nlm.nih.gov") === false && - strpos($this->strippedHost, "twitter.com") === false && - strpos($this->strippedHost, "www.ladenpreis.net") === false && - strpos($this->strippedHost, "ncbi.nlm.nih.gov") === false && - strpos($this->strippedHost, "www.onenewspage.com") === false) - { - $count = $metager->getHostCount($this->strippedHost); - if($count >= 3) - { - return false; - } - } - - # Unabhängig davon unser Dublettenfilter: - if($metager->addLink($this->strippedLink)) - { - $metager->addHostCount($this->strippedHost); - return true; - }else - { - return false; - } - } - - private function getStrippedHost ($link) - { - if(strpos($link, "http") !== 0) - $link = "http://" . $link; - $link = @parse_url($link, PHP_URL_HOST); - $link = preg_replace("/^www\./si", "", $link); - return $link; - } - private function getStrippedLink ($link) - { - if(strpos($link, "http") !== 0) - $link = "http://" . $link; - $host = $this->strippedHost; - $path = @parse_url($link , PHP_URL_PATH); - return $host . $path; - } - - private function getStrippedDomain ($link) - { - if(preg_match("/([^\.]*\.[^\.]*)$/si", $link, $match)) - { - return $match[1]; - }else - { - return $link; - } - } - - private function generateProxyLink ($link) - { - if(!$link) - return ""; - $tmp = $link; - $tmp = preg_replace("/\r?\n$/s", "", $tmp); - $tmp = preg_replace("#^([\w+.-]+)://#s", "$1/", $tmp); - return "https://proxy.suma-ev.de/cgi-bin/nph-proxy.cgi/en/I0/" . $tmp; - - } + public $provider; # Die Engine von der das Suchergebnis kommt + public $titel; # Der Groß Angezeigte Name für das Suchergebnis + public $link; # Der Link auf die Ergebnisseite + public $anzeigeLink; # Der tatsächlich angezeigte Link (rein optisch) + public $descr; # Die Beschreibung des Suchergebnisses + public $gefVon; # Das bei Suchergebnissen angezeigte von ... mitsamt Verlinkung + public $sourceRank; # Das Ranking für dieses Suchergebnis von der Seite, die es geliefert hat (implizit durch Ergebnisreihenfolge: 20 - Position in Ergebnisliste) + public $partnershop; # Ist das Ergebnis von einem Partnershop? (bool) + public $image; # Ein Vorschaubild für das Suchergebnis (als URL) + + public $proxyLink; # Der Link für die Seite über unseren Proxy-Service + public $engineBoost = 1; # Der Boost für den Provider des Suchergebnisses + public $valid = true; # Ob das Ergebnis noch gültig ist (bool) + public $host; # Der aus dem Link gelesene Host des Suchergebnisses + public $strippedHost; # Der Host in Form "foo.bar.de" + public $strippedDomain; # Die Domain in Form "bar.de" + public $strippedLink; # Der Link in Form "foo.bar.de/test" + public $rank; # Das Ranking für das Ergebnis + + # Erstellt ein neues Ergebnis + public function __construct($provider, $titel, $link, $anzeigeLink, $descr, $gefVon, $sourceRank, $partnershop = false, $image = "", $price = 0) + { + $provider = simplexml_load_string($provider); + $this->titel = strip_tags(trim($titel)); + $this->link = trim($link); + $this->anzeigeLink = trim($anzeigeLink); + $this->descr = strip_tags(trim($descr), '<p>'); + $this->descr = preg_replace("/\n+/si", " ", $this->descr); + if (strlen($this->descr) > 250) { + $this->descr = wordwrap($this->descr, 250); + $this->descr = substr($this->descr, 0, strpos($this->descr, "\n")); + + } + $this->gefVon = trim($gefVon); + $this->proxyLink = $this->generateProxyLink($this->link); + $this->sourceRank = $sourceRank; + if ($this->sourceRank <= 0 || $this->sourceRank > 20) { + $this->sourceRank = 20; + } + $this->sourceRank = 20 - $this->sourceRank; + if (isset($provider["engineBoost"])) { + $this->engineBoost = floatval($provider["engineBoost"]->__toString()); + } else { + $this->engineBoost = 1; + } + $this->valid = true; + $this->host = @parse_url($link, PHP_URL_HOST); + $this->strippedHost = $this->getStrippedHost($this->anzeigeLink); + $this->strippedDomain = $this->getStrippedDomain($this->strippedHost); + $this->strippedLink = $this->getStrippedLink($this->anzeigeLink); + $this->rank = 0; + $this->partnershop = $partnershop; + $this->image = $image; + } + + /* Ranked das Ergebnis nach folgenden Aspekten: + * Startwert 0 + * + 0.02 * Sourcerank (20 - Position in Ergebnisliste des Suchanbieters) + * * Engine-Boost + */ + public function rank(\App\MetaGer $metager) + { + $rank = 0; + + $eingabe = $metager->getQ(); + + # Boost für Source Ranking + $rank += ($this->sourceRank * 0.02); + + # Boost für passende ??? URL + $rank += $this->calcURLBoost($eingabe); + + # Boost für Vorkommen der Suchwörter: + $rank += $this->calcSuchwortBoost($eingabe); + + # Boost für Suchmaschine + if ($this->engineBoost > 0) { + $rank *= floatval($this->engineBoost); + } + + $this->rank = $rank; + } + + # Berechnet den Ranking-Boost durch ??? URL + public function calcURLBoost($tmpEingabe) + { + $link = $this->anzeigeLink; + if (strpos($link, "http") !== 0) { + $link = "http://" . $link; + } + $link = @parse_url($link, PHP_URL_HOST) . @parse_url($link, PHP_URL_PATH); + $tmpLi = $link; + $count = 0; + $tmpLink = ""; + # Löscht verschiedene unerwünschte Teile aus $link und $tmpEingabe + $regex = [ + "/\s+/si", # Leerzeichen + "/http:/si", # "http:" + "/https:/si", # "https:" + "/www\./si", # "www." + "/\//si", # "/" + "/\./si", # "." + "/-/si", # "-" + ]; + foreach ($regex as $reg) { + $link = preg_replace($regex, "", $link); + $tmpEingabe = preg_replace($regex, "", $tmpEingabe); + } + foreach (str_split($tmpEingabe) as $char) { + if (!$char + || !$tmpEingabe + || strlen($tmpEingabe) === 0 + || strlen($char) === 0 + ) { + continue; + } + if (strpos(strtolower($tmpLink), strtolower($char)) >= 0) { + $count++; + $tmpLink = str_replace(urlencode($char), "", $tmpLink); + } + } + if (strlen($this->descr) > 80 && strlen($link) > 0) { + return $count / ((strlen($link)) * 60); # ??? + } else { + return 0; + } + } + + # Berechnet den Ranking-Boost durch das Vorkommen von Suchwörtern + private function calcSuchwortBoost($tmpEingabe) + { + $maxRank = 0.1; + $tmpTitle = $this->titel; + $tmpDescription = $this->descr; + $isWithin = false; + $tmpRank = 0; + $tmpEingabe = preg_replace("/\b\w{1,3}\b/si", "", $tmpEingabe); + $tmpEingabe = preg_replace("/\s+/si", " ", $tmpEingabe); + + foreach (explode(" ", trim($tmpEingabe)) as $el) { + if (strlen($tmpTitle) === 0 || strlen($el) === 0 || strlen($tmpDescription) === 0) { + continue; + } + + $el = preg_quote($el, "/"); + if (strlen($tmpTitle) > 0) { + if (preg_match("/\b$el\b/si", $tmpTitle)) { + $tmpRank += .7 * .6 * $maxRank; + } elseif (strpos($tmpTitle, $el) !== false) { + $tmpRank += .3 * .6 * $maxRank; + } + } + if (strlen($tmpDescription) > 0) { + if (preg_match("/\b$el\b/si", $tmpDescription)) { + $tmpRank += .7 * .4 * $maxRank; + } elseif (strpos($tmpDescription, $el) !== false) { + $tmpRank += .3 * .4 * $maxRank; + } + } + } + + $tmpRank /= sizeof(explode(" ", trim($tmpEingabe))) * 10; + return $tmpRank; + } + + # Ãœberprüft ob das Ergebnis aus irgendwelchen Gründen unerwünscht ist. + public function isValid(\App\MetaGer $metager) + { + # Perönliche URL und Domain Blacklist + if (in_array($this->strippedHost, $metager->getUserHostBlacklist()) + || in_array($this->strippedDomain, $metager->getUserDomainBlacklist())) { + return false; + } + + # Allgemeine URL und Domain Blacklist + if ($this->strippedHost !== "" && (in_array($this->strippedHost, $metager->getDomainBlacklist()) || in_array($this->strippedLink, $metager->getUrlBlacklist()))) { + return false; + } + + # Eventueller Sprachfilter + if ($metager->getLang() !== "all") { + $text = $this->titel . " " . $this->descr; + $path = app_path() . "/Models/lang.pl"; + $lang = exec("echo '$text' | $path"); + + if ($metager->getLang() !== $lang) { + return false; + } + + } + + # Stopworte + foreach ($metager->getStopWords() as $stopWord) { + $text = $this->titel . " " . $this->descr; + if (stripos($text, $stopWord) !== false) { + return false; + } + } + + # Phrasensuche: + $text = strtolower($this->titel) . " " . strtolower($this->descr); + foreach ($metager->getPhrases() as $phrase) { + if (strpos($text, $phrase) === false) { + return false; + } + + } + + /* Der Host-Filter der sicherstellt, + * dass von jedem Host maximal 3 Links angezeigt werden. + * Diese Ãœberprüfung führen wir unter bestimmten Bedingungen nicht durch. + */ + if ($metager->getSite() === "" && + strpos($this->strippedHost, "ncbi.nlm.nih.gov") === false && + strpos($this->strippedHost, "twitter.com") === false && + strpos($this->strippedHost, "www.ladenpreis.net") === false && + strpos($this->strippedHost, "ncbi.nlm.nih.gov") === false && + strpos($this->strippedHost, "www.onenewspage.com") === false) { + $count = $metager->getHostCount($this->strippedHost); + if ($count >= 3) { + return false; + } + } + + /* Der Dublettefilter, der sicher stellt, + * dass wir nach Möglichkeit keinen Link doppelt in der Ergebnisliste haben. + */ + if ($metager->addLink($this->strippedLink)) { + $metager->addHostCount($this->strippedHost); + return true; + } else { + return false; + } + } + + /* Liest aus einem Link den Host. + * Dieser wird dabei in die Form: + * "http://www.foo.bar.de/test?ja=1" -> "foo.bar.de" + * gebracht. + */ + private function getStrippedHost($link) + { + if (strpos($link, "http") !== 0) { + $link = "http://" . $link; + } + + $link = @parse_url($link, PHP_URL_HOST); + $link = preg_replace("/^www\./si", "", $link); + return $link; + } + + /* Entfernt "http://", "www" und Parameter von einem Link + * Dieser wird dabei in die Form: + * "http://www.foo.bar.de/test?ja=1" -> "foo.bar.de/test" + * gebracht. + */ + private function getStrippedLink($link) + { + if (strpos($link, "http") !== 0) { + $link = "http://" . $link; + } + + $host = $this->strippedHost; + $path = @parse_url($link, PHP_URL_PATH); + return $host . $path; + } + + /* Liest aus einem Link die Domain. + * Dieser wird dabei in die Form: + * "http://www.foo.bar.de/test?ja=1" -> "bar.de" + * gebracht. + */ + private function getStrippedDomain($link) + { + if (preg_match("/([^\.]*\.[^\.]*)$/si", $link, $match)) { + return $match[1]; + } else { + return $link; + } + } + + # Erstellt aus einem Link einen Proxy-Link für unseren Proxy-Service + private function generateProxyLink($link) + { + if (!$link) { + return ""; + } + + $tmp = $link; + $tmp = preg_replace("/\r?\n$/s", "", $tmp); + $tmp = preg_replace("#^([\w+.-]+)://#s", "$1/", $tmp); + return "https://proxy.suma-ev.de/cgi-bin/nph-proxy.cgi/en/I0/" . $tmp; + + } + + # Getter + + public function getRank() + { + return $this->rank; + } } diff --git a/app/Models/Searchengine.php b/app/Models/Searchengine.php index 8f0deb05772110d47676444ef3c8667f13a53bd3..518528fc7399d00bdaff6d4111035eaf20fbd307 100644 --- a/app/Models/Searchengine.php +++ b/app/Models/Searchengine.php @@ -1,264 +1,310 @@ <?php namespace App\Models; + +use App\Jobs\Search; use App\MetaGer; +use Cache; +use Illuminate\Foundation\Bus\DispatchesJobs; use Log; use Redis; -use App\Jobs\Search; -use Illuminate\Foundation\Bus\DispatchesJobs; - -abstract class Searchengine +abstract class Searchengine { - use DispatchesJobs; - - protected $ch; # Curl Handle zum erhalten der Ergebnisse - public $fp; - protected $getString = ""; - protected $engine; - protected $counter = 0; - protected $socketNumber = null; - public $enabled = true; - public $results = []; - public $ads = []; - public $write_time = 0; - public $connection_time = 0; - public $loaded = false; - - function __construct(\SimpleXMLElement $engine, MetaGer $metager) - { - foreach($engine->attributes() as $key => $value){ - $this->$key = $value->__toString(); - } - if( !isset($this->homepage) ) - $this->homepage = "https://metager.de"; - $this->engine = $engine; - - # Wir registrieren die Benutzung dieser Suchmaschine - $this->uses = intval(Redis::hget($this->name, "uses")) + 1; - Redis::hset($this->name, "uses", $this->uses); - - # Eine Suchmaschine kann automatisch temporär deaktiviert werden, wenn es Verbindungsprobleme gab: - if(isset($this->disabled) && strtotime($this->disabled) <= time() ) - { - # In diesem Fall ist der Timeout der Suchmaschine abgelaufen. - $this->enable($metager->getSumaFile(), "Die Suchmaschine " . $this->name . " wurde wieder eingeschaltet."); - }elseif (isset($this->disabled) && strtotime($this->disabled) > time()) - { - $this->enabled = false; - return; + use DispatchesJobs; + + protected $ch; # Curl Handle zum erhalten der Ergebnisse + protected $getString = ""; # Der String für die Get-Anfrage + protected $engine; # Die ursprüngliche Engine XML + public $enabled = true; # true, wenn die Suchmaschine nicht explizit disabled ist + public $results = []; # Die geladenen Ergebnisse + public $ads = []; # Die geladenen Werbungen + public $loaded = false; # wahr, sobald die Ergebnisse geladen wurden + public $cached = false; + + public $ip; # Die IP aus der metager + public $gefVon; # Der HTML-Code für die Verlinkung des Suchanbieters + public $uses; # Die Anzahl der Nutzungen dieser Suchmaschine + public $homepage; # Die Homepage dieser Suchmaschine + public $name; # Der Name dieser Suchmaschine + public $disabled; # Ob diese Suchmaschine ausgeschaltet ist + public $useragent; # Der HTTP Useragent + public $startTime; # Die Zeit der Erstellung dieser Suchmaschine + public $hash; # Der Hash-Wert dieser Suchmaschine + + public $fp; # Wird für Artefakte benötigt + protected $socketNumber = null; # Wird für Artefakte benötigt + protected $counter = 0; # Wird eventuell für Artefakte benötigt + public $write_time = 0; # Wird eventuell für Artefakte benötigt + public $connection_time = 0; # Wird eventuell für Artefakte benötigt + + public function __construct(\SimpleXMLElement $engine, MetaGer $metager) + { + # Versucht möglichst viele attribute aus dem engine XML zu laden + foreach ($engine->attributes() as $key => $value) { + $this->$key = $value->__toString(); + } + + # Standardhomepage metager.de + if (!isset($this->homepage)) { + $this->homepage = "https://metager.de"; + } + + # Speichert die XML der Engine + $this->engine = $engine->asXML(); + + # Cache Standarddauer 60 + if (!isset($this->cacheDuration)) { + $this->cacheDuration = 60; } - # User-Agent definieren: - if( isset($_SERVER['HTTP_USER_AGENT'])) - { - $this->useragent = $_SERVER['HTTP_USER_AGENT']; - }else - { - $this->useragent = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.1"; - } - $this->ip = $metager->getIp(); - $this->gefVon = "<a href=\"" . $this->homepage . "\" target=\"_blank\">" . $this->displayName . "</a>"; - $this->startTime = microtime(); - - $q = ""; - if( isset($this->hasSiteSearch) && $this->hasSiteSearch === "1") - { - if(strlen($metager->getSite()) === 0) - $q = $metager->getQ(); - else - $q = $metager->getQ() . " site:" . $metager->getSite(); - }else - { - $q = $metager->getQ(); - } - $this->getString = $this->generateGetString($q, $metager->getUrl(), $metager->getLanguage(), $metager->getCategory()); - $this->hash = $metager->getHashCode(); - - # Die Anfragen an die Suchmaschinen werden nun von der Laravel-Queue bearbeitet: - # Hinweis: solange in der .env der QUEUE_DRIVER auf "sync" gestellt ist, werden die Abfragen - # nacheinander abgeschickt. - # Sollen diese Parallel verarbeitet werden, muss ein anderer QUEUE_DRIVER verwendet werden. - # siehe auch: https://laravel.com/docs/5.2/queues - $this->dispatch(new Search($this->hash, $this->host, $this->port, $this->name, $this->getString, $this->useragent, $metager->getSumaFile())); - } - - public abstract function loadResults($result); - - - - public function rank (\App\MetaGer $metager) - { - foreach($this->results as $result) - { - $result->rank($metager); - } - } - - - - private function setStatistic($key, $val) - { - - $oldVal = floatval(Redis::hget($this->name, $key)) * $this->uses; - $newVal = ($oldVal + max($val, 0)) / $this->uses; - Redis::hset($this->name, $key, $newVal); - $this->$key = $newVal; - } - - - - public function enable($sumaFile, $message) - { - Log::info($message); - $xml = simplexml_load_file($sumaFile); - unset($xml->xpath("//sumas/suma[@name='" . $this->name . "']")['0']['disabled']); - $xml->saveXML($sumaFile); - } - - public function closeFp() - { - fclose($this->fp); - } - - public function getSocket() - { - $number = Redis::hget('search.' . $this->hash, $this->name); - if( $number === null ) - { - die("test"); - return null; - }else - { - return pfsockopen($this->getHost() . ":" . $this->port . "/$number", $this->port, $errstr, $errno, 1); - } - } - - public function retrieveResults() - { - if( Redis::hexists('search.' . $this->hash, $this->name)) - { - $body = Redis::hget('search.' . $this->hash, $this->name); - $this->loadResults($body); - $this->loaded = true; - Redis::hdel('search.' . $this->hash, $this->name); - return true; - } - return false; - - } - - public function shutdown() - { - Redis::del($this->host . "." . $this->socketNumber); - } - - protected function getHost() - { - $return = ""; - if( $this->port === "443" ) - { - $return .= "tls://"; - }else - { - $return .= "tcp://"; - } - $return .= $this->host; - return $return; - } - - public function getCurlInfo() - { - return curl_getinfo($this->ch); - } - - public function getCurlErrors() - { - return curl_errno($this->ch); - } - - public function addCurlHandle ($mh) - { - curl_multi_add_handle($mh, $this->ch); - } - - public function removeCurlHandle ($mh) - { - curl_multi_remove_handle($mh, $this->ch); - } - - private function generateGetString($query, $url, $language, $category) - { - $getString = ""; - - # Skript: - if(strlen($this->skript) > 0) - $getString .= $this->skript; - else - $getString .= "/"; - # FormData: - if(strlen($this->formData) > 0) - $getString .= "?" . $this->formData; - - # Wir müssen noch einige Platzhalter in dem GET-String ersetzen: - if( strpos($getString, "<<USERAGENT>>") ){ - $getString = str_replace("<<USERAGENT>>", $this->urlEncode($this->useragent), $getString); - } - - if( strpos($getString, "<<QUERY>>") ) - { - $getString = str_replace("<<QUERY>>", $this->urlEncode($query), $getString); - } - - if( strpos($getString, "<<IP>>") ) - { - $getString = str_replace("<<IP>>", $this->urlEncode($this->ip), $getString); - } - - if( strpos($getString, "<<LANGUAGE>>") ) - { - $getString = str_replace("<<LANGUAGE>>", $this->urlEncode($language), $getString); - } - - if( strpos($getString, "<<CATEGORY>>") ) - { - $getString = str_replace("<<CATEGORY>>", $this->urlEncode($category), $getString); - } - - if( strpos($getString, "<<AFFILDATA>>") ) - { - $getString = str_replace("<<AFFILDATA>>", $this->getOvertureAffilData($url), $getString); - } - return $getString; - } - - protected function urlEncode($string) - { - if(isset($this->inputEncoding)) - { - return urlencode(mb_convert_encoding($string, $this->inputEncoding)); - }else - { - return urlencode($string); - } - } - - private function getOvertureAffilData($url) - { - $affil_data = 'ip=' . $this->ip; - $affil_data .= '&ua=' . $this->useragent; - if ( isset($_SERVER['HTTP_X_FORWARDED_FOR']) ) { - $affil_data .= '&xfip=' . $_SERVER['HTTP_X_FORWARDED_FOR']; - } - $affilDataValue = $this->urlEncode($affil_data); - # Wir benötigen die ServeUrl: - $serveUrl = $this->urlEncode($url); - - return "&affilData=" . $affilDataValue . "&serveUrl=" . $serveUrl; - } - - public function isEnabled () - { - return $this->enabled; - } -} \ No newline at end of file + # Eine Suchmaschine kann automatisch temporär deaktiviert werden, wenn es Verbindungsprobleme gab: + if (isset($this->disabled) && strtotime($this->disabled) <= time()) { + # In diesem Fall ist der Timeout der Suchmaschine abgelaufen. + $this->enable($metager->getSumaFile(), "Die Suchmaschine " . $this->name . " wurde wieder eingeschaltet."); + } elseif (isset($this->disabled) && strtotime($this->disabled) > time()) { + $this->enabled = false; + return; + } + + $this->useragent = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.1"; + $this->ip = $metager->getIp(); + $this->gefVon = "<a href=\"" . $this->homepage . "\" target=\"_blank\">" . $this->displayName . "</a>"; + $this->startTime = microtime(); + + # Suchstring generieren + $q = ""; + if (isset($this->hasSiteSearch) && $this->hasSiteSearch === "1") { + if (strlen($metager->getSite()) === 0) { + $q = $metager->getQ(); + } else { + $q = $metager->getQ() . " site:" . $metager->getSite(); + } + + } else { + $q = $metager->getQ(); + } + $this->getString = $this->generateGetString($q, $metager->getUrl(), $metager->getLanguage(), $metager->getCategory()); + $this->hash = md5($this->host . $this->getString . $this->port . $this->name); + $this->resultHash = $metager->getHashCode(); + $this->canCache = $metager->canCache(); + } + + abstract public function loadResults($result); + + # ??? + public function getNext(MetaGer $metager, $result) + { + + } + + # Prüft, ob die Suche bereits gecached ist, ansonsted wird sie als Job dispatched + public function startSearch(\App\MetaGer $metager) + { + if ($this->canCache && Cache::has($this->hash)) { + $this->cached = true; + $this->retrieveResults($metager); + } else { + /* Die Anfragen an die Suchmaschinen werden nun von der Laravel-Queue bearbeitet: + * Hinweis: solange in der .env der QUEUE_DRIVER auf "sync" gestellt ist, werden die Abfragen + * nacheinander abgeschickt. + * Sollen diese Parallel verarbeitet werden, muss ein anderer QUEUE_DRIVER verwendet werden. + * siehe auch: https://laravel.com/docs/5.2/queues + */ + $this->dispatch(new Search($this->resultHash, $this->host, $this->port, $this->name, $this->getString, $this->useragent)); + } + } + + # Ruft die Ranking-Funktion aller Ergebnisse auf. + public function rank(\App\MetaGer $metager) + { + foreach ($this->results as $result) { + $result->rank($metager); + } + } + + # Magic ??? + private function setStatistic($key, $val) + { + + $oldVal = floatval(Redis::hget($this->name, $key)) * $this->uses; + $newVal = ($oldVal + max($val, 0)) / $this->uses; + Redis::hset($this->name, $key, $newVal); + $this->$key = $newVal; + } + + # Entfernt wenn gesetzt das disabled="1" für diese Suchmaschine aus der sumas.xml + public function enable($sumaFile, $message) + { + Log::info($message); + $xml = simplexml_load_file($sumaFile); + unset($xml->xpath("//sumas/suma[@name='" . $this->name . "']")['0']['disabled']); + $xml->saveXML($sumaFile); + } + + public function closeFp() + { + fclose($this->fp); + } + + # Öffnet einen neuen Socket für diese Engine + public function getSocket() + { + $number = Redis::hget('search.' . $this->hash, $this->name); + if ($number === null) { + die("test"); + return null; + } else { + return pfsockopen($this->getHost() . ":" . $this->port . "/$number", $this->port, $errstr, $errno, 1); + } + } + + # Fragt die Ergebnisse von Redis ab und lädt Sie + public function retrieveResults(MetaGer $metager) + { + if ($this->loaded) { + return true; + } + + $body = ""; + if ($this->canCache && $this->cacheDuration > 0 && Cache::has($this->hash)) { + $body = Cache::get($this->hash); + } elseif (Redis::hexists('search.' . $this->resultHash, $this->name)) { + $body = Redis::hget('search.' . $this->resultHash, $this->name); + if ($this->canCache && $this->cacheDuration > 0) { + Cache::put($this->hash, $body, $this->cacheDuration); + } + + } + + if ($body !== "") { + $this->loadResults($body); + $this->getNext($metager, $body); + $this->loaded = true; + Redis::hdel('search.' . $this->hash, $this->name); + return true; + } else { + return false; + } + } + + public function shutdown() + { + Redis::del($this->host . "." . $this->socketNumber); + } + + # Erstellt den für die Get-Anfrage genutzten Host-Link + protected function getHost() + { + $return = ""; + if ($this->port === "443") { + $return .= "tls://"; + } else { + $return .= "tcp://"; + } + $return .= $this->host; + return $return; + } + + # Erstellt den für die Get-Anfrage genutzten String + private function generateGetString($query, $url, $language, $category) + { + $getString = ""; + + # Skript: + if (strlen($this->skript) > 0) { + $getString .= $this->skript; + } else { + $getString .= "/"; + } + + # FormData: + if (strlen($this->formData) > 0) { + $getString .= "?" . $this->formData; + } + + # Wir müssen noch einige Platzhalter in dem GET-String ersetzen: + # Useragent + if (strpos($getString, "<<USERAGENT>>")) { + $getString = str_replace("<<USERAGENT>>", $this->urlEncode($this->useragent), $getString); + } + + # Query + if (strpos($getString, "<<QUERY>>")) { + $getString = str_replace("<<QUERY>>", $this->urlEncode($query), $getString); + } + + # IP + if (strpos($getString, "<<IP>>")) { + $getString = str_replace("<<IP>>", $this->urlEncode($this->ip), $getString); + } + + # Language + if (strpos($getString, "<<LANGUAGE>>")) { + $getString = str_replace("<<LANGUAGE>>", $this->urlEncode($language), $getString); + } + + # Category + if (strpos($getString, "<<CATEGORY>>")) { + $getString = str_replace("<<CATEGORY>>", $this->urlEncode($category), $getString); + } + + # Affildata + if (strpos($getString, "<<AFFILDATA>>")) { + $getString = str_replace("<<AFFILDATA>>", $this->getOvertureAffilData($url), $getString); + } + return $getString; + } + + # Wandelt einen String nach aktuell gesetztem inputEncoding dieser Searchengine in URL-Format um + protected function urlEncode($string) + { + if (isset($this->inputEncoding)) { + return urlencode(mb_convert_encoding($string, $this->inputEncoding)); + } else { + return urlencode($string); + } + } + + # Liefert Sonderdaten für Yahoo + private function getOvertureAffilData($url) + { + $affil_data = 'ip=' . $this->ip; + $affil_data .= '&ua=' . $this->useragent; + if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { + $affil_data .= '&xfip=' . $_SERVER['HTTP_X_FORWARDED_FOR']; + } + $affilDataValue = $this->urlEncode($affil_data); + # Wir benötigen die ServeUrl: + $serveUrl = $this->urlEncode($url); + + return "&affilData=" . $affilDataValue . "&serveUrl=" . $serveUrl; + } + + public function isEnabled() + { + return $this->enabled; + } + + # Artefaktmethoden + + public function getCurlInfo() + { + return curl_getinfo($this->ch); + } + + public function getCurlErrors() + { + return curl_errno($this->ch); + } + + public function addCurlHandle($mh) + { + curl_multi_add_handle($mh, $this->ch); + } + + public function removeCurlHandle($mh) + { + curl_multi_remove_handle($mh, $this->ch); + } +} diff --git a/app/Models/parserSkripte/Allesklar.php b/app/Models/parserSkripte/Allesklar.php index da5de26355927ad588b9bd39f2354fbfaa15c880..8e43b26ddb4e783a6d3f29646d394e636ee3d754 100644 --- a/app/Models/parserSkripte/Allesklar.php +++ b/app/Models/parserSkripte/Allesklar.php @@ -7,55 +7,50 @@ use Symfony\Component\DomCrawler\Crawler; class Allesklar extends Searchengine { - protected $tds = ""; - function __construct (\SimpleXMLElement $engine, \App\MetaGer $metager) - { - parent::__construct($engine, $metager); - } - - public function loadResults ($result) - { - $crawler = new Crawler(utf8_decode($result)); - $crawler = $crawler - ->filter('table[width=585]') - ->reduce(function(Crawler $node, $i) { - if($i < 5) - { - return false; - } - }); - - $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 - { - $descr = trim($node->filter('tr > td.bodytext')->eq(2)->text()); - } - $this->counter++; - $this->results[] = new \App\Models\Result( - $this->engine, - $title, - $link, - $link, - $descr, - $this->gefVon, - $this->counter - ); - } catch (\InvalidArgumentException $e) - { - - } - - }); - } - -} \ No newline at end of file + protected $tds = ""; + public function __construct(\SimpleXMLElement $engine, \App\MetaGer $metager) + { + parent::__construct($engine, $metager); + } + + public function loadResults($result) + { + $crawler = new Crawler(utf8_decode($result)); + $crawler = $crawler + ->filter('table[width=585]') + ->reduce(function (Crawler $node, $i) { + if ($i < 5) { + return false; + } + }); + + $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 { + $descr = trim($node->filter('tr > td.bodytext')->eq(2)->text()); + } + $this->counter++; + $this->results[] = new \App\Models\Result( + $this->engine, + $title, + $link, + $link, + $descr, + $this->gefVon, + $this->counter + ); + } catch (\InvalidArgumentException $e) { + + } + + }); + } + +} diff --git a/app/Models/parserSkripte/BASE.php b/app/Models/parserSkripte/BASE.php index 3b28155f4b9d234d10179038741b8ec334be4eaf..dc9d75cbace71e4c7941ec3eb8c2e27d9120a97f 100644 --- a/app/Models/parserSkripte/BASE.php +++ b/app/Models/parserSkripte/BASE.php @@ -1,35 +1,34 @@ <?php namespace app\Models\parserSkripte; + use App\Models\Searchengine; -class BASE extends Searchengine +class BASE extends Searchengine { - public $results = []; + public $results = []; - function __construct (\SimpleXMLElement $engine,\App\MetaGer $metager) - { - parent::__construct($engine, $metager); - } + public function __construct(\SimpleXMLElement $engine, \App\MetaGer $metager) + { + parent::__construct($engine, $metager); + } - public function loadResults ($result) - { - - $title = ""; - $link = ""; - $anzeigeLink = $link; - $descr = ""; + public function loadResults($result) + { - #die($result); + $title = ""; + $link = ""; + $anzeigeLink = $link; + $descr = ""; - /*$this->counter++; - $this->results[] = new \App\Models\Result( - $title, - $link, - $anzeigeLink, - $descr, - $this->gefVon, - $this->counter - );*/ - } -} \ No newline at end of file + /*$this->counter++; + $this->results[] = new \App\Models\Result( + $title, + $link, + $anzeigeLink, + $descr, + $this->gefVon, + $this->counter + );*/ + } +} diff --git a/app/Models/parserSkripte/Beammachine.php b/app/Models/parserSkripte/Beammachine.php index 102f080619a8c1717c0457d585b1fe5225f200ed..2dd2355b7849bafff06d5a685a1beb7308245249 100644 --- a/app/Models/parserSkripte/Beammachine.php +++ b/app/Models/parserSkripte/Beammachine.php @@ -1,45 +1,43 @@ <?php namespace app\Models\parserSkripte; + use App\Models\Searchengine; -class Beammachine extends Searchengine +class Beammachine extends Searchengine { - public $results = []; - - function __construct (\SimpleXMLElement $engine, \App\MetaGer $metager) - { - parent::__construct($engine, $metager); - } - - public function loadResults ($result) - { - $results = trim($result); - - foreach( explode("\n", $results) as $result ) - { - $res = explode("|", $result); - if(sizeof($res) < 3) - { - continue; - } - $title = $res[0]; - $link = $res[1]; - $anzeigeLink = $link; - $descr = $res[2]; - - $this->counter++; - $this->results[] = new \App\Models\Result( - $this->engine, - $title, - $link, - $anzeigeLink, - $descr, - $this->gefVon, - $this->counter - ); - } - - - } + public $results = []; + + public function __construct(\SimpleXMLElement $engine, \App\MetaGer $metager) + { + parent::__construct($engine, $metager); + } + + public function loadResults($result) + { + $results = trim($result); + + foreach (explode("\n", $results) as $result) { + $res = explode("|", $result); + if (sizeof($res) < 3) { + continue; + } + $title = $res[0]; + $link = $res[1]; + $anzeigeLink = $link; + $descr = $res[2]; + + $this->counter++; + $this->results[] = new \App\Models\Result( + $this->engine, + $title, + $link, + $anzeigeLink, + $descr, + $this->gefVon, + $this->counter + ); + } + + } } diff --git a/app/Models/parserSkripte/Bing.php b/app/Models/parserSkripte/Bing.php index 74732ae86ac3c0e4c7a465218e289a89a29c8051..8cf01e0e74855af821eb97b9dfbbe83035749e51 100644 --- a/app/Models/parserSkripte/Bing.php +++ b/app/Models/parserSkripte/Bing.php @@ -1,50 +1,45 @@ <?php namespace app\Models\parserSkripte; + use App\Models\Searchengine; use Symfony\Component\DomCrawler\Crawler; -class Bing extends Searchengine +class Bing extends Searchengine { - public $results = []; - - function __construct (\SimpleXMLElement $engine, \App\MetaGer $metager) - { - parent::__construct($engine, $metager); - } - - public function loadResults ($result) - { - - try - { - $crawler = new Crawler($result); - $crawler->filter('ol#b_results > li.b_algo')->each(function (Crawler $node, $i) - { - $title = $node->filter('li h2 > a')->text(); - $link = $node->filter('li h2 > a')->attr('href'); - $anzeigeLink = $link; - $descr = $node->filter('li div > p')->text(); - - #die($result); - - $this->counter++; - $this->results[] = new \App\Models\Result( - $this->engine, - $title, - $link, - $anzeigeLink, - $descr, - $this->gefVon, - $this->counter - ); - } ); - } catch ( \ErrorException $e) - { - return; - } - - - - } -} \ No newline at end of file + public $results = []; + + public function __construct(\SimpleXMLElement $engine, \App\MetaGer $metager) + { + parent::__construct($engine, $metager); + } + + public function loadResults($result) + { + + try + { + $crawler = new Crawler($result); + $crawler->filter('ol#b_results > li.b_algo')->each(function (Crawler $node, $i) { + $title = $node->filter('li h2 > a')->text(); + $link = $node->filter('li h2 > a')->attr('href'); + $anzeigeLink = $link; + $descr = $node->filter('li div > p')->text(); + + $this->counter++; + $this->results[] = new \App\Models\Result( + $this->engine, + $title, + $link, + $anzeigeLink, + $descr, + $this->gefVon, + $this->counter + ); + }); + } catch (\ErrorException $e) { + return; + } + + } +} diff --git a/app/Models/parserSkripte/Bing_bilder.php b/app/Models/parserSkripte/Bing_bilder.php index aa231d154c6011bf7b3887ee06391463025b51ac..c3ca2691099e8b001f9580bb95a95ac5f7ca442e 100644 --- a/app/Models/parserSkripte/Bing_bilder.php +++ b/app/Models/parserSkripte/Bing_bilder.php @@ -1,45 +1,42 @@ <?php namespace app\Models\parserSkripte; + use App\Models\Searchengine; use Symfony\Component\DomCrawler\Crawler; -class Bing_bilder extends Searchengine +class Bing_bilder extends Searchengine { - public $results = []; + public $results = []; - function __construct (\SimpleXMLElement $engine, \App\MetaGer $metager) - { - parent::__construct($engine, $metager); - } + public function __construct(\SimpleXMLElement $engine, \App\MetaGer $metager) + { + parent::__construct($engine, $metager); + } - public function loadResults ($result) - { - $crawler = new Crawler($result); - $crawler->filter('div#b_content div.item')->each(function (Crawler $node, $i) - { - $title = $node->filter('div.meta > a.tit')->text(); - $link = $node->filter('div.meta > a.tit')->attr("href"); - $anzeigeLink = $link; - $descr = $node->filter('div.meta > div.des')->text(); - $image = $node->filter('a.thumb img')->attr("src"); - #die($result); + public function loadResults($result) + { + $crawler = new Crawler($result); + $crawler->filter('div#b_content div.item')->each(function (Crawler $node, $i) { + $title = $node->filter('div.meta > a.tit')->text(); + $link = $node->filter('div.meta > a.tit')->attr("href"); + $anzeigeLink = $link; + $descr = $node->filter('div.meta > div.des')->text(); + $image = $node->filter('a.thumb img')->attr("src"); - $this->counter++; - $this->results[] = new \App\Models\Result( - $this->engine, - $title, - $link, - $anzeigeLink, - $descr, - $this->gefVon, - $this->counter, - false, - $image - ); - } ); + $this->counter++; + $this->results[] = new \App\Models\Result( + $this->engine, + $title, + $link, + $anzeigeLink, + $descr, + $this->gefVon, + $this->counter, + false, + $image + ); + }); - #die(var_dump($this->results)); - - } -} \ No newline at end of file + } +} diff --git a/app/Models/parserSkripte/Dart.php b/app/Models/parserSkripte/Dart.php index 1d0674aa50df5018caacc292e097f21dab6ce8c7..86f601e7162a3f5755674ba8b123851d060b1678 100644 --- a/app/Models/parserSkripte/Dart.php +++ b/app/Models/parserSkripte/Dart.php @@ -1,63 +1,67 @@ <?php namespace app\Models\parserSkripte; + use App\Models\Searchengine; use Symfony\Component\DomCrawler\Crawler; -class Dart extends Searchengine +class Dart extends Searchengine { - public $results = []; - - function __construct (\SimpleXMLElement $engine, \App\MetaGer $metager) - { - parent::__construct($engine, $metager); - } - - public function loadResults ($result) - { - - $crawler = new Crawler($result); - $crawler->filter('table#search-results > tr > td')->each(function (Crawler $node, $i) - { - $i = $i - ( 6 * $this->counter); - if($i === 0) - return; - if($i === 1) - { - $this->description = $node->text(); - $this->link = "http://www.dart-europe.eu/" . $node->filter('a')->attr('href'); - } - if($i === 2) - $this->title = $node->text(); - if($i === 3) - $this->title .= " (" . $node->text() . ")"; - if($i === 4) - $this->title .= " " . $node->text(); - if($i === 5) - { - $this->title .= "|" . $node->text(); - $title = $this->title; - $this->title = ""; - $link = $this->link; - $this->link = ""; - $anzeigeLink = $link; - $descr = $this->description; - $this->description = ""; - - $this->counter++; - $this->results[] = new \App\Models\Result( - $this->engine, - $title, - $link, - $anzeigeLink, - $descr, - $this->gefVon, - $this->counter - ); - } - } ); - - - - } + public $results = []; + + public function __construct(\SimpleXMLElement $engine, \App\MetaGer $metager) + { + parent::__construct($engine, $metager); + } + + public function loadResults($result) + { + + $crawler = new Crawler($result); + $crawler->filter('table#search-results > tr > td')->each(function (Crawler $node, $i) { + $i = $i - (6 * $this->counter); + if ($i === 0) { + return; + } + + if ($i === 1) { + $this->description = $node->text(); + $this->link = "http://www.dart-europe.eu/" . $node->filter('a')->attr('href'); + } + if ($i === 2) { + $this->title = $node->text(); + } + + if ($i === 3) { + $this->title .= " (" . $node->text() . ")"; + } + + if ($i === 4) { + $this->title .= " " . $node->text(); + } + + if ($i === 5) { + $this->title .= "|" . $node->text(); + $title = $this->title; + $this->title = ""; + $link = $this->link; + $this->link = ""; + $anzeigeLink = $link; + $descr = $this->description; + $this->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/Dmoznebel.php b/app/Models/parserSkripte/Dmoznebel.php index 961157bf78c778ce0623cc2fb620a81a457c7a96..09354fe7aa52da4884a9f9125a66605489c84c7a 100644 --- a/app/Models/parserSkripte/Dmoznebel.php +++ b/app/Models/parserSkripte/Dmoznebel.php @@ -1,46 +1,45 @@ <?php namespace app\Models\parserSkripte; + use App\Models\Searchengine; -class Dmoznebel extends Searchengine +class Dmoznebel extends Searchengine { - public $results = []; - - function __construct (\SimpleXMLElement $engine, \App\MetaGer $metager) - { - parent::__construct($engine, $metager); - } - - public function loadResults ($result) - { - - $result = mb_convert_encoding($result, "UTF-8", "ISO-8859-1"); - $results = trim($result); - - foreach( explode("\n", $results) as $result ) - { - $res = explode("|", $result); - if(sizeof($res) < 3) - { - continue; - } - $title = $res[1]; - $link = $res[2]; - $anzeigeLink = $link; - $descr = $res[3]; - - $this->counter++; - $this->results[] = new \App\Models\Result( - $this->engine, - $title, - $link, - $anzeigeLink, - $descr, - $this->gefVon, - $this->counter - ); - } - - } -} \ No newline at end of file + public $results = []; + + public function __construct(\SimpleXMLElement $engine, \App\MetaGer $metager) + { + parent::__construct($engine, $metager); + } + + public function loadResults($result) + { + + $result = mb_convert_encoding($result, "UTF-8", "ISO-8859-1"); + $results = trim($result); + + foreach (explode("\n", $results) as $result) { + $res = explode("|", $result); + if (sizeof($res) < 3) { + continue; + } + $title = $res[1]; + $link = $res[2]; + $anzeigeLink = $link; + $descr = $res[3]; + + $this->counter++; + $this->results[] = new \App\Models\Result( + $this->engine, + $title, + $link, + $anzeigeLink, + $descr, + $this->gefVon, + $this->counter + ); + } + + } +} diff --git a/app/Models/parserSkripte/Dmoznebel_int.php b/app/Models/parserSkripte/Dmoznebel_int.php index 231ca8ceb78b44bf8a3d5704addb0d220f5639d6..cf2702461d0ed6d206cbc43eeb2117ba4396eef2 100644 --- a/app/Models/parserSkripte/Dmoznebel_int.php +++ b/app/Models/parserSkripte/Dmoznebel_int.php @@ -1,36 +1,35 @@ <?php namespace app\Models\parserSkripte; + use App\Models\Searchengine; -class Dmoznebel_int extends Searchengine +class Dmoznebel_int extends Searchengine { - public $results = []; + public $results = []; - function __construct (\SimpleXMLElement $engine, \App\MetaGer $metager) - { - parent::__construct($engine, $metager); - } + public function __construct(\SimpleXMLElement $engine, \App\MetaGer $metager) + { + parent::__construct($engine, $metager); + } - public function loadResults ($result) - { - - $title = ""; - $link = ""; - $anzeigeLink = $link; - $descr = ""; + public function loadResults($result) + { - die($result); + $title = ""; + $link = ""; + $anzeigeLink = $link; + $descr = ""; - $this->counter++; - $this->results[] = new \App\Models\Result( - $this->engine, - $title, - $link, - $anzeigeLink, - $descr, - $this->gefVon, - $this->counter - ); - } -} \ No newline at end of file + $this->counter++; + $this->results[] = new \App\Models\Result( + $this->engine, + $title, + $link, + $anzeigeLink, + $descr, + $this->gefVon, + $this->counter + ); + } +} diff --git a/app/Models/parserSkripte/Ebay.php b/app/Models/parserSkripte/Ebay.php index 313f69626f8107c7271548eb967057129b72932a..f3c6de8768511dd7cbbc1ccd17f17867c299fe63 100644 --- a/app/Models/parserSkripte/Ebay.php +++ b/app/Models/parserSkripte/Ebay.php @@ -1,52 +1,68 @@ <?php namespace app\Models\parserSkripte; + use App\Models\Searchengine; -class Ebay extends Searchengine +class Ebay extends Searchengine { - public $results = []; - - function __construct (\SimpleXMLElement $engine, \App\MetaGer $metager) - { - parent::__construct($engine, $metager); - } - - public function loadResults ($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; - $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++; - - } - - } -} \ No newline at end of file + public $results = []; + + public function __construct(\SimpleXMLElement $engine, \App\MetaGer $metager) + { + parent::__construct($engine, $metager); + } + + public function loadResults($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>"; + } + + $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++; + + } + + } +} diff --git a/app/Models/parserSkripte/Ecoshopper.php b/app/Models/parserSkripte/Ecoshopper.php index c5e74c27b2ced9b435e853ace3103a6696f66cc1..3b013d142df9cde559f6114b2b23767871dcb7f4 100644 --- a/app/Models/parserSkripte/Ecoshopper.php +++ b/app/Models/parserSkripte/Ecoshopper.php @@ -1,63 +1,62 @@ <?php namespace app\Models\parserSkripte; + use App\Models\Searchengine; use Log; -class Ecoshopper extends Searchengine +class Ecoshopper extends Searchengine { - public $results = []; + public $results = []; + + public function __construct(\SimpleXMLElement $engine, \App\MetaGer $metager) + { + parent::__construct($engine, $metager); + } + + public function loadResults($result) + { + try { + $content = simplexml_load_string($result); + } catch (\Exception $e) { + Log::error("Ergebnisse von Ecoshopper konnten nicht eingelesen werden"); + return; + } - function __construct (\SimpleXMLElement $engine, \App\MetaGer $metager) - { - parent::__construct($engine, $metager); - } + 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; + } - public function loadResults ($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; - }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 - ); - } - } + } 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 + ); + } + } } diff --git a/app/Models/parserSkripte/Europeana.php b/app/Models/parserSkripte/Europeana.php index 2da2db448e9aac4a4d10999eae634202f8222f77..9715b87904aafef1d1a97cb159cdc3ca9e00b3f3 100644 --- a/app/Models/parserSkripte/Europeana.php +++ b/app/Models/parserSkripte/Europeana.php @@ -1,68 +1,66 @@ <?php namespace app\Models\parserSkripte; + use App\Models\Searchengine; -use Symfony\Component\DomCrawler\Crawler; -class Europeana extends Searchengine +class Europeana extends Searchengine { - public $results = []; + public $results = []; + + public function __construct(\SimpleXMLElement $engine, \App\MetaGer $metager) + { + parent::__construct($engine, $metager); + } - 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"); + } - 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"); - } - - if(!$content) - { - return; - } + if (!$content) { + return; + } - $results = $content->items; - foreach($results as $result) - { - if(isset($result->edmPreview)) { - $title = $result->title[0]; + $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 (preg_match("/(.+)\?.*/si", $result->guid, $match)) { + $link = $match[1]; + } else { + $link = ""; + } - $anzeigeLink = $link; - $descr = ""; + $anzeigeLink = $link; + $descr = ""; - /*if (preg_match("/(?:uri=)(.+)/si", urldecode($result->edmPreview[0]), $match)){ - $image = $match[1]; - } else { - $image = ""; - } - echo $image . " -";*/ - $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 - ); - } - } - } -} \ No newline at end of file + /*if (preg_match("/(?:uri=)(.+)/si", urldecode($result->edmPreview[0]), $match)){ + $image = $match[1]; + } else { + $image = ""; + } + echo $image . " + ";*/ + $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 + ); + } + } + } +} diff --git a/app/Models/parserSkripte/Exalead.php b/app/Models/parserSkripte/Exalead.php index c558e8e49046cfbe42ef24560f57b6b409caf250..7a132b0be5433f6714a2f818af547647bb661755 100644 --- a/app/Models/parserSkripte/Exalead.php +++ b/app/Models/parserSkripte/Exalead.php @@ -1,73 +1,76 @@ <?php namespace app\Models\parserSkripte; + use App\Models\Searchengine; -use Log; -class Exalead extends Searchengine +class Exalead extends Searchengine { - public $results = []; + public $results = []; + + public function __construct(\SimpleXMLElement $engine, \App\MetaGer $metager) + { + parent::__construct($engine, $metager); + } + + public function loadResults($result) + { + $result = preg_replace("/\r\n/si", "", $result); + try { + $content = simplexml_load_string($result); + } catch (\Exception $e) { + return; + } - function __construct (\SimpleXMLElement $engine, \App\MetaGer $metager) - { - parent::__construct($engine, $metager); - } + 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"; + } + $namespace = $strNamespace; + } + $results->registerXPathNamespace($prefix, $namespace); + try { + $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(); + } - 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; - $prefix = ""; $namespace = ""; - foreach($results->getDocNamespaces() as $strPrefix => $strNamespace) { - if(strlen($strPrefix)==0) { - $prefix="a"; //Assign an arbitrary namespace prefix. - }else { - $prefix="a"; - } - $namespace = $strNamespace; - } - $results->registerXPathNamespace($prefix,$namespace); - try{ - $results = $results->xpath("//a:hits/a:Hit"); - } 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; - if(sizeOf($result->xpath("a:metas/a:Meta[@name='metadesc']/a:MetaString[@name='value']")) === 0) - $descr = ""; - 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; + } + } + } } diff --git a/app/Models/parserSkripte/Fairmondo.php b/app/Models/parserSkripte/Fairmondo.php index 9f09c06e4b2a8bf179d917910b0b476a18b72acd..b18cd1bb319187c6f867b3c673404f5664b7235a 100644 --- a/app/Models/parserSkripte/Fairmondo.php +++ b/app/Models/parserSkripte/Fairmondo.php @@ -1,50 +1,53 @@ <?php namespace app\Models\parserSkripte; + use App\Models\Searchengine; -class Fairmondo extends Searchengine +class Fairmondo extends Searchengine { - public $results = []; + public $results = []; + + public function __construct(\SimpleXMLElement $engine, \App\MetaGer $metager) + { + parent::__construct($engine, $metager); + } - function __construct (\SimpleXMLElement $engine, \App\MetaGer $metager) - { - parent::__construct($engine, $metager); - } + public function loadResults($result) + { + $results = json_decode($result, true); + $results = $results["articles"]; + foreach ($results as $result) { + if ($this->counter >= 10) { + break; + } - public function loadResults ($result) - { - $results = json_decode($result, true); - $results = $results["articles"]; - foreach($results as $result) - { - if( $this->counter >= 10 ) - break; - $title = $result["title"]; - $link = "https://www.fairmondo.de/articles/" . $result["id"]; - $anzeigeLink = $link; - $descr = $result["slug"]; - if( isset($result['price_cents'])) - { - $descr .= " | Preis: " . (intval($result['price_cents']) / 100.0) . " €"; - } - if( isset($result['title_image_url']) ) - { - $image = $result['title_image_url']; - } + $title = $result["title"]; + $link = "https://www.fairmondo.de/articles/" . $result["id"]; + $anzeigeLink = $link; + $price = 0; + $descr = ""; + if (isset($result['price_cents'])) { + $price = intval($result['price_cents']); + $descr .= "<p>Preis: " . (intval($result['price_cents']) / 100.0) . " €</p>"; + } + if (isset($result['title_image_url'])) { + $image = $result['title_image_url']; + } - $this->counter++; - $this->results[] = new \App\Models\Result( - $this->engine, - $title, - $link, - $anzeigeLink, - $descr, - $this->gefVon, - $this->counter, - false, - $image - ); - } - } -} \ No newline at end of file + $this->counter++; + $this->results[] = new \App\Models\Result( + $this->engine, + $title, + $link, + $anzeigeLink, + $descr, + $this->gefVon, + $this->counter, + false, + $image, + $price + ); + } + } +} diff --git a/app/Models/parserSkripte/Fastbot.php b/app/Models/parserSkripte/Fastbot.php index 6e9dc3b4dd2dfdc2ce95df4e2d32b4a7ab61bb53..208d953c4f2912c64d8a2ffbf6373385f368b717 100644 --- a/app/Models/parserSkripte/Fastbot.php +++ b/app/Models/parserSkripte/Fastbot.php @@ -1,48 +1,48 @@ <?php namespace app\Models\parserSkripte; + use App\Models\Searchengine; -class Fastbot extends Searchengine +class Fastbot extends Searchengine { - public $results = []; + public $results = []; + + public function __construct(\SimpleXMLElement $engine, \App\MetaGer $metager) + { + parent::__construct($engine, $metager); + if (strpos($this->urlEncode($metager->getEingabe()), "%") !== false) { + $this->enabled = false; + return null; + } + } - function __construct (\SimpleXMLElement $engine, \App\MetaGer $metager) - { - parent::__construct($engine, $metager); - if ( strpos($this->urlEncode($metager->getEingabe()), "%") !== FALSE ) - { - $this->enabled = false; - return null; - } - } + public function loadResults($result) + { + $result = utf8_encode($result); + $counter = 0; + foreach (explode("\n", $result) as $line) { + $line = trim($line); + if (strlen($line) > 0) { + # Hier bekommen wir jedes einzelne Ergebnis + $result = explode("|:|", $line); + $link = $result[1]; + $link = substr($link, strpos($link, "href=\"") + 6); + $link = substr($link, 0, strpos($link, "\"")); + $counter++; + $this->gefVon = "<a href=\"" . $this->homepage . "\" target=\"_blank\">" . $this->displayName . " " . trans('results.redirect') . "</a>"; + $this->results[] = new \App\Models\Result( + $this->engine, + trim(strip_tags($result[1])), + $link, + $result[3], + $result[2], + $this->gefVon, + $counter + ); + } - public function loadResults ($result) - { - $result = utf8_encode($result); - $counter = 0; - foreach( explode("\n", $result) as $line ) - { - $line = trim($line); - if( strlen($line) > 0 ){ - # Hier bekommen wir jedes einzelne Ergebnis - $result = explode("|:|", $line); - $link = $result[1]; - $link = substr($link, strpos($link, "href=\"") + 6); - $link = substr($link, 0, strpos($link, "\"")); - $counter++; - $this->results[] = new \App\Models\Result( - $this->engine, - trim(strip_tags($result[1])), - $link, - $result[3], - $result[2], - $this->gefVon, - $counter - ); - } - - } + } - } -} \ No newline at end of file + } +} diff --git a/app/Models/parserSkripte/Fernsehsuche.php b/app/Models/parserSkripte/Fernsehsuche.php new file mode 100644 index 0000000000000000000000000000000000000000..f33ff8f3e6f719f8990987f9185e33aa67d7fb56 --- /dev/null +++ b/app/Models/parserSkripte/Fernsehsuche.php @@ -0,0 +1,50 @@ +<?php + +namespace app\Models\parserSkripte; + +use App\Models\Searchengine; + +class Fernsehsuche extends Searchengine +{ + public $results = []; + + public 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 xml string"); + } + + if (!$content) { + return; + } + + $results = $content->response->docs; + foreach ($results as $result) { + $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 + ); + } + } +} diff --git a/app/Models/parserSkripte/Flickr.php b/app/Models/parserSkripte/Flickr.php index 50be0cd4b686415e1f4387ce03ef92ca1458a2f5..f657714bda98d19c67c82225b4238061aa3faa8b 100644 --- a/app/Models/parserSkripte/Flickr.php +++ b/app/Models/parserSkripte/Flickr.php @@ -1,51 +1,49 @@ <?php namespace app\Models\parserSkripte; + use App\Models\Searchengine; -use Symfony\Component\DomCrawler\Crawler; -class Flickr extends Searchengine +class Flickr extends Searchengine { - public $results = []; + public $results = []; + + public function __construct(\SimpleXMLElement $engine, \App\MetaGer $metager) + { + parent::__construct($engine, $metager); + } - function __construct (\SimpleXMLElement $engine, \App\MetaGer $metager) - { - parent::__construct($engine, $metager); - } + 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"); + } - 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('//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 - ); - } - } -} \ No newline at end of file + 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 + ); + } + } +} diff --git a/app/Models/parserSkripte/Goyax.php b/app/Models/parserSkripte/Goyax.php index ccade3a7e1298e8e85f30f3e065f5a0f7726560d..9c21a49525fc398f6395643ca8ec753ab77721b7 100644 --- a/app/Models/parserSkripte/Goyax.php +++ b/app/Models/parserSkripte/Goyax.php @@ -1,42 +1,40 @@ <?php namespace app\Models\parserSkripte; + use App\Models\Searchengine; use Symfony\Component\DomCrawler\Crawler; -class Goyax extends Searchengine +class Goyax extends Searchengine { - public $results = []; - - function __construct (\SimpleXMLElement $engine, \App\MetaGer $metager) - { - parent::__construct($engine, $metager); - } - - public function loadResults ($result) - { - - $crawler = new Crawler($result); - $crawler->filter('tr.treffer')->each(function (Crawler $node, $i) - { - $title = $node->filter('td.name')->text(); - $link = "http://www.goyax.de" . $node->filter('td.name > a')->attr('href'); - $anzeigeLink = $link; - $descr = "Aktie: " . $node->filter('td.waehrung')->text() . " " . $node->filter('td.isin')->text(); - - $this->counter++; - $this->results[] = new \App\Models\Result( - $this->engine, - $title, - $link, - $anzeigeLink, - $descr, - $this->gefVon, - $this->counter - ); - } ); - - - - } + public $results = []; + + public function __construct(\SimpleXMLElement $engine, \App\MetaGer $metager) + { + parent::__construct($engine, $metager); + } + + public function loadResults($result) + { + + $crawler = new Crawler($result); + $crawler->filter('tr.treffer')->each(function (Crawler $node, $i) { + $title = $node->filter('td.name')->text(); + $link = "http://www.goyax.de" . $node->filter('td.name > a')->attr('href'); + $anzeigeLink = $link; + $descr = "Aktie: " . $node->filter('td.waehrung')->text() . " " . $node->filter('td.isin')->text(); + + $this->counter++; + $this->results[] = new \App\Models\Result( + $this->engine, + $title, + $link, + $anzeigeLink, + $descr, + $this->gefVon, + $this->counter + ); + }); + + } } diff --git a/app/Models/parserSkripte/Loklak.php b/app/Models/parserSkripte/Loklak.php index b0aea9ac102b09ed431c343c873d51f1bfba92a3..04d005eafce7ff4572e2eb7e164aca6a7645f132 100644 --- a/app/Models/parserSkripte/Loklak.php +++ b/app/Models/parserSkripte/Loklak.php @@ -1,43 +1,43 @@ <?php namespace app\Models\parserSkripte; + use App\Models\Searchengine; -use Log; -class Loklak extends Searchengine +class Loklak extends Searchengine { - public $results = []; + public $results = []; + + public function __construct(\SimpleXMLElement $engine, \App\MetaGer $metager) + { + parent::__construct($engine, $metager); + } - function __construct (\SimpleXMLElement $engine, \App\MetaGer $metager) - { - parent::__construct($engine, $metager); - } + public function loadResults($result) + { + if (!$result) { + return; + } + $results = json_decode($result, true); + if (!isset($results['statuses'])) { + return; + } - public function loadResults ($result) - { - if(!$result) - { - return; - } - $results = json_decode($result, true); - if( !isset($results['statuses']) ) - return; - foreach($results['statuses'] as $result) - { - $title = $result["screen_name"]; - $link = $result['link']; - $anzeigeLink = $link; - $descr = $result["text"]; - $this->counter++; - $this->results[] = new \App\Models\Result( - $this->engine, - $title, - $link, - $anzeigeLink, - $descr, - $this->gefVon, - $this->counter - ); - } - } + foreach ($results['statuses'] as $result) { + $title = $result["screen_name"]; + $link = $result['link']; + $anzeigeLink = $link; + $descr = $result["text"]; + $this->counter++; + $this->results[] = new \App\Models\Result( + $this->engine, + $title, + $link, + $anzeigeLink, + $descr, + $this->gefVon, + $this->counter + ); + } + } } diff --git a/app/Models/parserSkripte/Mg_hochsch_de.php b/app/Models/parserSkripte/Mg_hochsch_de.php index 8573d31b6f046dbc4afcdca074ce97926faf06c7..6914c8100b5d464864975de4882c9b07f097184e 100644 --- a/app/Models/parserSkripte/Mg_hochsch_de.php +++ b/app/Models/parserSkripte/Mg_hochsch_de.php @@ -1,46 +1,43 @@ <?php namespace app\Models\parserSkripte; + use App\Models\Searchengine; -class Mg_hochsch_de extends Searchengine +class Mg_hochsch_de extends Searchengine { - public $results = []; - - function __construct (\SimpleXMLElement $engine, \App\MetaGer $metager) - { - parent::__construct($engine, $metager); - } - - public function loadResults ($result) - { - die($result); - $results = trim($result); - - foreach( explode("\n", $results) as $result ) - { - $res = explode("|", $result); - if(sizeof($res) < 3) - { - continue; - } - $title = $res[0]; - $link = $res[2]; - $anzeigeLink = $link; - $descr = $res[1]; - - $this->counter++; - $this->results[] = new \App\Models\Result( - $this->engine, - $title, - $link, - $anzeigeLink, - $descr, - $this->gefVon, - $this->counter - ); - } - - - } -} \ No newline at end of file + public $results = []; + + public function __construct(\SimpleXMLElement $engine, \App\MetaGer $metager) + { + parent::__construct($engine, $metager); + } + + public function loadResults($result) + { + $results = trim($result); + + foreach (explode("\n", $results) as $result) { + $res = explode("|", $result); + if (sizeof($res) < 3) { + continue; + } + $title = $res[0]; + $link = $res[2]; + $anzeigeLink = $link; + $descr = $res[1]; + + $this->counter++; + $this->results[] = new \App\Models\Result( + $this->engine, + $title, + $link, + $anzeigeLink, + $descr, + $this->gefVon, + $this->counter + ); + } + + } +} diff --git a/app/Models/parserSkripte/Mg_produkt2.php b/app/Models/parserSkripte/Mg_produkt2.php index 6aba1210bcf821c88c0437f1f928e322a74d3ba3..839a20025c228518ec9a29603241403c867117f6 100644 --- a/app/Models/parserSkripte/Mg_produkt2.php +++ b/app/Models/parserSkripte/Mg_produkt2.php @@ -1,54 +1,54 @@ <?php namespace app\Models\parserSkripte; + use App\Models\Searchengine; use Log; -class Mg_produkt2 extends Searchengine + +class Mg_produkt2 extends Searchengine { - public $results = []; + public $results = []; + + public function __construct(\SimpleXMLElement $engine, \App\MetaGer $metager) + { + parent::__construct($engine, $metager); + } - function __construct (\SimpleXMLElement $engine, \App\MetaGer $metager) - { - parent::__construct($engine, $metager); - } + public function loadResults($result) + { + $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; + } - public function loadResults ($result) - { - $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; - } - $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 - ); - } - } + 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/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/Minisucher.php b/app/Models/parserSkripte/Minisucher.php index c214f3ea693c4a3ea6114f7a72a3131b2641aff0..36dc2c6ca459a707a1128ccb54ddc866001c4b85 100644 --- a/app/Models/parserSkripte/Minisucher.php +++ b/app/Models/parserSkripte/Minisucher.php @@ -7,79 +7,73 @@ use App\Models\Searchengine; class Minisucher extends Searchengine { - function __construct (\SimpleXMLElement $engine,\App\MetaGer $metager) - { - parent::__construct($engine, $metager); - } + public function __construct(\SimpleXMLElement $engine, \App\MetaGer $metager) + { + parent::__construct($engine, $metager); + } - public function loadResults ($content) - { - try { - $content = simplexml_load_string($content); - } catch (\Exception $e) { - return; - } - if(!$content) - { - return; - } - $results = $content->xpath('//response/result/doc'); + public function loadResults($content) + { + try { + $content = simplexml_load_string($content); + } catch (\Exception $e) { + return; + } + if (!$content) { + return; + } + $results = $content->xpath('//response/result/doc'); - $string = ""; - - $counter = 0; - $providerCounter = []; - foreach($results as $result) - { - try{ - $counter++; - $result = simplexml_load_string($result->saveXML()); + $string = ""; - $title = $result->xpath('//doc/arr[@name="title"]/str')[0]->__toString(); - $link = $result->xpath('//doc/str[@name="url"]')[0]->__toString(); - $anzeigeLink = $link; - $descr = ""; - $descriptions = $content->xpath("//response/lst[@name='highlighting']/lst[@name='$link']/arr[@name='content']/str"); - foreach($descriptions as $description) - { - $descr .= $description->__toString(); - } - $descr = strip_tags($descr); - $provider = $result->xpath('//doc/str[@name="subcollection"]')[0]->__toString(); + $counter = 0; + $providerCounter = []; + foreach ($results as $result) { + try { + $counter++; + $result = simplexml_load_string($result->saveXML()); - if( isset($providerCounter[$provider]) && $providerCounter[$provider] > 10 ) - continue; - else - { - if( !isset($providerCounter[$provider]) ) - $providerCounter[$provider] = 0; - $providerCounter[$provider] += 1; - } + $title = $result->xpath('//doc/arr[@name="title"]/str')[0]->__toString(); + $link = $result->xpath('//doc/str[@name="url"]')[0]->__toString(); + $anzeigeLink = $link; + $descr = ""; + $descriptions = $content->xpath("//response/lst[@name='highlighting']/lst[@name='$link']/arr[@name='content']/str"); + foreach ($descriptions as $description) { + $descr .= $description->__toString(); + } + $descr = strip_tags($descr); + $provider = $result->xpath('//doc/str[@name="subcollection"]')[0]->__toString(); - if( isset($provider) ) - { - $gefVon = "<a href=\"https://metager.de\" target=\"_blank\">Minisucher: $provider</a>"; - }else - { - $gefVon = $this->gefVon; - } + if (isset($providerCounter[$provider]) && $providerCounter[$provider] > 10) { + continue; + } else { + if (!isset($providerCounter[$provider])) { + $providerCounter[$provider] = 0; + } - $this->results[] = new \App\Models\Result( - $this->engine, - $title, - $link, - $link, - $descr, - $gefVon, - $counter - ); - }catch(\ErrorException $e) - { - continue; - } - } - - - } + $providerCounter[$provider] += 1; + } -} \ No newline at end of file + if (isset($provider)) { + $gefVon = "<a href=\"https://metager.de\" target=\"_blank\">Minisucher: $provider</a>"; + } else { + $gefVon = $this->gefVon; + } + + $this->results[] = new \App\Models\Result( + $this->engine, + $title, + $link, + $link, + $descr, + $gefVon, + $counter + ); + } catch (\ErrorException $e) { + continue; + } + } + + } + +} diff --git a/app/Models/parserSkripte/Mnogosearch.php b/app/Models/parserSkripte/Mnogosearch.php index cd78a95a378905daa7b60de8b90e091cacc5443b..43f2ed81aac47f09d892fb47cbabc5f39465ec7e 100644 --- a/app/Models/parserSkripte/Mnogosearch.php +++ b/app/Models/parserSkripte/Mnogosearch.php @@ -1,51 +1,48 @@ <?php namespace app\Models\parserSkripte; + use App\Models\Searchengine; use Symfony\Component\DomCrawler\Crawler; -class Mnogosearch extends Searchengine +class Mnogosearch extends Searchengine { - public $results = []; - - function __construct (\SimpleXMLElement $engine, \App\MetaGer $metager) - { - parent::__construct($engine, $metager); - } - - public function loadResults ($result) - { - $counter = 0; - $crawler = new Crawler($result); - $crawler->filter('table[width=600]') - ->reduce(function (Crawler $node, $i) - { - if(strpos($node->text(), "Result pages:") !== FALSE) - { - return false; - } - }) - ->each(function(Crawler $node, $i) - { - $title = $node->filter('table > tr > td ')->eq(1)->filter('td > div')->text(); - $title = preg_replace("/\s+/si", " ", $title); - - $link = $node->filter('table > tr > td ')->eq(1)->filter('td > div > a')->attr('href'); - $anzeigeLink = $link; - $descr = $node->filter('table > tr > td ')->eq(1)->filter('td > div')->eq(1)->text(); - $this->counter++; - - $this->results[] = new \App\Models\Result( - $this->engine, - $title, - $link, - $anzeigeLink, - $descr, - $this->gefVon, - $this->counter - ); - }); - - - } -} \ No newline at end of file + public $results = []; + + public function __construct(\SimpleXMLElement $engine, \App\MetaGer $metager) + { + parent::__construct($engine, $metager); + } + + public function loadResults($result) + { + $counter = 0; + $crawler = new Crawler($result); + $crawler->filter('table[width=600]') + ->reduce(function (Crawler $node, $i) { + if (strpos($node->text(), "Result pages:") !== false) { + return false; + } + }) + ->each(function (Crawler $node, $i) { + $title = $node->filter('table > tr > td ')->eq(1)->filter('td > div')->text(); + $title = preg_replace("/\s+/si", " ", $title); + + $link = $node->filter('table > tr > td ')->eq(1)->filter('td > div > a')->attr('href'); + $anzeigeLink = $link; + $descr = $node->filter('table > tr > td ')->eq(1)->filter('td > div')->eq(1)->text(); + $this->counter++; + + $this->results[] = new \App\Models\Result( + $this->engine, + $title, + $link, + $anzeigeLink, + $descr, + $this->gefVon, + $this->counter + ); + }); + + } +} diff --git a/app/Models/parserSkripte/Nebel.php b/app/Models/parserSkripte/Nebel.php index a0335650405f362939c4d045d3f4bb1a22ef03ed..3dca04d3c5b6ecddeb4ebd19aa80908899da4ad9 100644 --- a/app/Models/parserSkripte/Nebel.php +++ b/app/Models/parserSkripte/Nebel.php @@ -1,42 +1,43 @@ <?php namespace app\Models\parserSkripte; + use App\Models\Searchengine; -class Nebel extends Searchengine +class Nebel extends Searchengine { - public $results = []; - - function __construct (\SimpleXMLElement $engine,\App\MetaGer $metager) - { - parent::__construct($engine, $metager); - } - - public function loadResults ($result) - { - $results = trim($result); - foreach( explode("\n", $results) as $result ) - { - $res = explode("|", $result); - if(sizeof($res) < 3) - continue; - $title = $res[2]; - $link = $res[0]; - $anzeigeLink = $link; - $descr = $res[1]; - - $this->counter++; - $this->results[] = new \App\Models\Result( - $this->engine, - $title, - $link, - $anzeigeLink, - $descr, - $this->gefVon, - $this->counter - ); - } - - - } -} \ No newline at end of file + public $results = []; + + public function __construct(\SimpleXMLElement $engine, \App\MetaGer $metager) + { + parent::__construct($engine, $metager); + } + + public function loadResults($result) + { + $results = trim($result); + foreach (explode("\n", $results) as $result) { + $res = explode("|", $result); + if (sizeof($res) < 3) { + continue; + } + + $title = $res[2]; + $link = $res[0]; + $anzeigeLink = $link; + $descr = $res[1]; + + $this->counter++; + $this->results[] = new \App\Models\Result( + $this->engine, + $title, + $link, + $anzeigeLink, + $descr, + $this->gefVon, + $this->counter + ); + } + + } +} diff --git a/app/Models/parserSkripte/Onenewspage.php b/app/Models/parserSkripte/Onenewspage.php index 24e9e1da2b93a4eebdc9dfcc7b1fcdfe402d6bc3..936eb30181a5f3cec814d884bddfc8ac978176b9 100644 --- a/app/Models/parserSkripte/Onenewspage.php +++ b/app/Models/parserSkripte/Onenewspage.php @@ -1,45 +1,62 @@ <?php namespace app\Models\parserSkripte; + use App\Models\Searchengine; -class Onenewspage extends Searchengine +class Onenewspage extends Searchengine { - public $results = []; - - function __construct (\SimpleXMLElement $engine, \App\MetaGer $metager) - { - parent::__construct($engine, $metager); - } - - public function loadResults ($result) - { - $results = trim($result); - - foreach( explode("\n", $results) as $result ) - { - $res = explode("|", $result); - if(sizeof($res) < 3) - { - continue; - } - $title = $res[0]; - $link = $res[2]; - $anzeigeLink = $link; - $descr = $res[1]; - - $this->counter++; - $this->results[] = new \App\Models\Result( - $this->engine, - $title, - $link, - $anzeigeLink, - $descr, - $this->gefVon, - $this->counter - ); - } - - - } -} \ No newline at end of file + public $results = []; + public $resultCount = 0; + + private $offset = 0; + public function __construct(\SimpleXMLElement $engine, \App\MetaGer $metager) + { + parent::__construct($engine, $metager); + } + + public function loadResults($result) + { + $results = trim($result); + + foreach (explode("\n", $results) as $result) { + $res = explode("|", $result); + if (sizeof($res) < 3) { + continue; + } + $title = $res[0]; + $link = $res[2]; + $anzeigeLink = $link; + $descr = $res[1]; + + $this->counter++; + $this->results[] = new \App\Models\Result( + $this->engine, + $title, + $link, + $anzeigeLink, + $descr, + $this->gefVon, + $this->counter + ); + } + if (count($this->results) > $this->resultCount) { + $this->resultCount += count($this->results); + } + + } + + public function getNext(\App\MetaGer $metager, $result) + { + if (count($this->results) <= 0) { + return; + } + + $next = new Onenewspage(simplexml_load_string($this->engine), $metager); + $next->resultCount = $this->resultCount; + $next->offset = $this->offset + $this->resultCount; + $next->getString .= "&o=" . $next->offset; + $next->hash = md5($next->host . $next->getString . $next->port . $next->name); + $this->next = $next; + } +} diff --git a/app/Models/parserSkripte/Onenewspagegermany.php b/app/Models/parserSkripte/Onenewspagegermany.php index 5783538d668252798de5f63f924910fcb7e02982..1ca313f849de4eb203ed86c5ba862dea1bc6d7de 100644 --- a/app/Models/parserSkripte/Onenewspagegermany.php +++ b/app/Models/parserSkripte/Onenewspagegermany.php @@ -1,44 +1,62 @@ <?php namespace app\Models\parserSkripte; -use App\Models\Searchengine; + use App\Models\Result; +use App\Models\Searchengine; -class Onenewspagegermany extends Searchengine +class Onenewspagegermany extends Searchengine { - public $results = []; - - function __construct (\SimpleXMLElement $engine, \App\MetaGer $metager) - { - parent::__construct($engine, $metager); - } - - public function loadResults ($result) - { - $counter = 0; - foreach( explode("\n", $result) as $line ) - { - $line = trim($line); - if( strlen($line) > 0 ){ - # Hier bekommen wir jedes einzelne Ergebnis - $result = explode("|", $line); - if(sizeof($result) < 3) - { - continue; - } - $counter++; - $this->results[] = new Result( - $this->engine, - trim(strip_tags($result[0])), - $result[2], - $result[2], - $result[1], - $this->gefVon, - $counter - ); - } - - } - - } -} \ No newline at end of file + public $results = []; + public $resultCount = 0; + + private $offset = 0; + public function __construct(\SimpleXMLElement $engine, \App\MetaGer $metager) + { + parent::__construct($engine, $metager); + } + + public function loadResults($result) + { + $counter = 0; + foreach (explode("\n", $result) as $line) { + $line = trim($line); + if (strlen($line) > 0) { + # Hier bekommen wir jedes einzelne Ergebnis + $result = explode("|", $line); + if (sizeof($result) < 3) { + continue; + } + $counter++; + $this->results[] = new Result( + $this->engine, + trim(strip_tags($result[0])), + $result[2], + $result[2], + $result[1], + $this->gefVon, + $counter + ); + } + + } + if (count($this->results) > $this->resultCount) { + $this->resultCount += count($this->results); + } + + } + + public function getNext(\App\MetaGer $metager, $result) + { + if (count($this->results) <= 0) { + return; + } + + $next = new Onenewspagegermany(simplexml_load_string($this->engine), $metager); + $next->resultCount = $this->resultCount; + $next->offset = $this->offset + $this->resultCount; + $next->getString .= "&o=" . $next->offset; + $next->hash = md5($next->host . $next->getString . $next->port . $next->name); + $this->next = $next; + } +} diff --git a/app/Models/parserSkripte/Onenewspagevideo.php b/app/Models/parserSkripte/Onenewspagevideo.php index b7e33ad31d5efb0c666c90f7de6780555d7b4714..fb888a47bbc8d5fa3ee1788a2c3d6f655593b463 100644 --- a/app/Models/parserSkripte/Onenewspagevideo.php +++ b/app/Models/parserSkripte/Onenewspagevideo.php @@ -1,44 +1,60 @@ <?php namespace app\Models\parserSkripte; + use App\Models\Searchengine; -class Onenewspagevideo extends Searchengine +class Onenewspagevideo extends Searchengine { - public $results = []; - - function __construct (\SimpleXMLElement $engine, \App\MetaGer $metager) - { - parent::__construct($engine, $metager); - } - - public function loadResults ($result) - { - $results = trim($result); - foreach( explode("\n", $results) as $result ) - { - $res = explode("|", $result); - if(sizeof($res) < 3) - { - continue; - } - $title = $res[0]; - $link = $res[2]; - $anzeigeLink = $link; - $descr = $res[1]; - - $this->counter++; - $this->results[] = new \App\Models\Result( - $this->engine, - $title, - $link, - $anzeigeLink, - $descr, - $this->gefVon, - $this->counter - ); - } - - - } -} \ No newline at end of file + public $results = []; + public $resultCount = 0; + + private $offset = 0; + public function __construct(\SimpleXMLElement $engine, \App\MetaGer $metager) + { + parent::__construct($engine, $metager); + } + + public function loadResults($result) + { + $results = trim($result); + foreach (explode("\n", $results) as $result) { + $res = explode("|", $result); + if (sizeof($res) < 3) { + continue; + } + $title = $res[0]; + $link = $res[2]; + $anzeigeLink = $link; + $descr = $res[1]; + + $this->counter++; + $this->results[] = new \App\Models\Result( + $this->engine, + $title, + $link, + $anzeigeLink, + $descr, + $this->gefVon, + $this->counter + ); + } + if (count($this->results) > $this->resultCount) { + $this->resultCount += count($this->results); + } + } + + public function getNext(\App\MetaGer $metager, $result) + { + if (count($this->results) <= 0) { + return; + } + + $next = new Onenewspagevideo(simplexml_load_string($this->engine), $metager); + $next->resultCount = $this->resultCount; + $next->offset = $this->offset + $this->resultCount; + $next->getString .= "&o=" . $next->offset; + $next->hash = md5($next->host . $next->getString . $next->port . $next->name); + $this->next = $next; + } +} diff --git a/app/Models/parserSkripte/Openclipart.php b/app/Models/parserSkripte/Openclipart.php index 73da73f023f34c8f4726f6de793856cf1f41a138..d6674bc71a5d6c78e44225f372a146a3e6c99db9 100644 --- a/app/Models/parserSkripte/Openclipart.php +++ b/app/Models/parserSkripte/Openclipart.php @@ -1,52 +1,50 @@ <?php namespace app\Models\parserSkripte; + use App\Models\Searchengine; -use Symfony\Component\DomCrawler\Crawler; -class Openclipart extends Searchengine +class Openclipart extends Searchengine { - public $results = []; + public $results = []; + + public function __construct(\SimpleXMLElement $engine, \App\MetaGer $metager) + { + parent::__construct($engine, $metager); + } - 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"); + } - 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"); - } - - if(!$content) - { - return; - } + if (!$content) { + return; + } - $results = $content->payload; - foreach($results as $result) - { - $title = $result->title; - $link = $result->detail_link; - $anzeigeLink = $link; - $descr = $result->description; - $image = $result->svg->url; - $this->counter++; - $this->results[] = new \App\Models\Result( - $this->engine, - $title, - $link, - $anzeigeLink, - $descr, - $this->gefVon, - $this->counter, - false, - $image - ); - } - } -} \ No newline at end of file + $results = $content->payload; + foreach ($results as $result) { + $title = $result->title; + $link = $result->detail_link; + $anzeigeLink = $link; + $descr = $result->description; + $image = $result->svg->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/Opencrawlastronomie.php b/app/Models/parserSkripte/Opencrawlastronomie.php index 5d886cf602ca3b370156947587d271e70a076187..2cb36444db0e1cecf02136ad640e15d052fcecf3 100644 --- a/app/Models/parserSkripte/Opencrawlastronomie.php +++ b/app/Models/parserSkripte/Opencrawlastronomie.php @@ -1,52 +1,53 @@ <?php namespace app\Models\parserSkripte; + use App\Models\Searchengine; -class Opencrawlastronomie extends Searchengine +class Opencrawlastronomie extends Searchengine { - public $results = []; - - function __construct (\SimpleXMLElement $engine, \App\MetaGer $metager) - { - parent::__construct($engine, $metager); - } - - public function loadResults ($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; - $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++; - - } - - } -} \ No newline at end of file + public $results = []; + + public function __construct(\SimpleXMLElement $engine, \App\MetaGer $metager) + { + parent::__construct($engine, $metager); + } + + public function loadResults($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; + } + + $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++; + + } + + } +} diff --git a/app/Models/parserSkripte/Opencrawlregengergie.php b/app/Models/parserSkripte/Opencrawlregengergie.php index 156c7a92f485791b5162462f851f051dacde92e0..e601ce52b99892794d0f03454d987444d562e5c9 100644 --- a/app/Models/parserSkripte/Opencrawlregengergie.php +++ b/app/Models/parserSkripte/Opencrawlregengergie.php @@ -1,52 +1,53 @@ <?php namespace app\Models\parserSkripte; + use App\Models\Searchengine; -class Opencrawlregengergie extends Searchengine +class Opencrawlregengergie extends Searchengine { - public $results = []; - - function __construct (\SimpleXMLElement $engine, \App\MetaGer $metager) - { - parent::__construct($engine, $metager); - } - - public function loadResults ($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; - $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++; - - } - - } -} \ No newline at end of file + public $results = []; + + public function __construct(\SimpleXMLElement $engine, \App\MetaGer $metager) + { + parent::__construct($engine, $metager); + } + + public function loadResults($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; + } + + $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++; + + } + + } +} diff --git a/app/Models/parserSkripte/Opencrawltauchen.php b/app/Models/parserSkripte/Opencrawltauchen.php index 0237f60ebcda41cbb13ee232983aae195d06d1d1..db07e29d1772cc5c72564ca02dd97a2a7cfd8998 100644 --- a/app/Models/parserSkripte/Opencrawltauchen.php +++ b/app/Models/parserSkripte/Opencrawltauchen.php @@ -1,51 +1,52 @@ <?php namespace app\Models\parserSkripte; + use App\Models\Searchengine; -class Opencrawltauchen extends Searchengine +class Opencrawltauchen extends Searchengine { - public $results = []; - - function __construct (\SimpleXMLElement $engine, \App\MetaGer $metager) - { - parent::__construct($engine, $metager); - } - - public function loadResults ($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; - $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++; - - } - } -} \ No newline at end of file + public $results = []; + + public function __construct(\SimpleXMLElement $engine, \App\MetaGer $metager) + { + parent::__construct($engine, $metager); + } + + public function loadResults($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; + } + + $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++; + + } + } +} diff --git a/app/Models/parserSkripte/Overture.php b/app/Models/parserSkripte/Overture.php index 2aa36de78a9ee3c834999e2d505ed2cc68a6df19..be3c320c48955b745f27c20d47bbc7ef9af99275 100644 --- a/app/Models/parserSkripte/Overture.php +++ b/app/Models/parserSkripte/Overture.php @@ -1,68 +1,93 @@ <?php namespace app\Models\parserSkripte; + use App\Models\Searchengine; -use Log; -class Overture extends Searchengine +class Overture extends Searchengine { - public $results = []; + public $results = []; + + public function __construct(\SimpleXMLElement $engine, \App\MetaGer $metager) + { + parent::__construct($engine, $metager); + } + + 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('//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 + ); + } - function __construct (\SimpleXMLElement $engine, \App\MetaGer $metager) - { - parent::__construct($engine, $metager); - } + # 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 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('//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 - ); - } + public function getNext(\App\MetaGer $metager, $result) + { + # Auslesen der Argumente für die nächste Suchseite: + $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"); + } + $nextArgs = $content->xpath('//Results/NextArgs'); + if (isset($nextArgs[0])) { + $nextArgs = $nextArgs[0]->__toString(); + } else { + $nextArgs = $content->xpath('//Results/ResultSet[@id="inktomi"]/NextArgs'); + if (isset($nextArgs[0])) { + $nextArgs = $nextArgs[0]->__toString(); + } else { + return; + } + } - # 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 - ); - } - } -} \ No newline at end of file + # Erstellen des neuen Suchmaschinenobjekts und anpassen des GetStrings: + $next = new Overture(simplexml_load_string($this->engine), $metager); + $next->getString = preg_replace("/&Keywords=.*?&/si", "&", $next->getString) . "&" . $nextArgs; + $next->hash = md5($next->host . $next->getString . $next->port . $next->name); + $this->next = $next; + } +} diff --git a/app/Models/parserSkripte/OvertureAds.php b/app/Models/parserSkripte/OvertureAds.php index f28f74dde44896167fbc811b9b9471cdf04a7f6c..e48bc7ed6732c3fdbbd4bd9e85b46da268dbadb8 100644 --- a/app/Models/parserSkripte/OvertureAds.php +++ b/app/Models/parserSkripte/OvertureAds.php @@ -7,43 +7,41 @@ use App\Models\Searchengine; class OvertureAds extends Searchengine { - function __construct (\SimpleXMLElement $engine, \App\MetaGer $metager) - { - parent::__construct($engine, $metager); - } - - 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; - } - - $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 - ); - } - } - -} \ No newline at end of file + public function __construct(\SimpleXMLElement $engine, \App\MetaGer $metager) + { + parent::__construct($engine, $metager); + } + + 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; + } + + $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 + ); + } + } + +} diff --git a/app/Models/parserSkripte/Pixabay.php b/app/Models/parserSkripte/Pixabay.php new file mode 100644 index 0000000000000000000000000000000000000000..31f07dc463faeb169530dcaa885f316cbd0b76f9 --- /dev/null +++ b/app/Models/parserSkripte/Pixabay.php @@ -0,0 +1,50 @@ +<?php + +namespace app\Models\parserSkripte; + +use App\Models\Searchengine; + +class Pixabay extends Searchengine +{ + public $results = []; + + public 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"); + } + + if (!$content) { + 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 + ); + } + } +} diff --git a/app/Models/parserSkripte/Qip.php b/app/Models/parserSkripte/Qip.php index 79466600f63d44dd6d51bf9c2ef403ec5ef500bb..c043b7f27482f2ee193b74bdf6a104bd4ab0756f 100644 --- a/app/Models/parserSkripte/Qip.php +++ b/app/Models/parserSkripte/Qip.php @@ -1,48 +1,46 @@ <?php namespace app\Models\parserSkripte; + use App\Models\Searchengine; -use Log; -class Qip extends Searchengine +class Qip extends Searchengine { - public $results = []; + public $results = []; + + public function __construct(\SimpleXMLElement $engine, \App\MetaGer $metager) + { + parent::__construct($engine, $metager); + } - function __construct (\SimpleXMLElement $engine, \App\MetaGer $metager) - { - parent::__construct($engine, $metager); - } + 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"); + } - 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('//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 - ); - } - } + if (!$content) { + 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/Qualigo.php b/app/Models/parserSkripte/Qualigo.php index 597f6ec8002356fbf5bd7ea328a7540ad01bb9f5..ff240f80268227b8e3fa3a0521ede039f0c4d786 100644 --- a/app/Models/parserSkripte/Qualigo.php +++ b/app/Models/parserSkripte/Qualigo.php @@ -7,41 +7,39 @@ use App\Models\Searchengine; class Qualigo extends Searchengine { - function __construct (\SimpleXMLElement $engine, \App\MetaGer $metager) - { - parent::__construct($engine, $metager); - } + public function __construct(\SimpleXMLElement $engine, \App\MetaGer $metager) + { + parent::__construct($engine, $metager); + } - public function loadResults ($results) - { - try { - $content = simplexml_load_string($results); - } catch (\Exception $e) { - abort(500, "$result is not a valid xml string"); - } - - if(!$content) - { - return; - } - $results = $content->xpath('//RL/RANK'); - foreach($results as $result) - { - $title = $result->{"TITLE"}->__toString(); - $link = $result->{"URL"}->__toString(); - $anzeigeLink = $result->{"ORIGURL"}->__toString(); - $descr = $result->{"ABSTRACT"}->__toString(); - $this->counter++; - $this->ads[] = new \App\Models\Result( - $this->engine, - $title, - $link, - $anzeigeLink, - $descr, - $this->gefVon, - $this->counter - ); - } - } + public function loadResults($results) + { + try { + $content = simplexml_load_string($results); + } catch (\Exception $e) { + abort(500, "$result is not a valid xml string"); + } -} \ No newline at end of file + if (!$content) { + return; + } + $results = $content->xpath('//RL/RANK'); + foreach ($results as $result) { + $title = $result->{"TITLE"}->__toString(); + $link = $result->{"URL"}->__toString(); + $anzeigeLink = $result->{"ORIGURL"}->__toString(); + $descr = $result->{"ABSTRACT"}->__toString(); + $this->counter++; + $this->ads[] = new \App\Models\Result( + $this->engine, + $title, + $link, + $anzeigeLink, + $descr, + $this->gefVon, + $this->counter + ); + } + } + +} diff --git a/app/Models/parserSkripte/Similar_product.php b/app/Models/parserSkripte/Similar_product.php index afd4cf04282c5cbea0508b8b388cde17fc512f39..4a583402912ab85169b93ae7146c04561ead915f 100644 --- a/app/Models/parserSkripte/Similar_product.php +++ b/app/Models/parserSkripte/Similar_product.php @@ -1,38 +1,38 @@ <?php namespace app\Models\parserSkripte; + use App\Models\Searchengine; -class Similar_product extends Searchengine +class Similar_product extends Searchengine { - public $results = []; + public $results = []; - function __construct (\SimpleXMLElement $engine, \App\MetaGer $metager) - { - parent::__construct($engine, $metager); - } + public function __construct(\SimpleXMLElement $engine, \App\MetaGer $metager) + { + parent::__construct($engine, $metager); + } - public function loadResults ($result) - { - $results = json_decode($result); + public function loadResults($result) + { + $results = json_decode($result); - foreach($results->{"products"} as $result) - { - $title = $result->{"title"}; - $link = $result->{"product_url"}; - $anzeigeLink = $link; - $descr = $result->{"description"}; + foreach ($results->{"products"} as $result) { + $title = $result->{"title"}; + $link = $result->{"product_url"}; + $anzeigeLink = $link; + $descr = $result->{"description"}; - $this->counter++; - $this->results[] = new \App\Models\Result( - $this->engine, - $title, - $link, - $anzeigeLink, - $descr, - $this->gefVon, - $this->counter - ); - } - } -} \ No newline at end of file + $this->counter++; + $this->results[] = new \App\Models\Result( + $this->engine, + $title, + $link, + $anzeigeLink, + $descr, + $this->gefVon, + $this->counter + ); + } + } +} diff --git a/app/Models/parserSkripte/Similar_product_ads.php b/app/Models/parserSkripte/Similar_product_ads.php index 8db3b48824d0fa6be2f5ac00ac463e84e232740f..a8d1f42c28192a014bf69aae5128394bbff6a888 100644 --- a/app/Models/parserSkripte/Similar_product_ads.php +++ b/app/Models/parserSkripte/Similar_product_ads.php @@ -7,39 +7,37 @@ use App\Models\Searchengine; class Similar_product_ads extends Searchengine { - function __construct (\SimpleXMLElement $engine, \App\MetaGer $metager) - { - parent::__construct($engine, $metager); - $tmp = $metager->getEingabe(); - $tmp = preg_replace("/\W/si", "", $tmp); - if(strlen($tmp) < 3) - { - $this->removeCurlHandle($mh); - } - } - - public function loadResults ($results) - { - $results = json_decode($result); - - foreach($results->{"products"} as $result) - { - $title = $result->{"title"}; - $link = $result->{"product_url"}; - $anzeigeLink = $link; - $descr = $result->{"description"}; - - $this->counter++; - $this->ads[] = new \App\Models\Result( - $this->engine, - $title, - $link, - $anzeigeLink, - $descr, - $this->gefVon, - $this->counter - ); - } - } - -} \ No newline at end of file + public function __construct(\SimpleXMLElement $engine, \App\MetaGer $metager) + { + parent::__construct($engine, $metager); + $tmp = $metager->getEingabe(); + $tmp = preg_replace("/\W/si", "", $tmp); + if (strlen($tmp) < 3) { + $this->removeCurlHandle($mh); + } + } + + public function loadResults($results) + { + $results = json_decode($result); + + foreach ($results->{"products"} as $result) { + $title = $result->{"title"}; + $link = $result->{"product_url"}; + $anzeigeLink = $link; + $descr = $result->{"description"}; + + $this->counter++; + $this->ads[] = new \App\Models\Result( + $this->engine, + $title, + $link, + $anzeigeLink, + $descr, + $this->gefVon, + $this->counter + ); + } + } + +} diff --git a/app/Models/parserSkripte/Suchticker.php b/app/Models/parserSkripte/Suchticker.php index 8d9b66ed6c4a4ad180ed08ff5622eb4c05ff6bbc..14b004deeec2158836bd53c3770d10f63f32716b 100644 --- a/app/Models/parserSkripte/Suchticker.php +++ b/app/Models/parserSkripte/Suchticker.php @@ -1,45 +1,43 @@ <?php namespace app\Models\parserSkripte; + use App\Models\Searchengine; -class Suchticker extends Searchengine +class Suchticker extends Searchengine { - public $results = []; - - function __construct (\SimpleXMLElement $engine, \App\MetaGer $metager) - { - parent::__construct($engine, $metager); - } - - public function loadResults ($result) - { - $results = trim($result); - - foreach( explode("\n", $results) as $result ) - { - $res = explode("';'", $result); - if(sizeof($res) < 3) - { - continue; - } - $title = trim($res[0], "'"); - $link = trim($res[1], "'"); - $anzeigeLink = $link; - $descr = trim($res[2], "'"); - - $this->counter++; - $this->results[] = new \App\Models\Result( - $this->engine, - $title, - $link, - $anzeigeLink, - $descr, - $this->gefVon, - $this->counter - ); - } - - - } -} \ No newline at end of file + public $results = []; + + public function __construct(\SimpleXMLElement $engine, \App\MetaGer $metager) + { + parent::__construct($engine, $metager); + } + + public function loadResults($result) + { + $results = trim($result); + + foreach (explode("\n", $results) as $result) { + $res = explode("';'", $result); + if (sizeof($res) < 3) { + continue; + } + $title = trim($res[0], "'"); + $link = trim($res[1], "'"); + $anzeigeLink = $link; + $descr = trim($res[2], "'"); + + $this->counter++; + $this->results[] = new \App\Models\Result( + $this->engine, + $title, + $link, + $anzeigeLink, + $descr, + $this->gefVon, + $this->counter + ); + } + + } +} diff --git a/app/Models/parserSkripte/Tuhh.php b/app/Models/parserSkripte/Tuhh.php index e5614fb73eac86fb29718797eac4ede444a94607..6c91509100ea021a535147406dce9927cd9f0e9d 100644 --- a/app/Models/parserSkripte/Tuhh.php +++ b/app/Models/parserSkripte/Tuhh.php @@ -1,50 +1,51 @@ <?php namespace app\Models\parserSkripte; + use App\Models\Searchengine; -class Tuhh extends Searchengine +class Tuhh extends Searchengine { - public $results = []; - - function __construct (\SimpleXMLElement $engine, \App\MetaGer $metager) - { - parent::__construct($engine, $metager); - } - - public function loadResults ($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; - $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++; - } - - } -} \ No newline at end of file + public $results = []; + + public function __construct(\SimpleXMLElement $engine, \App\MetaGer $metager) + { + parent::__construct($engine, $metager); + } + + public function loadResults($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; + } + + $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++; + } + + } +} diff --git a/app/Models/parserSkripte/Wikipedia.php b/app/Models/parserSkripte/Wikipedia.php index dc52f01f1dfbbc09a7262b85e7cf147c19418f71..f1fdd6ecf7fd6e70e1d97b138445a677b31aa78d 100644 --- a/app/Models/parserSkripte/Wikipedia.php +++ b/app/Models/parserSkripte/Wikipedia.php @@ -1,31 +1,31 @@ <?php namespace app\Models\parserSkripte; + use App\Models\Searchengine; -class Wikipedia extends Searchengine +class Wikipedia extends Searchengine { - public $results = []; + public $results = []; + + public function __construct(\SimpleXMLElement $engine, \App\MetaGer $metager) + { + parent::__construct($engine, $metager); + } - function __construct (\SimpleXMLElement $engine,\App\MetaGer $metager) - { - parent::__construct($engine, $metager); - } + public function loadResults($result) + { + $result = utf8_decode($result); + $counter = 0; - public function loadResults ($result) - { - $result = utf8_decode($result); - $counter = 0; - - #die($crawler); - $this->results[] = new \App\Models\Result( - $this->engine, - trim(strip_tags($result[1])), - $link, - $result[3], - $result[2], - $this->gefVon, - $counter - ); - } -} \ No newline at end of file + $this->results[] = new \App\Models\Result( + $this->engine, + trim(strip_tags($result[1])), + $link, + $result[3], + $result[2], + $this->gefVon, + $counter + ); + } +} diff --git a/app/Models/parserSkripte/Witch.php b/app/Models/parserSkripte/Witch.php index d87851c7f1252ec26b8ec91a50f83db20b1549bd..70e49ba418a174a036b155a222274b1e0239072f 100644 --- a/app/Models/parserSkripte/Witch.php +++ b/app/Models/parserSkripte/Witch.php @@ -1,36 +1,34 @@ <?php namespace app\Models\parserSkripte; + use App\Models\Searchengine; -class Witch extends Searchengine +class Witch extends Searchengine { public $results = []; - function __construct (\SimpleXMLElement $engine, \App\MetaGer $metager) + public function __construct(\SimpleXMLElement $engine, \App\MetaGer $metager) { parent::__construct($engine, $metager); } - public function loadResults ($result) + public function loadResults($result) { $result = html_entity_decode(trim(utf8_encode($result))); - + $results = explode("\n", $result); array_shift($results); - foreach($results as $res) - { - + foreach ($results as $res) { + $res = explode(";", $res); - if(sizeof($res) !== 4 || $res[3] === "'Kein Ergebnis'") - { + if (sizeof($res) !== 4 || $res[3] === "'Kein Ergebnis'") { continue; } - $title = trim($res[0], "'"); - $link = trim($res[2], "'"); + $title = trim($res[0], "'"); + $link = trim($res[2], "'"); $anzeigeLink = $link; - $descr = trim($res[1], "'"); - + $descr = trim($res[1], "'"); $this->counter++; $this->results[] = new \App\Models\Result( @@ -45,4 +43,17 @@ class Witch extends Searchengine } } -} \ No newline at end of file + + public function getNext(\App\MetaGer $metager, $result) + { + if (count($this->results) <= 0) { + return; + } + + $next = new Witch(simplexml_load_string($this->engine), $metager); + $offset = $metager->getPage() * 10; + $next->getString = preg_replace("/&cn=\d+/si", "&cn=$offset", $next->getString); + $next->hash = md5($next->host . $next->getString . $next->port . $next->name); + $this->next = $next; + } +} diff --git a/app/Models/parserSkripte/Yacy.php b/app/Models/parserSkripte/Yacy.php index ee82cff416d71d9ae5f1b926ca21539170c453ca..05ac7e562c393b72c415abd3013ac22c538ae70a 100644 --- a/app/Models/parserSkripte/Yacy.php +++ b/app/Models/parserSkripte/Yacy.php @@ -1,38 +1,41 @@ <?php namespace app\Models\parserSkripte; + use App\Models\Searchengine; -class Yacy extends Searchengine +class Yacy extends Searchengine { public $results = []; - function __construct (\SimpleXMLElement $engine, \App\MetaGer $metager) + public function __construct(\SimpleXMLElement $engine, \App\MetaGer $metager) { parent::__construct($engine, $metager); } - public function loadResults ($result) + public function loadResults($result) { - - # die($result); + try { $content = simplexml_load_string($result); } catch (\Exception $e) { abort(500, "$result is not a valid xml string"); } - if(!$content) + if (!$content) { return; + } + $results = $content->xpath("//rss/channel/item"); - if(!$results) + if (!$results) { return; - foreach($results as $res) - { - $title = $res->{"title"}; - $link = $res->{"link"}; + } + + foreach ($results as $res) { + $title = $res->{"title"}; + $link = $res->{"link"}; $anzeigeLink = $link; - $descr = $res->{"description"}; + $descr = $res->{"description"}; $this->counter++; $this->results[] = new \App\Models\Result( @@ -44,6 +47,6 @@ class Yacy extends Searchengine $this->gefVon, $this->counter ); - } + } } -} \ No newline at end of file +} diff --git a/app/Models/parserSkripte/Yacyunih.php b/app/Models/parserSkripte/Yacyunih.php index e9532d8f775a1eedaadf4af06afb78fe5fc2635b..beefd276e7c3e705d27ebf5696311f7e03b3aafc 100644 --- a/app/Models/parserSkripte/Yacyunih.php +++ b/app/Models/parserSkripte/Yacyunih.php @@ -1,54 +1,57 @@ <?php namespace app\Models\parserSkripte; + use App\Models\Searchengine; -class Yacyunih extends Searchengine +class Yacyunih extends Searchengine { - public $results = []; - - function __construct (\SimpleXMLElement $engine, \App\MetaGer $metager) - { - parent::__construct($engine, $metager); - } - - public function loadResults ($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; - $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++; - - } - - } -} \ No newline at end of file + public $results = []; + + public function __construct(\SimpleXMLElement $engine, \App\MetaGer $metager) + { + parent::__construct($engine, $metager); + } + + public function loadResults($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; + } + + $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++; + + } + + } +} diff --git a/app/Models/parserSkripte/Yandex.php b/app/Models/parserSkripte/Yandex.php index c3cb2d013031a0f7dc00084d3bdf90adf72ab123..9a29c72659bc705155a9bcf1afe61a9c95c5e73d 100644 --- a/app/Models/parserSkripte/Yandex.php +++ b/app/Models/parserSkripte/Yandex.php @@ -1,58 +1,76 @@ <?php namespace app\Models\parserSkripte; + use App\Models\Searchengine; -use Log; -class Yandex extends Searchengine +class Yandex 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 = simplexml_load_string($result); - } catch (\Exception $e) { - abort(500, "$result is not a valid xml string"); - } - - 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()); - } - $this->counter++; - $this->results[] = new \App\Models\Result( - $this->engine, - $title, - $link, - $anzeigeLink, - $descr, - $this->gefVon, - $this->counter - ); - } - } + public $results = []; + + public function __construct(\SimpleXMLElement $engine, \App\MetaGer $metager) + { + parent::__construct($engine, $metager); + } + + 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; + 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()); + } + $this->counter++; + $this->results[] = new \App\Models\Result( + $this->engine, + $title, + $link, + $anzeigeLink, + $descr, + $this->gefVon, + $this->counter + ); + } + } + + public function getNext(\App\MetaGer $metager, $result) + { + # Wir müssen herausfinden, ob es überhaupt noch weitere Ergebnisse von Yandex gibt: + try { + $content = simplexml_load_string($result); + $resultCount = intval($content->xpath('//yandexsearch/response/results/grouping/found[@priority="all"]')[0]->__toString()); + $pageLast = $content->xpath('//yandexsearch/response/results/grouping/page')[0]; + $pageLast = intval($pageLast["last"]->__toString()); + } catch (\Exception $e) { + return; + } + + if (count($this->results) <= 0 || $pageLast >= $resultCount) { + return; + } + + $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; + } } diff --git a/app/Models/parserSkripte/Zeitde.php b/app/Models/parserSkripte/Zeitde.php index 99014cc0bb611ac8284e171cc91d0e42bcf9fa9d..2a2f51619f89a1b09733812a99a6f357661f8830 100644 --- a/app/Models/parserSkripte/Zeitde.php +++ b/app/Models/parserSkripte/Zeitde.php @@ -1,45 +1,47 @@ <?php namespace app\Models\parserSkripte; + use App\Models\Searchengine; -class Zeitde extends Searchengine +class Zeitde extends Searchengine { - public $results = []; - - function __construct (\SimpleXMLElement $engine, \App\MetaGer $metager) - { - parent::__construct($engine, $metager); - } - - public function loadResults ($result) - { - - $results = json_decode($result); - if(!$results) - return; - foreach( $results->{"matches"} as $result ) - { - if( !isset($result->{"title"}) || !isset($result->{"href"}) || !isset($result->{"snippet"})) - continue; - $title = $result->{"title"}; - $link = $result->{"href"}; - $anzeigeLink = $link; - $descr = $result->{"snippet"}; - - $this->counter++; - $this->results[] = new \App\Models\Result( - $this->engine, - $title, - $link, - $anzeigeLink, - $descr, - $this->gefVon, - $this->counter - ); - } - - - - } -} \ No newline at end of file + public $results = []; + + public function __construct(\SimpleXMLElement $engine, \App\MetaGer $metager) + { + parent::__construct($engine, $metager); + } + + public function loadResults($result) + { + + $results = json_decode($result); + if (!$results) { + return; + } + + foreach ($results->{"matches"} as $result) { + if (!isset($result->{"title"}) || !isset($result->{"href"}) || !isset($result->{"snippet"})) { + continue; + } + + $title = $result->{"title"}; + $link = $result->{"href"}; + $anzeigeLink = $link; + $descr = $result->{"snippet"}; + + $this->counter++; + $this->results[] = new \App\Models\Result( + $this->engine, + $title, + $link, + $anzeigeLink, + $descr, + $this->gefVon, + $this->counter + ); + } + + } +} diff --git a/config/cache.php b/config/cache.php index 3ffa840b0ba9d28be165370bc1f3b5ceb2ff89cf..69e6a79544f24ed7d85a0eb0925a08a448b18a8a 100755 --- a/config/cache.php +++ b/config/cache.php @@ -11,9 +11,9 @@ return [ | using this caching library. This connection is used when another is | not explicitly specified when executing a given caching function. | - */ + */ - 'default' => env('CACHE_DRIVER', 'file'), + 'default' => env('CACHE_DRIVER', 'redis'), /* |-------------------------------------------------------------------------- @@ -24,43 +24,43 @@ return [ | well as their drivers. You may even define multiple stores for the | same cache driver to group types of items stored in your caches. | - */ + */ - 'stores' => [ + 'stores' => [ - 'apc' => [ + 'apc' => [ 'driver' => 'apc', ], - 'array' => [ + 'array' => [ 'driver' => 'array', ], - 'database' => [ - 'driver' => 'database', - 'table' => 'cache', + 'database' => [ + 'driver' => 'database', + 'table' => 'cache', 'connection' => null, ], - 'file' => [ + 'file' => [ 'driver' => 'file', - 'path' => storage_path('framework/cache'), + 'path' => storage_path('framework/cache'), ], 'memcached' => [ - 'driver' => 'memcached', + 'driver' => 'memcached', 'servers' => [ [ - 'host' => env('MEMCACHED_HOST', '127.0.0.1'), - 'port' => env('MEMCACHED_PORT', 11211), + 'host' => env('MEMCACHED_HOST', '127.0.0.1'), + 'port' => env('MEMCACHED_PORT', 11211), 'weight' => 100, ], ], ], - 'redis' => [ - 'driver' => 'redis', - 'connection' => 'default', + 'redis' => [ + 'driver' => 'redis', + 'connection' => 'redisCache', ], ], @@ -74,8 +74,8 @@ return [ | be other applications utilizing the same cache. So, we'll specify a | value to get prefixed to all our keys so we can avoid collisions. | - */ + */ - 'prefix' => 'laravel', + 'prefix' => 'laravel', ]; diff --git a/config/database.php b/config/database.php index 95646bcf2352226c409d484c1ccc68f6bbfa4a76..4e1c23ac3ca2003c9c9d5977956aa74b9ff5e899 100755 --- a/config/database.php +++ b/config/database.php @@ -11,9 +11,9 @@ return [ | stdClass object; however, you may desire to retrieve records in an | array format for simplicity. Here you can tweak the fetch style. | - */ + */ - 'fetch' => PDO::FETCH_CLASS, + 'fetch' => PDO::FETCH_CLASS, /* |-------------------------------------------------------------------------- @@ -24,9 +24,9 @@ return [ | to use as your default connection for all database work. Of course | you may use many connections at once using the Database library. | - */ + */ - 'default' => env('DB_CONNECTION', 'mysql'), + 'default' => env('DB_CONNECTION', 'mysql'), /* |-------------------------------------------------------------------------- @@ -42,40 +42,40 @@ return [ | so make sure you have the driver for your particular database of | choice installed on your machine before you begin development. | - */ + */ 'connections' => [ 'sqlite' => [ - 'driver' => 'sqlite', + 'driver' => 'sqlite', 'database' => database_path(env('DB_DATABASE', 'database.sqlite')), - 'prefix' => '', + 'prefix' => '', ], - 'mysql' => [ - 'driver' => 'mysql', - 'host' => env('DB_HOST', 'localhost'), - 'port' => env('DB_PORT', '3306'), - 'database' => env('DB_DATABASE', 'forge'), - 'username' => env('DB_USERNAME', 'forge'), - 'password' => env('DB_PASSWORD', ''), - 'charset' => 'utf8', + 'mysql' => [ + 'driver' => 'mysql', + 'host' => env('DB_HOST', 'localhost'), + 'port' => env('DB_PORT', '3306'), + 'database' => env('DB_DATABASE', 'forge'), + 'username' => env('DB_USERNAME', 'forge'), + 'password' => env('DB_PASSWORD', ''), + 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', - 'prefix' => '', - 'strict' => false, - 'engine' => null, + 'prefix' => '', + 'strict' => false, + 'engine' => null, ], - 'pgsql' => [ - 'driver' => 'pgsql', - 'host' => env('DB_HOST', 'localhost'), - 'port' => env('DB_PORT', '5432'), + 'pgsql' => [ + 'driver' => 'pgsql', + 'host' => env('DB_HOST', 'localhost'), + 'port' => env('DB_PORT', '5432'), 'database' => env('DB_DATABASE', 'forge'), 'username' => env('DB_USERNAME', 'forge'), 'password' => env('DB_PASSWORD', ''), - 'charset' => 'utf8', - 'prefix' => '', - 'schema' => 'public', + 'charset' => 'utf8', + 'prefix' => '', + 'schema' => 'public', ], ], @@ -89,9 +89,9 @@ return [ | your application. Using this information, we can determine which of | the migrations on disk haven't actually been run in the database. | - */ + */ - 'migrations' => 'migrations', + 'migrations' => 'migrations', /* |-------------------------------------------------------------------------- @@ -102,25 +102,30 @@ return [ | provides a richer set of commands than a typical key-value systems | such as APC or Memcached. Laravel makes it easy to dig right in. | - */ + */ - 'redis' => [ + 'redis' => [ - 'cluster' => false, + 'cluster' => false, - 'default' => [ - 'host' => env('REDIS_HOST', 'localhost'), + 'default' => [ + 'host' => env('REDIS_HOST', 'localhost'), 'password' => env('REDIS_PASSWORD', null), - 'port' => env('REDIS_PORT', 6379), + 'port' => env('REDIS_PORT', 6379), 'database' => 0, ], - 'redisLogs' => [ - 'host' => env('REDIS_LOGS_HOST', 'localhost'), + 'redisLogs' => [ + 'host' => env('REDIS_LOGS_HOST', 'localhost'), 'password' => env('REDIS_LOGS_PASSWORD', env('REDIS_PASSWORD', null)), - 'port' => env('REDIS_MAIN_PORT', 6379), + 'port' => env('REDIS_LOGS_PORT', 6379), 'database' => 1, ], - + 'redisCache' => [ + 'host' => env('REDIS_CACHE_HOST', 'localhost'), + 'password' => env('REDIS_CACHE_PASSWORD', env('REDIS_PASSWORD', null)), + 'port' => env('REDIS_CACHE_PORT', 6379), + 'database' => 2, + ], ], ]; diff --git a/deploy/Homestead.yaml b/deploy/Homestead.yaml deleted file mode 100644 index c941040ae9dfdfeafa9c437f5553ce703c8a3b48..0000000000000000000000000000000000000000 --- a/deploy/Homestead.yaml +++ /dev/null @@ -1,34 +0,0 @@ ---- -ip: "192.168.10.10" -memory: 2048 -cpus: 1 -provider: virtualbox - -authorize: ~/.ssh/id_rsa.pub - -keys: - - ~/.ssh/id_rsa - -folders: - - map: ~/MetaGer - to: /home/vagrant/MetaGer - -sites: - - map: 192.168.10.10 - to: /home/vagrant/MetaGer/public - -databases: - - homestead - -# blackfire: -# - id: foo -# token: bar -# client-id: foo -# client-token: bar - -# ports: -# - send: 50000 -# to: 5000 -# - send: 7777 -# to: 777 -# protocol: udp diff --git a/deploy/checkServerStatus.sh b/deploy/checkServerStatus.sh deleted file mode 100755 index 04fc03e9005c6d01fe3d69cbd54404c729a501c6..0000000000000000000000000000000000000000 --- a/deploy/checkServerStatus.sh +++ /dev/null @@ -1,48 +0,0 @@ -path="$1" -# Klone das Repo neu, falls es noch nicht existiert -if [ ! -d ~/MetaGer ] -then - cd ~/ - git clone "$path" - cd ~/MetaGer - composer update - chmod -R 777 storage/ bootstrap/cache -fi -# Falls notwendig Laravel-Framework initialisieren: - -if [ ! -f ~/MetaGer/.env ] -then - cd ~/MetaGer - cp .env.example .env -fi -if [ $(grep "SomeRandomString" ~/MetaGer/.env) ] -then - cd ~/MetaGer - php artisan key:generate -fi -# Falls notwendig Homestead Server intialisieren: -if [ ! -d ~/Homestead ] -then - cd ~/ - # Wir brauchen unseren öffentlichen ssh Schlüssel: - if [ ! -d .ssh ] - then - mkdir .ssh - chmod 700 .ssh - fi - if [ ! -f .ssh/id_rsa.pub ] - then - cd .ssh - ssh-keygen -t rsa -N "" -f id_rsa - cd ~/ - fi - vagrant box add --provider virtualbox laravel/homestead - git clone https://github.com/laravel/homestead.git Homestead - cd Homestead/ - bash init.sh - cd ~/ - cp -f "$path/deploy/Homestead.yaml" .homestead/ - cd Homestead/ - vagrant up - echo "Your server is now running under http://localhost:8000" -fi diff --git a/public/css/danke.css b/public/css/danke.css new file mode 100644 index 0000000000000000000000000000000000000000..03eee205d4046316970f69eaaa94ea13f3b8963b --- /dev/null +++ b/public/css/danke.css @@ -0,0 +1,5 @@ +@media print { + .noprint { + display: none!important; + } +} \ No newline at end of file diff --git a/public/css/partnershops.css b/public/css/partnershops.css new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/public/css/styleResultPage.css b/public/css/styleResultPage.css index 48475f52e3d4d5f3e4fd66ab950df437d83a08f7..daaf135a73a08c560582caa4a7b7e477b50505c8 100644 --- a/public/css/styleResultPage.css +++ b/public/css/styleResultPage.css @@ -1,5 +1,5 @@ -*{ - font-family: Liberation Sans, sans-serif; +* { + font-family: Liberation Sans, sans-serif; } .row { @@ -7,73 +7,68 @@ margin-top: 0; } -header * { -} +header * {} #foki li { /* background-color: rgba(255, 255, 255, 0.93); */ /* border-top-right-radius: 5px; */ } -.nav-tabs > li.active { -} +.nav-tabs > li.active {} nav-tabs > li.active { border-bottom: 0; } .tab-pane.active { - /* -webkit-box-shadow: 5px 5px 10px 0px rgba(0,0,0,0.55); */ - -moz-box-shadow: 5px 5px 10px 0px rgba(0,0,0,0.55); - - /* box-shadow: 5px 5px 10px 0px rgba(0,0,0,0.55); */ - padding: 10px 0; - padding-top: 0; + /* -webkit-box-shadow: 5px 5px 10px 0px rgba(0,0,0,0.55); */ + -moz-box-shadow: 5px 5px 10px 0px rgba(0, 0, 0, 0.55); + /* box-shadow: 5px 5px 10px 0px rgba(0,0,0,0.55); */ + padding: 10px 0; + padding-top: 0; } + /* Hier der Style für unsere Suchleiste */ - #researchBar - { - - } - .alert{ - + +#researchBar {} + +.tab-pane .alert { margin: 10px 0; padding: 5px 15px; } - .alert ul{ - list-style-type:none; - - padding-left: 49px; + +.alert ul { + list-style-type: none; + padding-left: 49px; } - /* Logo */ - .logo - { + + +/* Logo */ + +.logo { height: 35px; - padding: 5px 0; } - .logo > a - { + +.logo > a { line-height: 100%; - height: 100%; display: block; } -#research *{ -} + +#research * {} #research ul.list-inline { margin-left: 0; width: 100%; } -@media (max-width: 767px){ - #research .visible-xs { - display: inline-block!important; - } - #research nav ul li + li + li{ - } +@media (max-width: 767px) { + #research .visible-xs { + display: inline-block!important; + } + #research nav ul li + li + li {} } .input-group-addon { @@ -124,341 +119,409 @@ header ul { width: 100%; height: 45px; z-index: 500; - - width: 80%; left: 50%; margin-left: -40%; } - .logo h1 - { - font-family: Liberation Sans, sans-serif; - font-style: italic; - margin: 0; - font-weight: bold; - line-height:1; - white-space:nowrap; - - /* padding: 5px 0; */ -} - #search - { - background-color: inherit; - border:0; - - width: 50px; - height: 100%; -} - #reSearch - { - -} - #reSearch a - { - color: black; - } -.content-wrapper - { - width: 80%; - margin: 0 auto; - padding-top: 60px; - /* padding: 10px; */ - - background-color: white; - -webkit-box-shadow: 1px 1px 3px 1px rgba(0,0,0,0.3); -moz-box-shadow: 1px 1px 3px 1px rgba(0,0,0,0.3); box-shadow: 1px 1px 3px 1px rgba(0,0,0,0.3); -} - #helpButton - { - color:black; - } -body -{ + +.logo h1 { + font-family: Liberation Sans, sans-serif; + font-style: italic; + margin: 0; + font-weight: bold; + line-height: 1; + white-space: nowrap; + /* padding: 5px 0; */ +} + +#search { + background-color: inherit; + border: 0; + width: 50px; + height: 100%; +} + +#reSearch {} + +#reSearch a { + color: black; +} + +.content-wrapper { + width: 80%; + margin: 0 auto; + padding-top: 60px; + /* padding: 10px; */ + background-color: white; + -webkit-box-shadow: 1px 1px 3px 1px rgba(0, 0, 0, 0.3); + -moz-box-shadow: 1px 1px 3px 1px rgba(0, 0, 0, 0.3); + box-shadow: 1px 1px 3px 1px rgba(0, 0, 0, 0.3); +} + +#helpButton { + color: black; +} + +body { height: 100%; background-image: inherit; /* background-attachment: fixed; */ - background-color: rgba(2,93,140,.03); + background-color: rgba(2, 93, 140, .03); } -a:link -{ - color:#0000FF; + +a:link { + color: #0000FF; } a#donation:hover {} -a#donation,a#donation:visited { +a#donation, a#donation:visited { color: inherit; } a#donation:hover { color: red; } -a:visited -{ - color: #7676FF; + +a:visited { + color: #792ea1; } -a:hover -{ - text-decoration:none; - color:red; + +a:hover { + text-decoration: none; + color: red; } + + /* Hier der Style für unsere Tabliste */ -#foki{ + +#foki { background-color: white; } -#foki a{ - color: grey; + +#foki a { + color: grey; } -#foki li.active a{ - color: black; - background-color: white; + +#foki li.active a { + color: black; + background-color: white; } -#foki li.active span + span{ - display:inline!important; + +#foki li.active span + span { + display: inline!important; } + /* Hier der Style für unseren Spruch */ -#spruch -{ - padding: 10px; - /* margin-top: 10px; */ - margin-bottom: 0; - padding-bottom: 10px; - padding-left: 65px; - color:green; - font-weight:bold; -} -#spenden{ - white-space:nowrap; - overflow:hidden; - text-overflow:ellipsis; -} -#spruch .author{ - font-size:80%; - font-weight:normal; - font-style:italic; - color:#333333; -} -#spruch > p -{ - margin-bottom:0; -} -#spruch > p + p -{ - margin-top:4px; + +#spruch { + padding: 10px; + /* margin-top: 10px; */ + margin-bottom: 0; + padding-bottom: 10px; + padding-left: 65px; + color: green; + font-weight: bold; +} + +#spenden { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +#spruch .author { + font-size: 80%; + font-weight: normal; + font-style: italic; + color: #333333; } +#spruch > p { + margin-bottom: 0; +} + +#spruch > p + p { + margin-top: 4px; +} + + /* Hier der Style für die einzelnen Ergebnisboxen */ -.result -{ - margin-bottom:20px; - /* padding:0 50px; */ - width:100% -} -.result > .number -{ - font-size: 15px; - line-height:1; - text-align: right; -} - -.result > .resultInformation -{ - border-radius: 5px; -} -.result .title -{ - color: black; - text-decoration: none; - font-size: 15px; - font-weight: bold; - margin-bottom:0; - white-space:nowrap; - line-height:1.1; - max-width:115ch; - overflow:hidden; - text-overflow:ellipsis; + +.result { + margin-bottom: 10px; + /* padding:0 50px; */ + width: 100% +} + +.result > .number { + font-size: 15px; + line-height: 1; + text-align: right; +} + +.result > .resultInformation { + border-radius: 5px; +} + +.result .title { + color: black; + text-decoration: none; + font-size: 15px; + font-weight: bold; + margin-bottom: 0; + white-space: nowrap; + line-height: 1.1; + max-width: 115ch; + overflow: hidden; + text-overflow: ellipsis; } .result.ad .title { color: green; } -.result .link -{ - font-size: 13px; - margin: 0; - line-height:1.5; + +.result .link { + font-size: 13px; + margin: 0; + line-height: 1.5; } -.result .link-link{ - white-space:nowrap; - max-width:60%; - overflow:hidden; - text-overflow:ellipsis; - float:left; + +.result .link-link { + white-space: nowrap; + max-width: 60%; + overflow: hidden; + text-overflow: ellipsis; + float: left; } -.result:not(.ad) .link > div{ - white-space:nowrap; + +.result:not(.ad) .link > div { + white-space: nowrap; } -.result:not(.ad) .link > span{ - white-space:nowrap; - margin: 0 5px; + +.result:not(.ad) .link > span { + white-space: nowrap; + margin: 0 5px; } -.result:not(.ad) .link .options{ - color: #333; - float:left; + +.result:not(.ad) .link .options { + color: #333; + float: left; } -.result:not(.ad) .link:hover{ - cursor:pointer; + +.result:not(.ad) .link:hover { + cursor: pointer; } -.result:not(.ad) .link .options > a{ - color: #333; - display:block; - padding-left:5px; - padding-right:5px; + +.result:not(.ad) .link .options > a { + color: #333; + display: block; + padding-left: 5px; + padding-right: 5px; } -.result:not(.ad) .link .options > a > span{ - font-size:10px; + +.result:not(.ad) .link .options > a > span { + font-size: 10px; } -.result .description -{ - margin-bottom: 3px; - color: black; - font-size: 14px; - line-height: 1.3; - clear: both; + +.result .description { + margin-bottom: 3px; + color: black; + font-size: 14px; + line-height: 1.3; + clear: both; +} + +.result .description p { + margin: 0; + margin-bottom: 4px; } .result .description img { - margin:5px; - margin-left:0; + margin: 5px; + margin-left: 0; + margin-right: 15px; + height: auto; + width: auto; + max-width: 120px; + max-height: 200px } .result.ad .description { color: green; - max-width: 115ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; + max-width: 115ch; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; } -.result:not(.ad) .hoster -{ - font-size: 13px; - margin: 0; - color:#777; - margin-right:10px; - white-space:nowrap; + +.result:not(.ad) .hoster { + font-size: 13px; + margin: 0; + color: #777; + margin-right: 10px; + white-space: nowrap; } -.result:not(.ad) .hoster a{ - color:#333; + +.result:not(.ad) .hoster a { + color: #333; } -.result .result-image > img{ - height:100px; - padding:10px; + +.result .result-image > img { + height: 100px; + padding: 10px; } -.result .proxy{ - font-size:13px; - margin-top:0; - white-space:nowrap; + +.result .proxy { + font-size: 13px; + margin-top: 0; + white-space: nowrap; } -.result .partnershop-info{ - font-size:13px; - margin-top:0; - margin-left:10px; + +.result .partnershop-info { + font-size: 13px; + margin-top: 0; + margin-left: 10px; } -.result .proxy img{ - margin-bottom:0px; - margin-right:2px + +.result .proxy img { + margin-bottom: 0px; + margin-right: 2px } .description-container { - margin:0!important; + margin: 0!important; } -.result .image > img{ - max-width: 100%; +.result .image > img { + max-width: 100%; } -.popover-content{ - /*padding-left: 0; +.popover-content { + /*padding-left: 0; padding-right:0;*/ } -.options-list > li{ -} +.options-list > li {} -.options-list > li:hover{ - background-color:lightgrey; +.options-list > li:hover { + background-color: lightgrey; } -.options-list > li > a{ - color: #333; - white-space:nowrap; - display:block; - padding:5px 14px; +.options-list > li > a { + color: #333; + white-space: nowrap; + display: block; + padding: 5px 14px; } -.options-list > li input[type=submit]{ - width:100%; - background-color:transparent; - border:0; - margin:5px 0; +.options-list > li input[type=submit] { + width: 100%; + background-color: transparent; + border: 0; + margin: 5px 0; } .container-fluid { - padding-top: 15px; - padding-bottom: 15px; - background-color: white; -} -#quicktips iframe{ - width:100%; - height: 1000px; - background-color: transparent; + padding-top: 15px; + padding-bottom: 15px; + background-color: white; +} + +#quicktips iframe { + width: 100%; + height: 1000px; + background-color: transparent; border: 0px none transparent; padding: 0px; overflow: hidden; } + + /* Hier der Style für die Bilder */ + #fit-width .masonry { - margin: 0 auto; + margin: 0 auto; } -.item{ - width: 150px; - text-align:center; - margin-bottom:10px; + +.item { + width: 150px; + text-align: center; + margin-bottom: 10px; } -#container{ - margin: 10px auto; + +#container { + margin: 10px auto; } + /* Hier der Style für die Werbeboxen */ -.result.ad{ -} -.result.ad .link a{ -} -.result.ad .description{ -} -.result.ad .hoster{ - color:green; + +.result.ad {} + +.result.ad .link a {} + +.result.ad .description {} + +.result.ad .hoster { + color: green; } + + /* Style für den Footer */ -footer{ - text-align: center; - + +footer { + text-align: center; } -footer a{ - color: black!important; +footer a { + color: black!important; } + /* Ein resetter für Floats */ -.clearfix{ - clear:both; + +.clearfix { + clear: both; } + + /* Placeholder für ladende Tabs */ -.loader{ - text-align:center; - margin-top:20px; + +.loader { + text-align: center; + margin-top: 20px; +} + +.loader > img { + width: 30px; } -.loader > img{ - width:30px; + +.pager { + text-align: center; +} + +#searchplugin { + display: none; + position: fixed; + top: 50px; + right: 10px; + z-index: 501; + width: 25%; +} + +#searchplugin > div { + text-align: center; + padding-top: 5px; +} + +#searchplugin > div > a { + color: white; } -.pager{ - text-align:center; +@media(min-width: 768px) { + #searchplugin { + display: initial; + } } \ No newline at end of file diff --git a/public/google5226881b42059cc5.html b/public/google5226881b42059cc5.html new file mode 100644 index 0000000000000000000000000000000000000000..63626713faa593e0f0c8a7a82e94a1b849ba5334 --- /dev/null +++ b/public/google5226881b42059cc5.html @@ -0,0 +1 @@ +google-site-verification: google5226881b42059cc5.html diff --git a/public/img/1px.png b/public/img/1px.png index 6518870e3b2876897e22a5308173cb650a402d0a..ac576dd6ed1835cca23135adfd86de7d23cb2a3e 100644 Binary files a/public/img/1px.png and b/public/img/1px.png differ diff --git a/public/img/Firefox.png b/public/img/Firefox.png new file mode 100644 index 0000000000000000000000000000000000000000..303fd099a0e74bec17b7ad6e7bd653c09c64a54c Binary files /dev/null and b/public/img/Firefox.png differ diff --git a/public/img/Firefox_Standard.png b/public/img/Firefox_Standard.png new file mode 100644 index 0000000000000000000000000000000000000000..84f5b35ff0998f9fb2c71569e3cd30ebca6b3e4b Binary files /dev/null and b/public/img/Firefox_Standard.png differ diff --git a/public/img/WeAcceptBitcoin.png b/public/img/WeAcceptBitcoin.png index 148d0c0b03036baff0544d0e3329b9560b1d0718..20e6e5a5875a45661bf227425bcffba1d9dce874 100644 Binary files a/public/img/WeAcceptBitcoin.png and b/public/img/WeAcceptBitcoin.png differ diff --git a/public/img/aufruf.png b/public/img/aufruf.png index fc0443ff91146f0368ba0265bf40e7a9d60e3649..a87230aa7e30300a09c5d97d7b454b280bb03ac6 100644 Binary files a/public/img/aufruf.png and b/public/img/aufruf.png differ diff --git a/public/img/boosticon.png b/public/img/boosticon.png index 80673ae096cc1b2a321eab8dcfbfd82df12ebf50..80d6a37c721b092cfdcce1bf523ba8795a61ab60 100644 Binary files a/public/img/boosticon.png and b/public/img/boosticon.png differ diff --git a/public/img/luh_metager.png b/public/img/luh_metager.png index 6001ddbde36c9e64c032bf1044a3f063fe46f4fa..45e124eb7cb0801e1b5cd87f7bfbe2810e885225 100644 Binary files a/public/img/luh_metager.png and b/public/img/luh_metager.png differ diff --git a/public/img/proxyicon.png b/public/img/proxyicon.png index 79eedcebc3fa2a67d46d2c4cf5352a0974823258..a63f9c3d54ecc1226ad7fadbb62917e2ddcf8ec7 100644 Binary files a/public/img/proxyicon.png and b/public/img/proxyicon.png differ diff --git a/public/img/suma_ev_logo-m1-greyscale.png b/public/img/suma_ev_logo-m1-greyscale.png index a3bc9ccc6f264328dd3af6bb7f99e2a0a708630d..3c87b13b02bbe36b0aa48a4bafcca70c5c706a7e 100644 Binary files a/public/img/suma_ev_logo-m1-greyscale.png and b/public/img/suma_ev_logo-m1-greyscale.png differ diff --git a/public/js/scriptResultPage.js b/public/js/scriptResultPage.js index bae64e8e5cedae5ab68f5bd28072716fe61d8ddf..aea1f8f11ef6625042aa70985f8bd3f70b16a360 100644 --- a/public/js/scriptResultPage.js +++ b/public/js/scriptResultPage.js @@ -33,6 +33,23 @@ function getDocumentReadyForUse(){ tabs(); theme(); fokiChanger(); + pluginInfo(); +} + +function pluginInfo() +{ + if(localStorage) + { + if(localStorage.getItem('pluginInfo') == "off") + $("#searchplugin").css("display", "none"); + $("#searchplugin").on('close.bs.alert', function() { + $.get('/pluginClose'); + localStorage.setItem('pluginInfo', 'off'); + }); + $("#searchplugin a.btn").click( function() { + $.get('/pluginInstall'); + }); + } } function theme(){ diff --git a/readme.md b/readme.md index 71413eb6d61a7452d6c8702118c02839caf60d09..329b21bdf82c38a2e222e0e0992c47ff4d99c239 100644 --- a/readme.md +++ b/readme.md @@ -1,22 +1,25 @@ # MetaGer -MetaGer ist eine datenschutzfreundliche und freie Meta-Suchmaschine. +[MetaGer](https://metager.de) ist seit 16.08.2016 Freie Software unter GNU AGPL v3, damit unser strikter Schutz Ihrer Daten und Ihrer Privatsphäre +öffentlich nachprüfbar ist, und damit Sie als Programmierer mithelfen können, alles noch besser zu machen. Weitere Hintergrundinfo dazu im +<a href="http://heise.de/-3295586" target="_blank">Heise-Newsticker</a>. ## Abhängigkeiten * composer (https://getcomposer.org/) * php7.0 * php7.0-mbstring * php7.0-dom + * php7.0-xml * sqlite3 * redis-server * Das Perl-Paket: Lingua::Identify (http://search.cpan.org/~ambs/Lingua-Identify-0.56/lib/Lingua/Identify.pm) ## MetaGer zu langsam? -Damit MetaGer so schnell wird, wie auf unserem Live-Server, erfordert es ein wenig Konfigurationsarbeit. Der Grund, warum die Version nach dem Checkout langsamer als normal ist, ist der, dass die eingestellten Suchmaschinen im Standard synchron abgefragt werden. -Das heißt, dass bei einer Suche mit 20 Suchmaschinen eine Suchmaschine nach der anderen abgefragt wird. -Die parallele abarbeitung kann mit Hilfe von Laravels Queue-System ( https://laravel.com/docs/5.2/queues ) hergestellt werden. +Damit MetaGer so schnell wird, wie auf unserem Live-Server, erfordert es ein wenig Konfigurationsarbeit. Der Grund, warum die Version nach dem Checkout langsamer als normal ist, ist der, dass die eingestellten Suchmaschinen im Standard seriell abgefragt werden. +Das heißt, dass bei einer Suche mit 20 Suchmaschinen eine Suchmaschine nach der anderen abgefragt wird. +Die parallele Abarbeitung kann mit Hilfe von Laravels Queue-System ( https://laravel.com/docs/5.2/queues ) hergestellt werden. Im Standard, ist in der Datei ".env" QUEUE_DRIVER=sync gesetzt. -Wir verwenden auf unseren Servern den QUEUE_DRIVER=redis und haben mit Hilfe von Supervisor ( https://laravel.com/docs/5.2/queues#supervisor-configuration ) eine Menge queue:worker Prozesse am laufen, die für eine parallele bearbeitung sorgen. +Wir verwenden auf unseren Servern den QUEUE_DRIVER=redis und haben mit Hilfe von Supervisor ( https://laravel.com/docs/5.2/queues#supervisor-configuration ) eine Menge queue:worker Prozesse am laufen, die für eine parallele Bearbeitung sorgen. ## Offizielle Dokumentation @@ -24,7 +27,7 @@ Die Dokumentation ist im Wiki des Gitlab-Projektes zu finden. ## Beiträge -Vielen Dank, dass du erwägst, zu MetaGer beizutragen! +Vielen Dank, dass Du erwägst, zu MetaGer beizutragen! Leider sind wir noch nicht bereit, Änderungen von außen aufzunehmen. Es steht dir jedoch frei, ein Ticket zu eröffnen. diff --git a/resources/lang/de/datenschutz.php b/resources/lang/de/datenschutz.php index 25a4c18f971c9b11e5a82d3f305e4926947eff6b..b2e15a2e59cd7c30524c87a1e928ee1d8454a925 100644 --- a/resources/lang/de/datenschutz.php +++ b/resources/lang/de/datenschutz.php @@ -1,33 +1,39 @@ <?php return [ - 'head' => 'Datenschutz und Privatsphäre', + 'head' => 'Datenschutz und Privatsphäre', - 'general.1' => 'Datenschutz und Privatsphäre gehören für uns zu den wichtigsten Gütern im Internet. Sie sind absolut schützenswert und dürfen keinesfalls kommerziell genutzt werden. Im Folgenden eine kurze Auflistung unserer Vorgehensweise. Eine ausführliche Darstellung mit Hintergrund-Informationen, warum wir die einzige wirklich sichere Suchmaschine betreiben, finden Sie', - 'general.2' => 'hier', + 'general.1' => 'Datenschutz und Privatsphäre gehören für uns zu den wichtigsten Gütern im Internet. Sie sind absolut schützenswert und dürfen keinesfalls kommerziell genutzt werden. Im Folgenden eine kurze Auflistung unserer Vorgehensweise. Eine ausführliche Darstellung mit Hintergrund-Informationen, warum wir die einzige wirklich sichere Suchmaschine betreiben, finden Sie', + 'general.2' => 'hier.', + 'general.3' => 'Nur Software, die frei und quellcode-offen ist, kann von jedem überprüft +werden. In allen anderen Fällen müssen User GLAUBEN, was Betreiber oder +"Gütesiegel"-Verkäufer behaupten. MetaGer ist Freie Software unter +unter GNU-AGPLv3 Lizenz (siehe dazu Nachricht im Heise-Ticker: +<a href="http://heise.de/-3295586" target="_blank">http://heise.de/-3295586</a>). Der MetaGer-Quellcode steht Ihnen unter folgendem Link zur Verfügung: +<a href="https://gitlab.metager3.de/open-source/MetaGer" target="_blank">https://gitlab.metager3.de/open-source/MetaGer</a><br />Sie müssen uns nichts glauben: SIE können es selber kontrollieren!', - 'policy.1' => 'Unsere Vorgehensweise/Policy:', - 'policy.2' => 'Wir speichern weder Ihre IP-Adresse, noch den', - 'policy.3' => '"Fingerabdruck" Ihres Browsers', - 'policy.4' => '(der Sie mit hoher Wahrscheinlichkeit ebenfalls eindeutig identifizieren könnte).', - 'policy.5' => 'Wir setzen keine Cookies oder benutzen Tracking-Pixel oder ähnliche Technologien, um unsere Nutzer zu "tracken" (tracken = Verfolgen der Bewegungen im Internet).', - 'policy.6' => 'Die Datenübertragung von MetaGer erfolgt ausschließlich automatisch verschlüsselt über das https-Protokoll.', - 'policy.7' => 'Wir bieten einen Zugang über das anonyme TOR-Netzwerk, den', - 'policy.8' => 'MetaGer-TOR-hidden Service.', - 'policy.9' => 'Da der Zugang über das TOR-Netzwerk vielen Nutzern kompliziert erscheint, manchmal auch langsam ist, haben wir einen weiteren Weg implementiert, auch die Ergebnis-Webseiten ebenfalls anonym erreichen zu können: durch Anklicken des Links "anonym öffnen". Dadurch sind Ihre persönlichen Daten beim Klick auf MetaGer-Ergebnisse und sogar bei allen Folge-Klicks danach geschützt.', - 'policy.10' => 'Wir machen möglichst wenig Werbung, kennzeichnen diese klar und eindeutig, und vertrauen für unsere Finanzierung auf unsere Nutzer, Ihre', - 'policy.11' => 'Spenden', - 'policy.12' => 'und Mitgliedsbeträge zum', - 'policy.13' => 'MetaGer wird von der deutschen gemeinnützigen Organisation', - 'policy.14' => 'in Zusammenarbeit mit der', - 'policy.15' => 'Leibniz Universität Hannover', - 'policy.16' => 'betrieben und weiterentwickelt.', - 'policy.17' => 'Unsere Server stehen ausschließlich in Deutschland. Sie unterliegen damit vollständig deutschem Datenschutzrecht, welches als das härteste der Welt gilt.', - 'policy.18' => 'Nach den', - 'policy.19' => 'Enthüllungen von Edward Snowden im Juni 2013', - 'policy.20' => 'positionierten sich etliche Suchmaschinen mit der Selbstbeschreibung, dass Suchen bei ihnen sicher sei, weil die IP-Adressen der Nutzer nicht gespeichert würden. So ehrenwert und auch ehrlich gemeint diese Selbstbeschreibungen sein mögen - Fakt ist, dass viele dieser Suchmaschinen zumindest einen Teil ihrer Server in den USA hosten. Das gilt auch für diejenigen, die von manchen Datenschützern immer noch als "besonders empfehlenswert" gelobt und als Empfehlung verbreitet werden. Denn diese Suchmaschinen', - 'policy.21' => 'unterliegen nach dem Patriot Act und US-Recht dem vollen Zugriff der dortigen Behörden.', - 'policy.22' => 'Sie können also gar keine geschützte Privatsphäre bieten (selbst dann nicht, wenn sie selber sich noch so sehr darum bemühen).', + 'policy.1' => 'Unsere Vorgehensweise/Policy:', + 'policy.2' => 'Wir speichern weder Ihre IP-Adresse, noch den', + 'policy.3' => '"Fingerabdruck" Ihres Browsers', + 'policy.4' => '(der Sie mit hoher Wahrscheinlichkeit ebenfalls eindeutig identifizieren könnte).', + 'policy.5' => 'Wir setzen keine Cookies oder benutzen Tracking-Pixel oder ähnliche Technologien, um unsere Nutzer zu "tracken" (tracken = Verfolgen der Bewegungen im Internet).', + 'policy.6' => 'Die Datenübertragung von MetaGer erfolgt ausschließlich automatisch verschlüsselt über das https-Protokoll.', + 'policy.7' => 'Wir bieten einen Zugang über das anonyme TOR-Netzwerk, den', + 'policy.8' => 'MetaGer-TOR-hidden Service.', + 'policy.9' => 'Da der Zugang über das TOR-Netzwerk vielen Nutzern kompliziert erscheint, manchmal auch langsam ist, haben wir einen weiteren Weg implementiert, auch die Ergebnis-Webseiten ebenfalls anonym erreichen zu können: durch Anklicken des Links "anonym öffnen". Dadurch sind Ihre persönlichen Daten beim Klick auf MetaGer-Ergebnisse und sogar bei allen Folge-Klicks danach geschützt.', + 'policy.10' => 'Wir machen möglichst wenig Werbung, kennzeichnen diese klar und eindeutig, und vertrauen für unsere Finanzierung auf unsere Nutzer, Ihre', + 'policy.11' => 'Spenden', + 'policy.12' => 'und Mitgliedsbeträge zum', + 'policy.13' => 'MetaGer wird von der deutschen gemeinnützigen Organisation', + 'policy.14' => 'in Zusammenarbeit mit der', + 'policy.15' => 'Leibniz Universität Hannover', + 'policy.16' => 'betrieben und weiterentwickelt.', + 'policy.17' => 'Unsere Server stehen ausschließlich in Deutschland. Sie unterliegen damit vollständig deutschem Datenschutzrecht, welches als das härteste der Welt gilt.', + 'policy.18' => 'Nach den', + 'policy.19' => 'Enthüllungen von Edward Snowden im Juni 2013', + 'policy.20' => 'positionierten sich etliche Suchmaschinen mit der Selbstbeschreibung, dass Suchen bei ihnen sicher sei, weil die IP-Adressen der Nutzer nicht gespeichert würden. So ehrenwert und auch ehrlich gemeint diese Selbstbeschreibungen sein mögen - Fakt ist, dass viele dieser Suchmaschinen zumindest einen Teil ihrer Server in den USA hosten. Das gilt auch für diejenigen, die von manchen Datenschützern immer noch als "besonders empfehlenswert" gelobt und als Empfehlung verbreitet werden. Denn diese Suchmaschinen', + 'policy.21' => 'unterliegen nach dem Patriot Act und US-Recht dem vollen Zugriff der dortigen Behörden.', + 'policy.22' => 'Sie können also gar keine geschützte Privatsphäre bieten (selbst dann nicht, wenn sie selber sich noch so sehr darum bemühen).', - 'twitter' => 'Was andere über unser Privacy-Konzept auf Twitter sagen:', -]; \ No newline at end of file + 'twitter' => 'Was andere über unser Privacy-Konzept auf Twitter sagen:', +]; diff --git a/resources/lang/de/index.php b/resources/lang/de/index.php index a2d6b3834c08a13bf5dc3bcbc8e06e6c3cfb6227..bb8b502a9161fbc075a30ff1df765c19f1e77e50 100644 --- a/resources/lang/de/index.php +++ b/resources/lang/de/index.php @@ -33,22 +33,14 @@ return [ 'plugin.head.3' => 'MetaGer zum Opera hinzufügen', 'plugin.head.4' => 'MetaGer zum Internet Explorer hinzufügen', 'plugin.head.5' => 'MetaGer zum Microsoft Edge hinzufügen', + 'plugin.head.info' => '(aktuelle Sucheinstellungen werden übernommen)', - 'plugin.firefox.1' => 'Klicken Sie ', - 'plugin.firefox.2' => 'hier', - 'plugin.firefox.3' => ', um MetaGer als Suchmaschine hinzuzufügen.', - 'plugin.firefox.4' => 'Setzen Sie einen Haken bei "Diese als aktuelle Suchmaschine setzen"', - 'plugin.firefox.5' => 'Klicken Sie auf "Hinzufügen"', + 'plugin.firefox.1' => 'Klicken Sie in Ihrem Browser oben rechts im Suchfeld auf die Lupe mit dem kleinen "+" und dann auf "MetaGer hinzufügen" (siehe Bild)', + 'plugin.firefox.2' => 'Klicken Sie nun mit der rechten Maustaste auf das neue MetaGer Logo in der Liste und auf "als Standard Suchmaschine verwenden" (siehe Bild)', - 'plugin.chrome.1' => 'Klicken Sie ', - 'plugin.chrome.2' => 'hier', - 'plugin.chrome.3' => ', um MetaGer als Suchmaschine hinzuzufügen', - 'plugin.chrome.4' => 'Klicken Sie im Popup auf OK', - 'plugin.chrome.5' => '(Sollte der OK-Knopf deaktiviert sein, ist MetaGer bereits in Ihren Suchmaschinen. Klicken Sie dann auf Abbrechen und fahren mit Schritt 2 fort.)', - 'plugin.chrome.6' => 'Klicken in Ihrem Browser oben rechts auf ', - 'plugin.chrome.7' => 'Wählen Sie "Einstellungen"', - 'plugin.chrome.8' => 'Im Bereich Suchen, klicken Sie auf "Suchmaschinen verwalten"', - 'plugin.chrome.9' => 'In der nun angezeigten Liste, finden Sie MetaGer. Fahren Sie mit der Maus über den Eintrag und klicken auf "Als Standard festlegen"', + 'plugin.chrome.1' => 'Klicken Sie in Ihrem Chrome oben rechts auf <span class="glyphicon glyphicon-option-vertical"></span> und im folgenden Menü auf "Einstellungen", um die Einstellungen Ihres Chromes zu öffnen.', + 'plugin.chrome.2' => 'Im Bereich "Suchen" klicken Sie auf Suchmaschinen verwalten...', + 'plugin.chrome.3' => 'In der nun angezeigten Liste, finden Sie den Eintrag "MetaGer". Fahren Sie mit der Maus über den Eintrag und klicken auf "Als Standard festlegen"', 'plugin.opera.1' => 'Klicken Sie ', 'plugin.opera.2' => 'hier', diff --git a/resources/lang/de/partnershops.php b/resources/lang/de/partnershops.php new file mode 100644 index 0000000000000000000000000000000000000000..b960d90d427f33c827cca97cd4b11c6b486bd5e3 --- /dev/null +++ b/resources/lang/de/partnershops.php @@ -0,0 +1,22 @@ +<?php + +return [ + 'heading1' => 'MetaGer-Partnershop', + 'absatz1' => 'Wenn in der MetaGer-Ergebnisliste Links erscheinen, bei denen das Wort +"Partnershop" steht, dann sind das zunächst normale Ergebnisse einer +MetaGer-Suche. Sie werden im Ranking nicht bevorzugt oder höher eingestuft, +sondern wie alle anderen Suchergebnisse auch behandelt. Bei der Anzeige +dieser Links werden - ebenso wie bei ALLEN MetaGer-Ergebnissen - auch keine +Nutzerdaten weitergegeben.', + 'absatz2' => 'Hinter diesem Link steht dann eine Firma, von der wir dann, wenn der Link +angeklickt wird, einen geringen Betrag zur Finanzierung von MetaGer +erhalten. Beim Ergebnis wird das zugehörige Firmenlogo angezeigt. Auch daran +erkennen Sie immer unsere Partnershops (ausgenommen hiervon sind Links auf Amazon über das Boost-Projekt). Beim Anlicken (und nur dann) eines solchen Ergebnisses werden +auch die Nutzerdaten an die Klickadresse weitergegeben - wie bei allen Links +aller Suchmaschinen. Wenn Sie dieses vermeiden wollen, dann können Sie bei +MetaGer aber auf "anonym öffnen" klicken. Sie müssen also auch dabei Ihre +Daten nicht weitergeben. Allerdings erhalten wir dann auch keinen Beitrag +zur Finanzierung von MetaGer. Wir bitten Sie dann um eine Spende, damit wir +MetaGer als unabhängige Alternative in einem gemeinnützigen Verein weiter +entwickeln und betreiben können: <a href="https://metager.de/spende">https://metager.de/spende</a>', +]; diff --git a/resources/lang/de/results.php b/resources/lang/de/results.php new file mode 100644 index 0000000000000000000000000000000000000000..803e2af5f5fd497b7839856662074c650bf86795 --- /dev/null +++ b/resources/lang/de/results.php @@ -0,0 +1,7 @@ +<?php + +return [ + 'redirect' => '(mit redirect)', + 'weiter' => 'Weitersuchen', + 'zurueck' => 'Zurück', +]; diff --git a/resources/lang/de/spenden.php b/resources/lang/de/spenden.php index 9552650ed55a9deeb6df93b319ddf4810890f312..15f445a9e5ccaccae119abf7d89137e90a9787d2 100644 --- a/resources/lang/de/spenden.php +++ b/resources/lang/de/spenden.php @@ -1,48 +1,55 @@ <?php return [ - 'headline.1' => 'Ihre Spende für SUMA-EV und MetaGer', - 'headline.2' => 'Helfen Sie mit, dass freie Suchmaschinen im Internet frei bleiben. Das digitale Wissen der Welt muss ohne Bevormundung durch Staaten oder Konzerne frei zugänglich sein und bleiben.', + 'headline.1' => 'Ihre Spende für SUMA-EV und MetaGer', + 'headline.2' => 'Helfen Sie mit, dass freie Suchmaschinen im Internet frei bleiben. Das digitale Wissen der Welt muss ohne Bevormundung durch Staaten oder Konzerne frei zugänglich sein und bleiben.', - 'bankinfo.1' => 'Durch eine Überweisung', - 'bankinfo.2' => 'SUMA-EV + 'bankinfo.1' => 'Durch eine Überweisung', + 'bankinfo.2' => 'SUMA-EV IBAN: DE64 4306 0967 4075 0332 01 BIC: GENODEM1GLS (Konto-Nr.: 4075 0332 01, BLZ: 43060967) GLS Gemeinschaftsbank, Bochum', - 'bankinfo.3' => 'Falls Sie eine Spendenbescheinigung wünschen, geben Sie auf dem Überweisungsformular bitte Ihre vollständige Adresse, und (sofern vorhanden) auch Ihre E-Mail Adresse an.', + 'bankinfo.3' => 'Falls Sie eine Spendenbescheinigung wünschen, geben Sie auf dem Überweisungsformular bitte Ihre vollständige Adresse, und (sofern vorhanden) auch Ihre E-Mail Adresse an.', - 'logos.1' => 'Bequem mit Paypal,<br>dort auch per Kreditkarte ohne Registrierung,', - 'logos.2' => 'oder per Bitcoin, <br>sicher und pseudonym.', + 'logos.1' => 'Bequem mit Paypal,<br>dort auch per Kreditkarte ohne Registrierung,', + 'logos.2' => 'oder per Bitcoin, <br>sicher und pseudonym.', - 'lastschrift.1' => 'Spenden mittels elektronischem Lastschriftverfahren:', - 'lastschrift.2' => 'Tragen Sie hier Ihre Kontodaten sowie den gewünschten Betrag ein. Wir buchen dann entsprechend von Ihrem Konto ab.', - 'lastschrift.3' => 'Bitte geben Sie Ihren Namen ein:', - 'lastschrift.3.placeholder' => 'Name', - 'lastschrift.4' => 'Ihre E-Mail Adresse:', - 'lastschrift.5' => 'Ihre Telefonnummer, um Ihre Spende ggf. durch einen Rückruf zu verifizieren:', - 'lastschrift.6' => 'Ihre IBAN oder Kontonummer:', - 'lastschrift.7' => 'Ihre BIC oder Bankleitzahl:', - 'lastschrift.8' => 'Hier können Sie uns formlos mitteilen, welchen Betrag Sie spenden möchten und ggf. noch eine Mitteilung dazu senden:', - 'lastschrift.8.placeholder' => 'Nachricht', - 'lastschrift.9' => 'Spenden', - 'lastschrift.10' => 'Ihre Daten werden über eine verschlüsselte Verbindung zu uns übertragen und können von Dritten nicht mitgelesen werden. Der Betrag, den Sie angegeben haben, wird dann durch uns von Ihrem Konto abgebucht. SUMA-EV verwendet Ihre Daten ausschließlich für die Spendenabrechnung; Ihre Daten werden nicht weitergegeben. Spenden an den SUMA-EV sind steuerlich absetzbar, da der Verein vom Finanzamt Hannover Nord als gemeinnützig anerkannt ist, eingetragen in das Vereinsregister beim Amtsgericht Hannover unter VR200033. Eine Bescheinigung für Einzelspenden oberhalb 200,-EUR wird automatisch zugesandt. Bei Spenden bis 200,-EUR genügt der Kontoauszug für die Absetzbarkeit beim Finanzamt.', + 'lastschrift.1' => 'Spenden mittels elektronischem Lastschriftverfahren:', + 'lastschrift.2' => 'Tragen Sie hier Ihre Kontodaten sowie den gewünschten Betrag ein. Wir buchen dann entsprechend von Ihrem Konto ab.', + 'lastschrift.3' => 'Bitte geben Sie Ihren Namen ein:', + 'lastschrift.3.placeholder' => 'Name', + 'lastschrift.4' => 'Ihre E-Mail Adresse:', + 'lastschrift.5' => 'Ihre Telefonnummer, um Ihre Spende ggf. durch einen Rückruf zu verifizieren:', + 'lastschrift.6' => 'Ihre IBAN oder Kontonummer:', + 'lastschrift.7' => 'Ihre BIC oder Bankleitzahl:', + 'lastschrift.8' => 'Hier können Sie uns formlos mitteilen, welchen Betrag Sie spenden möchten und ggf. noch eine Mitteilung dazu senden:', + 'lastschrift.8.placeholder' => 'Nachricht', + 'lastschrift.9' => 'Spenden', + 'lastschrift.10' => 'Ihre Daten werden über eine verschlüsselte Verbindung zu uns übertragen und können von Dritten nicht mitgelesen werden. Der Betrag, den Sie angegeben haben, wird dann durch uns von Ihrem Konto abgebucht. SUMA-EV verwendet Ihre Daten ausschließlich für die Spendenabrechnung; Ihre Daten werden nicht weitergegeben. Spenden an den SUMA-EV sind steuerlich absetzbar, da der Verein vom Finanzamt Hannover Nord als gemeinnützig anerkannt ist, eingetragen in das Vereinsregister beim Amtsgericht Hannover unter VR200033. Eine Bescheinigung für Einzelspenden oberhalb 200,-EUR wird automatisch zugesandt. Bei Spenden bis 200,-EUR genügt der Kontoauszug für die Absetzbarkeit beim Finanzamt.', - 'about.0' => 'Über uns', - 'about.1.1' => 'Die deutsche Suchmaschine MetaGer wird betrieben und stetig weiterentwickelt vom SUMA-EV - Verein für freien Wissenszugang. Wir sind ein gemeinnützig anerkannter Verein, eines unserer Ziele ist die Entwicklung und der Betrieb von Suchmaschinen. Wir erhalten keine öffentlichen Fördergelder und sind daher auf Ihre Spenden angewiesen. Wir haben unsere Werbung stark reduziert, denn wir vertrauen auf IHRE Unterstützung. + 'about.0' => 'Über uns', + 'about.1.1' => 'Die deutsche Suchmaschine MetaGer wird betrieben und stetig weiterentwickelt vom SUMA-EV - Verein für freien Wissenszugang. Wir sind ein gemeinnützig anerkannter Verein, eines unserer Ziele ist die Entwicklung und der Betrieb von Suchmaschinen. Wir erhalten keine öffentlichen Fördergelder und sind daher auf Ihre Spenden angewiesen. Wir haben unsere Werbung stark reduziert, denn wir vertrauen auf IHRE Unterstützung. Helfen Sie mit, dass freie Suchmaschinen im Internet erhalten bleiben und weiterentwickelt werden! Das können Sie mit einer Spende auf dieser Seite tun. Oder, wenn Sie freie Suchmaschinen auch langfristig sichern wollen:', - 'about.1.2' => 'Werden Sie Mitglied im SUMA-EV', - 'about.2.1' => 'Wenn Sie 50,-EUR oder mehr spenden, oder Mitglied im ', - 'about.2.2' => 'werden, dann können Sie, wenn Sie wollen, auf unserer', - 'about.2.3' => 'Mitglieder- und Sponsorenseite', - 'about.2.4' => 'namentlich mit Link auf Ihre Homepage (sofern vorhanden) genannt werden (wenn Sie dies wünschen, vermerken Sie es bitte in Ihrer Mitteilung)', - 'about.2.5' => 'Oder werden Sie SUMA-EV Förderer!', - 'about.3.1' => 'JEDE Form Ihrer Unterstützung', - 'about.3.2' => 'hilft mit, dass freie Suchmaschinen und freier Wissenszugang im Internet eine Chance haben. Zum freien Wissenszugang gehört es auch, dass Ihre Daten weder überwacht, noch Ihre Internet-Adressen und Verbindungsdaten gespeichert werden. Bei uns wird Ihre Internet-Adresse bereits während der Suche anonymisiert, sie wird nicht gespeichert und nicht an Dritte weitergegeben. Freie Internet-Suche ohne Überwachung:', - 'about.4.1' => 'Eine weitere Möglichkeit, MetaGer zu fördern, besteht darin, dass Sie Ihren nächsten Online-Einkauf bei MetaGer-Fördershops machen. Damit wir auf diesem Weg unterstützt werden können, haben wir uns in das Netzwerk zur Förderung gemeinnützig anerkannter Organisationen eingebracht, das Projekt', - 'about.4.2' => 'Unter dem Dach dieses Projektes sind ca. 400 Online-Shops (von Amazon bis Zooplus) vereint, die sich bereit erklärt haben, von allen Verkäufen etwa 6% an das Projekt zu spenden. Statt wie bisher direkt zum Online-Shop zu surfen, gehen Sie zunächst auf', - 'about.4.3' => 'und klicken dort unterhalb der Suchwort-Eingabebox auf', - 'about.4.4' => 'Machen Sie Ihre Einkäufe bei MetaGer-Fördershops - klicken Sie hier!', - 'about.4.5' => 'Dieser Klick führt Sie in die Shop-Auswahl des Boost-Projektes. Dort suchen Sie sich Ihren Shop aus und machen wie gewohnt Ihren Einkauf. Das ist alles. Wenn genug Menschen dies tun, dann brauchen wir keine Werbung mehr. Nur zwei Mausklicks für Sie - für alle eine Chance für den freien Wissenszugang in der digitalen Welt.' + 'about.1.2' => 'Werden Sie Mitglied im SUMA-EV', + 'about.2.1' => 'Wenn Sie 50,-EUR oder mehr spenden, oder Mitglied im ', + 'about.2.2' => 'werden, dann können Sie, wenn Sie wollen, auf unserer', + 'about.2.3' => 'Mitglieder- und Sponsorenseite', + 'about.2.4' => 'namentlich mit Link auf Ihre Homepage (sofern vorhanden) genannt werden (wenn Sie dies wünschen, vermerken Sie es bitte in Ihrer Mitteilung)', + 'about.2.5' => 'Oder werden Sie SUMA-EV Förderer!', + 'about.3.1' => 'JEDE Form Ihrer Unterstützung', + 'about.3.2' => 'hilft mit, dass freie Suchmaschinen und freier Wissenszugang im Internet eine Chance haben. Zum freien Wissenszugang gehört es auch, dass Ihre Daten weder überwacht, noch Ihre Internet-Adressen und Verbindungsdaten gespeichert werden. Bei uns wird Ihre Internet-Adresse bereits während der Suche anonymisiert, sie wird nicht gespeichert und nicht an Dritte weitergegeben. Freie Internet-Suche ohne Überwachung:', + 'about.4.1' => 'Eine weitere Möglichkeit, MetaGer zu fördern, besteht darin, dass Sie Ihren nächsten Online-Einkauf bei MetaGer-Fördershops machen. Damit wir auf diesem Weg unterstützt werden können, haben wir uns in das Netzwerk zur Förderung gemeinnützig anerkannter Organisationen eingebracht, das Projekt', + 'about.4.2' => 'Unter dem Dach dieses Projektes sind ca. 400 Online-Shops (von Amazon bis Zooplus) vereint, die sich bereit erklärt haben, von allen Verkäufen etwa 6% an das Projekt zu spenden. Statt wie bisher direkt zum Online-Shop zu surfen, gehen Sie zunächst auf', + 'about.4.3' => 'und klicken dort unterhalb der Suchwort-Eingabebox auf', + 'about.4.4' => 'Machen Sie Ihre Einkäufe bei MetaGer-Fördershops - klicken Sie hier!', + 'about.4.5' => 'Dieser Klick führt Sie in die Shop-Auswahl des Boost-Projektes. Dort suchen Sie sich Ihren Shop aus und machen wie gewohnt Ihren Einkauf. Das ist alles. Wenn genug Menschen dies tun, dann brauchen wir keine Werbung mehr. Nur zwei Mausklicks für Sie - für alle eine Chance für den freien Wissenszugang in der digitalen Welt.', + 'danke.title' => 'Herzlichen Dank!! Wir haben Ihre Spendenbenachrichtigung für MetaGer an SUMA-EV erhalten.', + 'danke.nachricht' => 'Falls Sie Kontaktdaten angegeben haben, erhalten Sie demnächst auch eine persönliche Nachricht.', + 'danke.kontrolle' => 'Folgende Nachricht hat uns erreicht:', + 'telefonnummer' => 'Telefonnummer', + 'iban' => 'IBAN/Kontonummer', + 'bic' => 'BIC/Bankleitzahl', + 'danke.message' => 'Ihre Nachricht', ]; diff --git a/resources/lang/de/staticPages.php b/resources/lang/de/staticPages.php index 2363a0d0f6315cfcd6fa27e65fb6d891d832085b..a25969b2a061d425e242f19393be549bb5a467d8 100644 --- a/resources/lang/de/staticPages.php +++ b/resources/lang/de/staticPages.php @@ -1,33 +1,34 @@ <?php return [ - 'nav1' => 'Suche', - 'nav2' => 'Spenden', - 'nav3' => 'Datenschutz', - 'nav20' => 'Hilfe', - 'nav21' => 'FAQ', - 'nav4' => 'Forum', - 'nav5' => 'Kontakt', - 'nav6' => 'Team', - 'nav7' => 'Ãœber uns', - 'nav8' => 'Impressum', - 'nav9' => 'Hilfe', - 'nav10' => 'Widget', - 'nav11' => 'Assoziator', - 'nav12' => 'Code-Suche', - 'nav13' => 'URL-Verkürzer', - 'nav14' => 'TOR-Hidden-Service', - 'nav15' => 'Dienste', - 'nav16' => 'Fördern', - 'nav17' => 'Einkaufen bei MetaGer-Fördershops', - 'nav18' => 'Kontakt', - 'nav19' => 'Sprache', + 'nav1' => 'Suche', + 'nav2' => 'Spenden', + 'nav3' => 'Datenschutz', + 'nav20' => 'Hilfe', + 'nav21' => 'FAQ', + 'nav4' => 'Forum', + 'nav5' => 'Kontakt', + 'nav6' => 'Team', + 'nav7' => 'Ãœber uns', + 'nav8' => 'Impressum', + 'nav9' => 'Hilfe', + 'nav10' => 'Widget', + 'nav11' => 'Assoziator', + 'nav12' => 'Code-Suche', + 'nav13' => 'URL-Verkürzer', + 'nav14' => 'TOR-Hidden-Service', + 'nav15' => 'Dienste', + 'nav16' => 'Fördern', + 'nav17' => 'Einkaufen bei MetaGer-Fördershops', + 'nav18' => 'Kontakt', + 'nav19' => 'Sprache', + 'nav22' => 'Zitatsuche', - 'navigationToggle' => 'Navigation anzeigen', - - 'sumaev.1' => 'MetaGer wird entwickelt und betrieben vom ', - 'sumaev.2' => 'SUMA-EV - Verein für freien Wissenszugang.', - 'meta.Description' => 'Sicher suchen und finden unter Wahrung der Privatsphäre. Das digitale Wissen der Welt muss ohne Bevormundung durch Staaten oder Konzerne frei zugänglich sein und bleiben.', - 'meta.Keywords' => 'Internetsuche, privatsphäre, privacy, Suchmaschine, Datenschutz, Anonproxy, anonym suchen, Bildersuche, Suchmaschine, anonym, MetaGer, metager, metager.de', - 'meta.language' => 'de' -]; \ No newline at end of file + 'navigationToggle' => 'Navigation anzeigen', + + 'sumaev.1' => 'MetaGer wird entwickelt und betrieben vom ', + 'sumaev.2' => 'SUMA-EV - Verein für freien Wissenszugang.', + 'meta.Description' => 'Sicher suchen und finden unter Wahrung der Privatsphäre. Das digitale Wissen der Welt muss ohne Bevormundung durch Staaten oder Konzerne frei zugänglich sein und bleiben.', + 'meta.Keywords' => 'Internetsuche, privatsphäre, privacy, Suchmaschine, Datenschutz, Anonproxy, anonym suchen, Bildersuche, Suchmaschine, anonym, MetaGer, metager, metager.de', + 'meta.language' => 'de', +]; diff --git a/resources/lang/de/titles.php b/resources/lang/de/titles.php index 967c7bf93bb612f21ef18c0a8b824bd64d362810..63a4e7530b2b5aeab51f330b9e82c8a60c56856c 100644 --- a/resources/lang/de/titles.php +++ b/resources/lang/de/titles.php @@ -15,4 +15,5 @@ return [ 'sitesearch' => 'Sitesearch-Widget - MetaGer', 'beitritt' => 'SUMA-EV Beitrittsformular', 'faq' => 'FAQ - MetaGer', + 'partnershops' => 'Partnershops - MetaGer', ]; \ No newline at end of file diff --git a/resources/lang/en/datenschutz.php b/resources/lang/en/datenschutz.php index d608f11ff7077f2e9d31b1468743f10503908984..6883d755dff9fee8c8605cda864bf2e9e866f179 100644 --- a/resources/lang/en/datenschutz.php +++ b/resources/lang/en/datenschutz.php @@ -1,33 +1,40 @@ <?php return [ - 'head' => 'Privacy', + 'head' => 'Privacy', - 'general.1' => 'For us, privacy is one of the most important goods on the internet. It needs to be preserved and is not to be used for profit. The following is a small summary of our approach. A more detailed description why we are the most secure search engine can be found', - 'general.2' => 'here', + 'general.1' => 'For us, privacy is one of the most important goods on the internet. It needs to be preserved and is not to be used for profit. The following is a small summary of our approach. A more detailed description why we are the most secure search engine can be found', + 'general.2' => 'here (in German).', + 'general.3' => 'Only free software with open source code is under control of any user. In +all other cases the users have to BELIEVE what the maintainers tell about +what is going on inside. If maintainers claim that they have strictly +implemented privacy and data protecion, you have to believe them. +MetaGer is free software under GNU-AGPLv3 Licence. It is available to +anyone at <a href="https://gitlab.metager3.de/open-source/MetaGer">https://gitlab.metager3.de/open-source/MetaGer</a>. You do not +have to believe us, YOU might control it yourself!', - 'policy.1' => 'Our Approach/Policy:', - 'policy.2' => 'Neither do we save your IP, nor the', - 'policy.3' => '"fingerprint" of your Browser', - 'policy.4' => '(Which most likely could identify you as well).', - 'policy.5' => 'We do not set cookies or use tracking-pixel or similar technology, to "track" our users (tracking = following a users digital movement on the internet).', - 'policy.6' => 'The data transmission from MetaGer is only done encrypted via the https protocol.', - 'policy.7' => 'We offer access via the anonymous TOR network, the', - 'policy.8' => 'MetaGer hidden service.', - 'policy.9' => 'Since the access via the TOR-network seems complicated to many users and sometimes is also slow, we offer a different way, to visit the result pages anonymously: By clicking on the link "open anonymously". Doing this your personal information will be protected on this click and even on all following clicks.', - 'policy.10' => 'We show as few advertisements as possible, clearly marking them, and financially rely on our users, their', - 'policy.11' => 'Donations', - 'policy.12' => 'and membership fees for', - 'policy.13' => 'Metager is operated and developed by the charitable german organisation', - 'policy.14' => 'in Ccooperation with the', - 'policy.15' => 'Leibniz University Hanover', - 'policy.16' => '.', - 'policy.17' => 'Our Servers are exclusively located in germany. Therefore they are governed by the german privacy law, which is among the strictest world wide.', - 'policy.18' => 'Since the', - 'policy.19' => 'revealments of Edward Snowden in June 2013', - 'policy.20' => 'numerous search engines claim that they protect theit users privacy, because the user\'s IP adress is not saved. No matter how honourable these descriptions are - fact is that many search engines at least partially host their servers in the USA. Because these search engines are,', - 'policy.21' => 'as per the Patriot Act and US law', - 'policy.22' => ', fully unprotected against the access of local authorities. Thus they cannot provide protection of personal data (even if they really try to).', + 'policy.1' => 'Our Approach/Policy:', + 'policy.2' => 'Neither do we save your IP, nor the', + 'policy.3' => '"fingerprint" of your Browser', + 'policy.4' => '(which most likely could identify you as well).', + 'policy.5' => 'We do not set cookies or use tracking-pixel or similar technology, to "track" our users (tracking = following a users digital movement on the internet).', + 'policy.6' => 'The data transmission from MetaGer is only done encrypted via the https protocol.', + 'policy.7' => 'We offer access via the anonymous TOR network, the', + 'policy.8' => 'MetaGer hidden service.', + 'policy.9' => 'Since the access via the TOR-network seems complicated to many users and sometimes is also slow, we offer a different way, to visit the result pages anonymously: By clicking on the link "open anonymously". Doing this your personal information will be protected on this click and even on all following clicks.', + 'policy.10' => 'We show as few advertisements as possible, clearly marking them, and financially rely on our users, their', + 'policy.11' => 'Donations', + 'policy.12' => 'and membership fees for', + 'policy.13' => 'Metager is operated and developed by the charitable german organisation', + 'policy.14' => 'in Ccooperation with the', + 'policy.15' => 'Leibniz University Hanover', + 'policy.16' => '.', + 'policy.17' => 'Our Servers are exclusively located in germany. Therefore they are governed by the german privacy law, which is among the strictest world wide.', + 'policy.18' => 'Since the', + 'policy.19' => 'revealments of Edward Snowden in June 2013', + 'policy.20' => 'numerous search engines claim that they protect theit users privacy, because the user\'s IP adress is not saved. No matter how honourable these descriptions are - fact is that many search engines at least partially host their servers in the USA. Because these search engines are,', + 'policy.21' => 'as per the Patriot Act and US law', + 'policy.22' => ', fully unprotected against the access of local authorities. Thus they cannot provide protection of personal data (even if they really try to).', - 'twitter' => 'What others say about our privacy-concept on twitter:', + 'twitter' => 'What others say about our privacy-concept on twitter:', ]; diff --git a/resources/lang/en/index.php b/resources/lang/en/index.php index 00f7294f6e94dd11e92d07f5608fcbe3b13c9880..2c2e24b8ed930b5834a2731293c10cce08f8a126 100644 --- a/resources/lang/en/index.php +++ b/resources/lang/en/index.php @@ -30,11 +30,8 @@ return [ 'plugin.head.4' => 'Add MetaGer to your Internet Explorer', 'plugin.head.5' => 'Add MetaGer to your Microsoft Edge', - 'plugin.firefox.1' => 'Click ', - 'plugin.firefox.2' => 'here', - 'plugin.firefox.3' => ', to add MetaGer as a search engine.', - 'plugin.firefox.4' => 'Please tick the box "Make this the current search engine"', - 'plugin.firefox.5' => 'Click on "Add"', + 'plugin.firefox.1' => 'Click on the magnifying glass with the small green "+" and then on "Add MetaGer.." (picture 1)', + 'plugin.firefox.2' => 'Now right click on the new MetaGer Logo in the List and select "Make MetaGer the default search engine" (picture2)', 'plugin.chrome.1' => 'Click ', 'plugin.chrome.2' => 'here', diff --git a/resources/lang/en/partnershops.php b/resources/lang/en/partnershops.php new file mode 100644 index 0000000000000000000000000000000000000000..7b8fedd2bcb862568070413b74393100b77f0fb5 --- /dev/null +++ b/resources/lang/en/partnershops.php @@ -0,0 +1,22 @@ +<?php + +return [ + 'heading1' => 'MetaGer-Partnershop', + 'absatz1' => 'If the MetaGer result list shows links which have the word "Partnershop" in +that line, these are at first normal search results. They are not ranked +higher or differently treated than all other search results of MetaGer. By +showing these links we do not transfer any of your data to third parties - +in the same way we do not transfer such data for ANY search.', + 'absatz2' => 'Behind such links are companies which will pay us with a small amount of +money if you click on that link. The result shows the company logo as well. +By that you additionally recognize our partnershops (except links to Amazon via the Boost-Project). If you click on such +link (and ONLY then) the user data will be given to the click address - in +the same way as done by clicking the result links of all search engines. If +you do not want that, then MetaGer optionally gives the possibility to click +on "anonym öffnen" (open anonymously). So you do not have to give your user +data to third parties. But in that case we do not receive a share to +finance MetaGer. We appeal for a donation in that case, so that we are able +to run and develope MetaGer as an independent alternative within a +non-commercial NGO: <a href="https://metager.de/en/spende">https://metager.de/en/spende</a>', +]; + diff --git a/resources/lang/en/results.php b/resources/lang/en/results.php new file mode 100644 index 0000000000000000000000000000000000000000..1e94a89e04451182ca1cc68fc14b5b05f476963d --- /dev/null +++ b/resources/lang/en/results.php @@ -0,0 +1,7 @@ +<?php + +return [ + 'redirect' => '(with redirect)', + 'weiter' => 'more', + 'zurueck' => 'back', +]; diff --git a/resources/lang/en/spenden.php b/resources/lang/en/spenden.php index 05aacfbe0908d09daf79f500391db3ff02b5a5d5..7d3223789b7bad9555491983da2bd0124102c327 100644 --- a/resources/lang/en/spenden.php +++ b/resources/lang/en/spenden.php @@ -1,50 +1,57 @@ <?php return [ - 'headline.1' => 'Your Donation for SUMA-EV and MetaGer', - 'headline.2' => 'Help us keep open search engines stay open on the internet. The digital knowledge of the world must stay free from state or concern paternalism and be publicly accessible.', - - 'bankinfo.1' => 'By bank transfer', - 'bankinfo.2' => 'SUMA-EV + 'headline.1' => 'Your Donation for MetaGer to SUMA-EV', + 'headline.2' => 'Please help to keep free and open search engines free and open on the Internet. The digital knowledge of the world must stay free from surveillance and control by governments or companies and must be publicly accessible to everyone.', + 'bankinfo.1' => 'By bank transfer', + 'bankinfo.2' => 'SUMA-EV IBAN: DE64 4306 0967 4075 0332 01 BIC: GENODEM1GLS (Account-No.: 4075 0332 01, Bank Code: 43060967) GLS Gemeinschaftsbank, Bochum', - 'bankinfo.3' => 'If you wish to receive a donation receipt, -please specify your full adress and (if available) + 'bankinfo.3' => 'If you wish to receive a donation receipt, +please specify your full adress and (if available) your E-Mail adress on the money transfer form.', - 'logos.1' => 'Comfortably with Paypal<br>Via Paypal by credit card too (without PayPal registration),', - 'logos.2' => 'or Bitcoins', + 'logos.1' => 'Comfortably with Paypal<br>Via Paypal by credit card too (without PayPal registration),', + 'logos.2' => 'or Bitcoins', - 'lastschrift.1' => 'Donate by wire transfer', - 'lastschrift.2' => 'Enter your account data along with the desired amount. We will debit your bank account accordingly.', - 'lastschrift.3' => 'Please enter your name:', - 'lastschrift.3.placeholder' => 'name', - 'lastschrift.4' => 'Your E-Mail adress:', - 'lastschrift.5' => 'Your phone number to verify your donation by callback:', - 'lastschrift.6' => 'Your IBAN or bank account number:', - 'lastschrift.7' => 'Your BIC or bank code:', - 'lastschrift.8' => 'Here you can informally tell us, what amount you want to donate monthly and perhaps send a message with it', - 'lastschrift.8.placeholder' => 'message', - 'lastschrift.9' => 'Donate', - 'lastschrift.10' => 'Your information is transmitted encrypted and is not read by a third party. The amount you enter will be debited from your account by us. SUMA-EV only uses your information for accounting; Your information is not passed on. Donations to the SUMA-EV are tax-deductible, because the association is recognized as charitable by the Finanzamt Hannover Nord (revenue board), listed in the register of associations, Amtsgericht Hannover under VR200033. A certificate for single donations above 200,-EUR is sent automatically. For donations below 200,-EUR an account current is enough for tax-deduction.', + 'lastschrift.1' => 'Donate by wire transfer', + 'lastschrift.2' => 'Enter your account data along with the desired amount. We will debit your bank account accordingly.', + 'lastschrift.3' => 'Please enter your name:', + 'lastschrift.3.placeholder' => 'name', + 'lastschrift.4' => 'Your E-Mail adress:', + 'lastschrift.5' => 'Your phone number to verify your donation by callback:', + 'lastschrift.6' => 'Your IBAN or bank account number:', + 'lastschrift.7' => 'Your BIC or bank code:', + 'lastschrift.8' => 'Here you can informally tell us, what amount you want to donate monthly and perhaps send a message with it', + 'lastschrift.8.placeholder' => 'message', + 'lastschrift.9' => 'Donate', + 'lastschrift.10' => 'Your information is transmitted encrypted and is not read by a third party. The amount you enter will be debited from your account by us. SUMA-EV only uses your information for accounting; Your information is not passed on. Donations to the SUMA-EV are tax-deductible, because the association is recognized as charitable by the Finanzamt Hannover Nord (revenue board), listed in the register of associations, Amtsgericht Hannover under VR200033. A certificate for single donations above 200,-EUR is sent automatically. For donations below 200,-EUR an account current is enough for tax-deduction.', - 'about.0' => 'About us', - 'about.1.1' => 'The german search engine MetaGer is operated and constantly refined by the SUMA-EV - Verein für freien Wissenszugang. We are a charitable association, one of our goals is the development and operation of search engines. We do not receive any public funds and therefore are relying on your donations. -Help us preserve and develop open search engines on the internet. -You can do this by donating on our website. Or if you want to help open search engines on the long run:', - 'about.1.2' => 'Become a SUMA-EV member', - 'about.2.1' => 'If you donate more than 50,-EUR or become a member of the', - 'about.2.2' => ', you get to namely appear on our', - 'about.2.3' => 'members and sponsors page', - 'about.2.4' => 'with your homepage (if avaylable). (If you want this, please tell us in your donation message.)', - 'about.2.5' => 'Or become SUMA-EV sponsor!', - 'about.3.1' => 'Every form of support', - 'about.3.2' => 'helps open search engines and open knowledge access to have a chance on the internet. Open Knowledge access also includes that neither your information is monitored, nor your internet adresses and connection data is collected. We anonymise your internet adress during search, it is not stored and not passed on. Open internet search without surveillance:', - 'about.4.1' => 'Another possibility to help MetaGer is to make your next online purchase at a MetaGer support shop. We became part of the', - 'about.4.2' => 'to be able to be helped this way. The project unites around 400 online shops (from Amazon to Zooplus), that all declared to donate around 6% of every sale. Instead of directly browsing the online shop, use this link next time: ', - 'about.4.3' => 'and click below the search term box on', - 'about.4.4' => 'Make your purchase at MetaGer support shops - click here!', - 'about.4.5' => 'This click brings you to the boost project shop selection. There you choose your shop and keep on shopping as usual. That is all. If enough people do this, we do not need ads anymore. Just two clicks for you - a chance for open knowledge access for the digital world.' -]; \ No newline at end of file + 'about.0' => 'About us', + 'about.1.1' => 'The German search engine MetaGer is operated and permanently refined by SUMA-EV - Verein für freien Wissenszugang. We are a charitable NGO and one of our goals is the development and operation of search engines. We do not receive any public funds and therefore are relying on your donations. +Please help to preserve and develop free and open search engines on the Internet. You can do this by donating on our website. +Or if you want to help open search engines on the long run:', + 'about.1.2' => 'Become a SUMA-EV member', + 'about.2.1' => 'If you donate more than 50,-EUR or become a member of the', + 'about.2.2' => ', you or your company might appear on our', + 'about.2.3' => 'members and sponsors page', + 'about.2.4' => 'linked to +your homepage (if available). If you want that, please tell us within your donation message.', + 'about.2.5' => 'Or become SUMA-EV sponsor!', + 'about.3.1' => 'Every form of support', + 'about.3.2' => 'helps open search engines and open knowledge access to have a chance on the Internet. Open Knowledge access also includes that neither your information is monitored, nor your Internet adresses and connection data is collected. We anonymise your Internet adress during search, it is not stored and not passed on. Open Internet search without surveillance:', + 'about.4.1' => 'Another possibility to help MetaGer is to make your next online purchase via a MetaGer support shop. We became part of the', + 'about.4.2' => 'to be able to be supported this way. The project unites around 700 online shops (from Amazon to Zooplus), that all declared to donate around 6% of every sale. Instead of directly browsing the online shop, use this link next time: ', + 'about.4.3' => 'and click below the search term box on', + 'about.4.4' => '"Purchase at affiliate shop" - click here!', + 'about.4.5' => 'This click brings you to the boost project shop selection. There you choose your shop and keep on shopping as usual. That is all. If enough people do this, we do not need ads anymore. Just two clicks for you - a chance for open knowledge access for the digital world.', + 'danke.title' => 'Thank you very much!! We received your donation message for MetaGer to SUMA-EV', + 'danke.nachricht' => 'If you submitted your contact data we will notify you personally soon.', + 'danke.kontrolle' => 'The following message has reached us:', + 'telefonnummer' => 'phone number', + 'iban' => 'IBAN/account number', + 'bic' => 'BIC/bank code', + 'danke.message' => 'Your message', +]; diff --git a/resources/lang/en/titles.php b/resources/lang/en/titles.php index 63c4525e54d977d4586fb3c2e25e43cf69074777..345ce591b115b0f68d6093f9bc053042ef9bdf1b 100644 --- a/resources/lang/en/titles.php +++ b/resources/lang/en/titles.php @@ -14,4 +14,5 @@ return [ 'websearch' => 'Websearch-Widget - MetaGer', 'sitesearch' => 'Sitesearch-Widget - MetaGer', 'faq' => 'FAQ - MetaGer', + 'partnershops' => 'Partnershops - MetaGer', ]; diff --git a/resources/lang/en/widget.php b/resources/lang/en/widget.php index 8f181521e82b2345fb509ab2a087d7bcfb5ff949..a24e1053f6b7d150b125ccc5b6cf077fa68df771 100644 --- a/resources/lang/en/widget.php +++ b/resources/lang/en/widget.php @@ -1,11 +1,11 @@ <?php return [ - 'head' => 'MetaGer Widget', + 'head' => 'MetaGer Widget', - 'body.1' => 'MetaGer for usage on your website. + 'body.1' => 'MetaGer for usage on your website. Please choose the scope of your widget:', - 'body.2' => 'Search the Web', - 'body.3' => 'Search one Domain', - 'body.4' => 'Please note: You must not use this widget, if you want to make the impression that MetaGer was your service or that your page was the real MetaGer page (which already happened). For this reason it is especially forbidden to use our logo.' + 'body.2' => 'Search the Web', + 'body.3' => 'Search one Domain', + 'body.4' => 'Please note: You must not use this widget, if your implementation suggests that MetaGer is your service or that your site is the real MetaGer homepage (all this has alreday happend). Therefore it is especially forbidden to remove our logo.', ]; diff --git a/resources/views/datenschutz.blade.php b/resources/views/datenschutz.blade.php index 80e12b17d824a10e8f49896a050ac6c74e70eebe..a31638df1f35871cf4c5f0bf64c273fcf3533f44 100644 --- a/resources/views/datenschutz.blade.php +++ b/resources/views/datenschutz.blade.php @@ -7,9 +7,10 @@ @section('content') <h1>{{ trans('datenschutz.head') }}</h1> <p>{{ trans('datenschutz.general.1') }} <a href="https://suma-ev.de/presse/Sicher-suchen-UND-finden-mit-MetaGer.html">{{ trans('datenschutz.general.2') }}</a></p> +<p>{!! trans('datenschutz.general.3') !!}</p> <h2>{{ trans('datenschutz.policy.1') }}</h2> <ul id="privacyList"> - <li>{{ trans('datenschutz.policy.2') }} + <li>{{ trans('datenschutz.policy.2') }} <a href="http://www.heise.de/security/meldung/Fingerprinting-Viele-Browser-sind-ohne-Cookies-identifizierbar-1982976.html" target="_blank">{{ trans('datenschutz.policy.3') }}</a> {{ trans('datenschutz.policy.4') }} </li> <li > @@ -38,4 +39,4 @@ <p>> 8.4.2014 stupidité pue @dummheitstinkt > wow, is this the MetaGer I used in the end 90s in internet cafes??? > "Anonymes Suchen und Finden mit MetaGer | heise"</p></pre> -@endsection \ No newline at end of file +@endsection diff --git a/resources/views/hilfe.blade.php b/resources/views/hilfe.blade.php index 0ba7bd0755857e14ac6e882bfd78720c97c3dd21..bc36da46a458581c99df4f697957240c7b4a1306 100644 --- a/resources/views/hilfe.blade.php +++ b/resources/views/hilfe.blade.php @@ -38,4 +38,4 @@ <ul> <li>Beispiel: die Suche nach <div class="well well-sm">großschreibung</div> liefert also genau die gleichen Ergebnisse wie <div class="well well-sm">GROßSCHREIBUNG</div></li> </ul> -@endsection \ No newline at end of file +@endsection diff --git a/resources/views/index.blade.php b/resources/views/index.blade.php index 3877443023a4355a6b2f5efe6b27556c6ed73b1f..5183eafb97459c37a006ad5560601274264b41bb 100644 --- a/resources/views/index.blade.php +++ b/resources/views/index.blade.php @@ -30,49 +30,82 @@ $(".seperator").addClass("hidden"); @endif </h4> + <p class="text-muted">{{ trans('index.plugin.head.info') }}</p> </div> <div class="modal-body"> @if ($browser === 'Firefox' || $browser === 'Mozilla') <ol> - <li>{{ trans('index.plugin.firefox.1') }}<a href="javascript:window.external.AddSearchProvider($('link[rel=search]').attr('href'))">{{ trans('index.plugin.firefox.2') }}</a>{{ trans('index.plugin.firefox.3') }}</li> - <li>{{ trans('index.plugin.firefox.4') }}</li> - <li>{{ trans('index.plugin.firefox.5') }}</li> + <li>{{ trans('index.plugin.firefox.1') }}<img src="/img/Firefox.png" width="100%" /></li> + <li>{{ trans('index.plugin.firefox.2') }}<img src="/img/Firefox_Standard.png" width="100%" /></li> + </ol> + <h4>MetaGer als Startseite im {{ $browser }} einrichten</h4> + <hr /> + <ol> + <li>Klicken Sie oben rechts im Browser auf <span class="glyphicon glyphicon-menu-hamburger"></span> und öffnen Sie die "Einstellungen"</li> + <li>Tragen Sie im Feld "Startseite" "https://metager.de" ein.</li> </ol> @elseif ($browser === 'Chrome') <ol> - <li>{{ trans('index.plugin.chrome.1') }}<a href="javascript:window.external.AddSearchProvider($('link[rel=search]').attr('href'))" onclick="$('#more').removeClass('hidden');">{{ trans('index.plugin.chrome.2') }}</a>{{ trans('index.plugin.chrome.3') }} - <ul id=\"more\" class=\"hidden list-unstyled\"> - <li>{{ trans('index.plugin.chrome.4') }}</li> - <li><small>{{ trans('index.plugin.chrome.5') }}</small></li> - </ul></li> - <li>{{ trans('index.plugin.chrome.6') }}<span class=\"glyphicon glyphicon-menu-hamburger\"></span></li> - <li>{{ trans('index.plugin.chrome.7') }}</li> - <li>{{ trans('index.plugin.chrome.8') }}</li> - <li>{{ trans('index.plugin.chrome.9') }}</li> + <li>{!! trans('index.plugin.chrome.1') !!}</li> + <li>{!! trans('index.plugin.chrome.2') !!}</li> + <li>{{ trans('index.plugin.chrome.3') }}</li> + </ol> + <h4>MetaGer als Startseite im {{ $browser }} einrichten</h4> + <hr /> + <ol> + <li>Klicken Sie oben rechts im Browser auf <span class="glyphicon glyphicon-option-vertical"></span> und öffnen Sie die "Einstellungen"</li> + <li>Im Bereich "Beim Start" wählen Sie "Bestimmte Seite oder Seiten öffnen und klicken anschließend auf "Seiten festlegen"</li> + <li>Tragen Sie "https://metager.de" als URL bei "Neue Seite hinzufügen ein"</li> + <li>Hinweis: Alle hier sichtbaren Webseiten werden nun beim Start des Browsers geöffnet. Sie können Einträge entfernen, indem Sie mit der Maus drüber fahren und rechts auf das "x" klicken.</li> </ol> @elseif ($browser === 'Opera') <ol> - <li>{{ trans('index.plugin.opera.1') }}<a href=\"/\" target=\"_blank\">{{ trans('index.plugin.opera.2') }}</a>{{ trans('index.plugin.opera.3') }}</li> + <li>{{ trans('index.plugin.opera.1') }}<a href="/" target="_blank">{{ trans('index.plugin.opera.2') }}</a>{{ trans('index.plugin.opera.3') }}</li> <li>{{ trans('index.plugin.opera.4') }}</li> <li>{{ trans('index.plugin.opera.5') }}</li> <li>{{ trans('index.plugin.opera.6') }}</li> - <li><small>{{ trans('index.plugin.opera.7') }}<a href=\"https://www.mozilla.org/de/firefox/new/\" target=\"_blank\">{{ trans('index.plugin.opera.8') }}</a>{{ trans('index.plugin.opera.9') }}</small> + <li><small>{{ trans('index.plugin.opera.7') }}<a href="https://www.mozilla.org/de/firefox/new/" target="_blank">{{ trans('index.plugin.opera.8') }}</a>{{ trans('index.plugin.opera.9') }}</small> + </ol> + <h4>MetaGer als Startseite im {{ $browser }} einrichten</h4> + <hr /> + <ol> + <li>Klicken Sie im Browser-Menü auf "Bearbeiten"->"Einstellungen"</li> + <li>Im Bereich "Beim Starten" wählen Sie "Eine bestimmte Seite, oder bestimmte Seiten öffnen +" und anschließend "Seiten festlegen"</li> + <li>Tragen Sie bei "Adresse eingeben" "https://metager.de" ein und bestätigen mit Enter</li> + <li>Klicken Sie auf "OK"</li> </ol> @elseif ($browser === 'IE') <ol> - <li>{{ trans('index.plugin.IE.1') }}<a href=\"javascript:window.external.addSearchProvider($('link[rel=search]').attr('href'));\">{{ trans('index.plugin.IE.2') }}</a>{{ trans('index.plugin.IE.3') }} - <li>{{ trans('index.plugin.IE.4') }}<span class=\"glyphicon glyphicon-cog\"></span>)</li> + <li>{{ trans('index.plugin.IE.1') }}<a href="javascript:window.external.addSearchProvider($('link[rel=search]').attr('href'));">{{ trans('index.plugin.IE.2') }}</a>{{ trans('index.plugin.IE.3') }} + <li>{{ trans('index.plugin.IE.4') }}<span class="glyphicon glyphicon-cog"></span>)</li> <li>{{ trans('index.plugin.IE.5') }}</li> <li>{{ trans('index.plugin.IE.6') }}</li> <li>{{ trans('index.plugin.IE.7') }}</li> </ol> + <h4>MetaGer als Startseite im {{ $browser }} einrichten</h4> + <hr /> + <ol> + <li>Klicken Sie oben rechts im Browser auf <span class="glyphicon glyphicon-cog"></span> und öffnen Sie die "Internetoptionen"</li> + <li>Falls MetaGer die einzige Startseite sein soll, markieren Sie im Textfeld den kompletten Text und ersetzen Ihn durch "https://metager.de"</li> + <li>Klicken Sie auf "OK"</li> + </ol> @elseif ($browser === 'Edge') <ol> - <li>{{ trans('index.plugin.edge.1') }}<span class=\"glyphicon glyphicon-option-horizontal\"></span>{{ trans('index.plugin.edge.2') }}</li> + <li>{{ trans('index.plugin.edge.1') }}<span class="glyphicon glyphicon-option-horizontal"></span>{{ trans('index.plugin.edge.2') }}</li> <li>{{ trans('index.plugin.edge.3') }}</li> <li>{{ trans('index.plugin.edge.4') }}</li> <li>{{ trans('index.plugin.edge.5') }}</li> </ol> + <h4>MetaGer als Startseite im {{ $browser }} einrichten</h4> + <hr /> + <ol> + <li>Klicken Sie oben rechts im Browser auf <span class="glyphicon glyphicon-option-horizontal"></span> und öffnen Sie die "Einstellungen"</li> + <li>Wählen Sie im Bereich "Öffnen mit" den Punkt "Bestimmte Seite(n)" aus</li> + <li>Im Dropdown-Menü darunter wählen Sie "Benutzerdefiniert" aus</li> + <li>Im Bereich darunter tragen Sie "https://metager.de" in das Feld "Webadresse eingeben" ein und klicken auf das "+" Symbol</li> + <li>Entfernen Sie alle Einträge, die beim Start nicht geöffnet werden sollen (z.B. about:start), indem Sie rechts auf das kleine "x" klicken.</li> + </ol> @endif </div> </div> diff --git a/resources/views/layouts/researchandtabs.blade.php b/resources/views/layouts/researchandtabs.blade.php index d1955939fca08c7b1e06300e22c8726d41634680..e8eee40cbe84958f98976b2e105f5bf8a0d56da9 100644 --- a/resources/views/layouts/researchandtabs.blade.php +++ b/resources/views/layouts/researchandtabs.blade.php @@ -21,7 +21,7 @@ </div> @foreach( $metager->request->all() as $key => $value) - @if($key !== "eingabe" && $key !== "page") + @if($key !== "eingabe" && $key !== "page" && $key !== "next") <input type='hidden' name='{{ $key }}' value='{{ $value }}' form='submitForm' /> @endif @endforeach @@ -31,7 +31,16 @@ </ul> </nav> </header> - + @if( strpos(rtrim(Request::header('REFERER'), '/'), LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), "/") ) === 0 && ( $browser === 'Firefox' || $browser === 'Mozilla' || $browser === 'Chrome' || $browser === 'IE' || $browser === 'Edge') ) + <div id="searchplugin" class="alert alert-warning alert-dismissible" role="alert" style=""> + <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button> + Wussten Sie, dass Ihr {{ $browser }} MetaGer als Standardsuchmaschine verwenden kann? + <br /> + <div style=""> + <a href="{{ action('StartpageController@loadStartPage', Request::all()) }}#plugin-modal" target="_blank" type="button" class="btn btn-info" style="">Zeig mir wie</a> + </div> + </div> + @endif <ul class="nav nav-tabs" id="foki" role="tablist"> @if( $metager->getFokus() === "web" ) <li id="webTabSelector" role="presentation" data-loaded="1" class="active"> diff --git a/resources/views/layouts/result.blade.php b/resources/views/layouts/result.blade.php index ed6c7c2490ccfd598a27d7b3fa7c27022177ad02..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 }} @@ -50,7 +51,7 @@ @if( isset($result->partnershop) && $result->partnershop === TRUE ) <span class="partnershop-info"> <img src="/img/boosticon.png" height="13" alt=""> - <a href="{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), "/spende") }}">Partnershop</a> + <a href="{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), "/partnershops") }}" target="_blank">Partnershop</a> </span> @endif <a class="proxy" onmouseover="$(this).popover('show');" onmouseout="$(this).popover('hide');" data-toggle="popover" data-placement="auto right" data-container="body" data-content="Der Link wird anonymisiert geöffnet. Ihre Daten werden nicht zum Zielserver übetragen. Möglicherweise funktionieren manche Webseiten nicht wie gewohnt." href="{{ $result->proxyLink }}" target="{{ $metager->getTab() }}"> @@ -58,10 +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"> - <img src="{{ $metager->getImageProxyLink($result->image) }}" align="left" width="120px" height="60px" alt="" /> - {{ $result->descr }} + <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 !!} </div> @else <div class="description">{{ $result->descr }}</div> diff --git a/resources/views/layouts/resultPage.blade.php b/resources/views/layouts/resultPage.blade.php index 11979c10b694127bb65d56d407a561ba15798498..42504d0cdc7c55c3e9890d865229ca0147925938 100644 --- a/resources/views/layouts/resultPage.blade.php +++ b/resources/views/layouts/resultPage.blade.php @@ -15,14 +15,15 @@ <meta content="{{ getmypid() }}" name="p" /> <meta content="{{ $eingabe }}" name="q" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <meta name="referrer" content="no-referrer" /> + <link rel="search" type="application/opensearchdescription+xml" title="MetaGer: Sicher suchen & finden, Privatsphäre schützen" href="{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), action('StartpageController@loadPlugin', ['params' => base64_encode(serialize(Request::all()))])) }}"> + </head> <body id="resultBody"> @if( !isset($suspendheader) ) @include('layouts.researchandtabs') @else <div class="tab-content container-fluid"> - @yield('results') + @yield('results') </div> @endif <footer> diff --git a/resources/views/layouts/staticPages.blade.php b/resources/views/layouts/staticPages.blade.php index 450a9b5ad2933e89eeb7ae19261bb3d33574ac9f..4706fe1502ad03b5c5af98bda076ac7ed3c99437 100644 --- a/resources/views/layouts/staticPages.blade.php +++ b/resources/views/layouts/staticPages.blade.php @@ -14,14 +14,21 @@ <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" /> <meta rel="icon" type="image/x-icon" href="/favicon.ico" /> <meta rel="shortcut icon" type="image/x-icon" href="/favicon.ico" /> - <link rel="search" type="application/opensearchdescription+xml" title="MetaGer: Sicher suchen & finden, Privatsphäre schützen" href="{{ action('StartpageController@loadPlugin', Request::all()) }}"> + <link rel="search" type="application/opensearchdescription+xml" title="MetaGer: Sicher suchen & finden, Privatsphäre schützen" href="{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), action('StartpageController@loadPlugin', ['params' => base64_encode(serialize(Request::all()))])) }}"> <link href="/css/bootstrap.css" rel="stylesheet" /> <link href="/css/style.css" rel="stylesheet" /> @if (isset($css)) - <link href="/css/{{ $css }}" rel="stylesheet" /> + @if(is_array($css)) + @foreach($css as $el) + <link href="/css/{{ $el }}" rel="stylesheet" /> + @endforeach + @else + <link href="/css/{{ $css }}" rel="stylesheet" /> + @endif @endif <link id="theme" href="/css/theme.css.php" rel="stylesheet" /> </head> + <body> <header> <nav class="navbar navbar-default"> @@ -35,6 +42,7 @@ </button> @yield('homeIcon') </div> + <div class="collapse navbar-collapse" id="navbar-collapse"> <ul class="nav navbar-nav navbar-right"> <li @if ( !isset($navbarFocus) || $navbarFocus === 'suche') class="active" @endif > @@ -72,12 +80,14 @@ <a class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">{{ trans('staticPages.nav15') }} <span class="caret"></span></a> <ul class="dropdown-menu"> + <li><a href="https://gitlab.metager3.de/open-source/MetaGer" target="_blank">MetaGer Quellcode</a></li> <li><a href="{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), "/hilfe/") }}">{{ trans('staticPages.nav9') }}</a></li> <li><a href="{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), "/widget/") }}">{{ trans('staticPages.nav10') }}</a></li> <li><a href="https://metager.de/klassik/asso/" target="_blank">{{ trans('staticPages.nav11') }}</a></li> <li><a href="http://code.metager.de/" target="_blank">{{ trans('staticPages.nav12') }}</a></li> <li><a href="https://metager.to/" target="_blank">{{ trans('staticPages.nav13') }}</a></li> <li><a href="http://forum.suma-ev.de/viewtopic.php?f=3&t=43" target="_blank">{{ trans('staticPages.nav14') }}</a></li> + <li><a href="https://metager.de/klassik/zitat-suche/" target="_blank">{{ trans('staticPages.nav22') }}</a></li> </ul> </li> <li class="dropdown"> @@ -96,9 +106,9 @@ </header> <div class="wrapper"> @if( App::isLocale('de') ) - <div class="mg-panel container" id="spendenaufruf" style="margin-bottom:-6%;max-height:126px;text-align:center;padding:0px;margin-top:0px"> + <div class="mg-panel container noprint" id="spendenaufruf" style="margin-bottom:-6%;max-height:50px;text-align:center;padding:0px;margin-top:0px"> <a href="{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), "/spendenaufruf") }}"> - <img src="/img/aufruf.png" style="max-width:100%;max-height:126px;"> + <img src="/img/aufruf.png" style="max-width:100%;max-height:50px;" alt="Spendenaufruf für die unabhängige, nicht-kommerzielle Internet-Suche" > </a> </div> @endif @@ -112,7 +122,7 @@ @yield('content') </main> @yield('optionalContent') - <footer> + <footer class="noprint"> <ul class="list-inline hidden-xs"> <li><a href="https://www.suma-ev.de/" target="_blank"> <img src="/img/suma_ev_logo-m1-greyscale.png" alt="SUMA-EV Logo"></a></li> @@ -133,6 +143,6 @@ @endforeach @endif <!--[if lte IE 8]><script type="text/javascript" src="/js/html5shiv.min.js"></script><![endif]--> - </div> + </div> </body> </html> diff --git a/resources/views/metager3.blade.php b/resources/views/metager3.blade.php index a6365fd7e3f0fd7c8606765f2478dee15cab9091..ad4a8454decc625bd7be54dc8c5eb2c16780bcb8 100644 --- a/resources/views/metager3.blade.php +++ b/resources/views/metager3.blade.php @@ -23,32 +23,28 @@ <div class="col-xs-12 col-md-8 resultContainer"> @else <div class="col-xs-12 col-md-12 resultContainer"> - @endif - @if( !$metager->validated && App::isLocale('de') ) - <div class="mg-panel container" style="margin-bottom:20px;max-height:90px;text-align:left; max-width:100%; padding:0px;margin-top:0px"> - <a href="{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), "/spendenaufruf") }}" target="_blank"> - <img src="/img/aufruf.png" style="max-width:100%;max-height:90px;"> - </a> - </div> @endif {{-- 3-Mal Werbung --}} @for($i = 0; $i <= 2; $i++) @include('layouts.ad', ['ad' => $metager->popAd()]) @endfor - @foreach($metager->getResults()->items() as $result) + @foreach($metager->getResults() as $result) @if($result->number % 7 === 0) @include('layouts.ad', ['ad' => $metager->popAd()]) @endif @include('layouts.result', ['result' => $result]) @endforeach - <nav class="pager"> - {!! $metager->getResults()->links() !!} + <nav aria-label="..."> + <ul class="pager"> + <li @if($metager->getPage() === 1) class="disabled" @endif><a href="@if($metager->getPage() === 1) # @else javascript:history.back() @endif">{{ trans('results.zurueck') }}</a></li> + <li @if($metager->nextSearchLink() === "#") class="disabled" @endif><a href="{{ $metager->nextSearchLink() }}">{{ trans('results.weiter') }}</a></li> + </ul> </nav> </div> + @if( $metager->showQuicktips() ) <div class="hidden-xs col-md-4" id="quicktips"> <iframe class="col-mod-4 hidden-xs hidden-sm" src="/qt?q={{ $metager->getQ() }}&sprueche={{ $metager->getSprueche() }}"></iframe> </div> @endif @endsection - diff --git a/resources/views/metager3bilder.blade.php b/resources/views/metager3bilder.blade.php index 1dca860f0aab71572cc73d4502117bc43768b430..de8db6555611a30b20c8b817979d55b482d554b4 100644 --- a/resources/views/metager3bilder.blade.php +++ b/resources/views/metager3bilder.blade.php @@ -19,25 +19,20 @@ </ul> </div> @endif - @if( !$metager->validated && App::isLocale('de') ) - <div class="mg-panel container" id="spendenaufruf" style="margin-bottom:20px;max-height:126px;max-width:100%;text-align:center;padding:0px;margin-top:0px"> - <a href="{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), "/spendenaufruf") }}"> - <img src="/img/aufruf.png" style="max-width:100%;max-height:126px;"> - </a> - </div> - @endif <div id="container"> - @foreach($metager->getResults()->items() as $result) + @foreach($metager->getResults() as $result) <div class="item"> <div class="img"> - <a href="{{ $result->link }}" target="{{ $metager->getTab() }}"><img src="{{ $metager->getImageProxyLink($result->image) }}" width="150px" alt="Bild nicht gefunden"/></a> + <a href="{{ $result->link }}" target="{{ $metager->getTab() }}"><img src="{{ $metager->getImageProxyLink($result->image) }}" width="150px" alt=""/></a> <span class="label label-default">{{ strip_tags($result->gefVon) }}</span> </div> </div> @endforeach </div> - <nav class="pager"> - {!! $metager->getResults()->links() !!} + <nav aria-label="..."> + <ul class="pager"> + <li @if($metager->getPage() === 1) class="disabled" @endif><a href="@if($metager->getPage() === 1) # @else javascript:history.back() @endif">{{ trans('results.zurueck') }}</a></li> + <li @if($metager->nextSearchLink() === "#") class="disabled" @endif><a href="{{ $metager->nextSearchLink() }}">{{ trans('results.weiter') }}</a></li> + </ul> </nav> @endsection - diff --git a/resources/views/metager3bilderresults.blade.php b/resources/views/metager3bilderresults.blade.php index a299a042d3f2953a69a40079e532365f75c977c4..0960e6dd75bb8f804a55df9ca38b83789e01cc2a 100644 --- a/resources/views/metager3bilderresults.blade.php +++ b/resources/views/metager3bilderresults.blade.php @@ -16,15 +16,8 @@ </ul> </div> @endif -@if( !$metager->validated && App::isLocale('de') ) - <div class="mg-panel container" id="spendenaufruf" style="margin-bottom:20px;max-height:126px;max-width:100%;text-align:center;padding:0px;margin-top:0px"> - <a href="{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), "/spendenaufruf") }}"> - <img src="/img/aufruf.png" style="max-width:100%;max-height:126px;"> - </a> - </div> - @endif <div id="container"> - @foreach($metager->getResults()->items() as $result) + @foreach($metager->getResults() as $result) <div class="item"> <div class="img"> <a href="{{ $result->link }}" target="{{ $metager->getTab() }}"><img src="{{ $metager->getImageProxyLink($result->image) }}" width="150px" alt=""/></a> @@ -33,6 +26,9 @@ </div> @endforeach </div> -<nav class="pager"> - {!! $metager->getResults()->links() !!} -</nav> +<nav aria-label="..."> + <ul class="pager"> + <li @if($metager->getPage() === 1) class="disabled" @endif><a href="@if($metager->getPage() === 1) # @else javascript:history.back() @endif">{{ trans('results.zurueck') }}</a></li> + <li @if($metager->nextSearchLink() === "#") class="disabled" @endif><a href="{{ $metager->nextSearchLink() }}">{{ trans('results.weiter') }}</a></li> + </ul> + </nav> diff --git a/resources/views/metager3results.blade.php b/resources/views/metager3results.blade.php index 1e8039ed34d0cd65a6cd8e674809e57f205b430c..0e6e8953011f70ba40b9de4d0104546814a28d52 100644 --- a/resources/views/metager3results.blade.php +++ b/resources/views/metager3results.blade.php @@ -17,28 +17,23 @@ </div> @endif <div class="col-xs-12 col-md-8"> - @if( !$metager->validated && App::isLocale('de') ) - <div class="mg-panel container" style="margin-bottom:20px;max-height:90px;text-align:left; max-width:100%; padding:0px;margin-top:0px"> - <a href="{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), "/spendenaufruf") }}" target="_blank"> - <img src="/img/aufruf.png" style="max-width:100%;max-height:90px;"> - </a> - </div> - @endif {{-- 3-Mal Werbung --}} @for($i = 0; $i <= 2; $i++) @include('layouts.ad', ['ad' => $metager->popAd()]) @endfor - @foreach($metager->getResults()->items() as $result) + @foreach($metager->getResults() as $result) @if($result->number % 7 === 0) @include('layouts.ad', ['ad' => $metager->popAd()]) @endif @include('layouts.result', ['result' => $result]) @endforeach - <nav class="pager"> - {!! $metager->getResults()->links() !!} + <nav aria-label="..."> + <ul class="pager"> + <li @if($metager->getPage() === 1) class="disabled" @endif><a href="@if($metager->getPage() === 1) # @else javascript:history.back() @endif">{{ trans('results.zurueck') }}</a></li> + <li @if($metager->nextSearchLink() === "#") class="disabled" @endif><a href="{{ $metager->nextSearchLink() }}">{{ trans('results.weiter') }}</a></li> + </ul> </nav> </div> <div class="hidden-xs col-md-4" id="quicktips"> <iframe class="col-mod-4 hidden-xs hidden-sm" src="/qt?q={{ $metager->getQ() }}&sprueche={{ $metager->getSprueche() }}"></iframe> </div> - diff --git a/resources/views/plugin.blade.php b/resources/views/plugin.blade.php index 197e4f232aa27ad5091b13a8ae7ac030de4bb1c5..f4095e76d31713daed9c0a7d43d21f736692afc3 100644 --- a/resources/views/plugin.blade.php +++ b/resources/views/plugin.blade.php @@ -4,6 +4,6 @@ <Description>MetaGer: Sicher suchen & finden, Privatsphäre schützen</Description> <Contact>office@suma-ev.de</Contact> <Image width="16" height="16" type="image/x-icon">{{ url('/favicon.ico') }}</Image> - <Url type="text/html" template="{{ $link }}{searchTerms}" method="get"></Url> + <Url type="text/html" template="{{ $link }}&eingabe={searchTerms}" method="get"></Url> <InputEncoding>UTF-8</InputEncoding> </OpenSearchDescription> \ No newline at end of file diff --git a/resources/views/quicktip.blade.php b/resources/views/quicktip.blade.php index 06ce78ae37cee9637be8051f0e61f1b4379af1be..d0ff0842582a5e316d12836b82ea397d8c05f643 100644 --- a/resources/views/quicktip.blade.php +++ b/resources/views/quicktip.blade.php @@ -4,7 +4,12 @@ <link rel="stylesheet" type="text/css" href="/css/bootstrap.css" /> <link rel="stylesheet" type="text/css" href="/css/quicktips.css" /> </head> - <body> + <body> + <div class="mg-panel container" style="margin-bottom:20px;max-height:90px;text-align:left; max-width:100%; padding:0px;margin-top:0px"> + <a href="{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), "/spendenaufruf") }}" target="_blank"> + <img src="/img/aufruf.png" style="max-width:100%;max-height:90px;" alt="Spendenaufruf für die unabhängige, nicht-kommerzielle Internet-Suche" > + </a> + </div> @if( $spruch !== "" ) <blockquote id="spruch">{!! $spruch !!}</blockquote> @endif diff --git a/resources/views/spende/danke.blade.php b/resources/views/spende/danke.blade.php new file mode 100644 index 0000000000000000000000000000000000000000..09b8347f8356b12f3106d352a2407940991577d3 --- /dev/null +++ b/resources/views/spende/danke.blade.php @@ -0,0 +1,53 @@ +@extends('layouts.subPages') + +@section('title', $title ) + +@section('navbarFocus.donate', 'class="dropdown active"') + +@section('content') +<h1>{{ trans('spenden.danke.title') }}</h1> +<div class="col"> + <div id="left" class="col-lg-6 col-md-12 col-sm-12 others"> + <p style="width:100%;" class="text-muted">{{ trans('spenden.danke.nachricht') }}</p> + <h2>{{ trans('spenden.danke.kontrolle') }}</h2> + <div> + <table class="table table-condensed"> + <tr> + <td>{{ trans('spenden.lastschrift.3.placeholder')}}</td> + <td>{{ $data['name'] }}</td> + </tr> + <tr> + <td>{{ trans('spenden.telefonnummer') }}</td> + <td>{{ $data['telefon'] }}</td> + </tr> + <tr> + <td>Email</td> + <td>{{ $data['email'] }}</td> + </tr> + <tr> + <td>{{ trans('spenden.iban') }}</td> + <td>{{ $data['kontonummer'] }}</td> + </tr> + <tr> + <td>{{ trans('spenden.bic') }}</td> + <td>{{ $data['bankleitzahl'] }}</td> + </tr> + <tr> + <td>{{ trans('spenden.danke.message') }}</td> + <td>{{ $data['nachricht'] }}</td> + </tr> + </table> + </div> + <button type="button" class="btn btn-primary noprint" onclick="window.print();">Drucken</button> + </div> + <div class="col-lg-6 col-md-12 col-sm-12 others noprint" id="right"> + <h2>{{ trans('spenden.about.0') }}</h2> + <p>{{ trans('spenden.about.1.1') }} + <a href="https://metager.de/klassik/bform1.htm" target="_blank">{{ trans('spenden.about.1.2') }}</a></p> + <p>{{ trans('spenden.about.2.1') }} <a href="http://suma-ev.de/" target="_blank">SUMA-EV</a> {{ trans('spenden.about.2.2') }} <a href="http://suma-ev.de/suma-links/index.html#sponsors" target="_blank">{{ trans('spenden.about.2.3') }}</a> {{ trans('spenden.about.2.4') }} <a href="https://metager.de/klassik/spenden1.html" target="_blank">{{ trans('spenden.about.2.5') }}</a></p> + <p><a href="http://suma-ev.de/unterstuetzung/index.html" target="_blank">{{ trans('spenden.about.3.1') }}</a> {{ trans('spenden.about.3.2') }} <a href="https://metager.de/" target="_blank">MetaGer.de!</a></p> + <p>{{ trans('spenden.about.4.1') }} <a href="https://www.boost-project.com/de" target="_blank">www.boost-project.com</a> {{ trans('spenden.about.4.2') }} <a href="https://metager.de/" target="_blank">MetaGer.de!</a> {{ trans('spenden.about.4.3') }} <a href="https://www.boost-project.com/de/shops?charity_id=1129&tag=bl" target="_blank">{{ trans('spenden.about.4.4') }}</a> {{ trans('spenden.about.4.5') }}</p> + </div> + <div class="clearfix"></div> +</div> +@endsection diff --git a/resources/views/spende/partnershops.blade.php b/resources/views/spende/partnershops.blade.php new file mode 100644 index 0000000000000000000000000000000000000000..1aa08bc6f35348dc1f9cc68ef58cb4ee353d16b1 --- /dev/null +++ b/resources/views/spende/partnershops.blade.php @@ -0,0 +1,11 @@ +@extends('layouts.subPages') + +@section('title', $title ) + +@section('navbarFocus.datenschutz', 'class="active"') + +@section('content') +<h1>{{ trans('partnershops.heading1') }}</h1> +<p>{{ trans('partnershops.absatz1') }}</p> +<p>{!! trans('partnershops.absatz2') !!}</p> +@endsection \ No newline at end of file diff --git a/resources/views/spende/spendenaufruf.blade.php b/resources/views/spende/spendenaufruf.blade.php index 87668759c82ef7967926e495a843ba6f645e964e..842f19d49f9c36ee07fe4b0195eb6143795de792 100644 --- a/resources/views/spende/spendenaufruf.blade.php +++ b/resources/views/spende/spendenaufruf.blade.php @@ -5,58 +5,53 @@ @section('navbarFocus.donate', 'class="dropdown active"') @section('content') -<h1>Mit Ihnen zusammen: Für die unabhängige, nicht-kommerzielle Internet-Suche</a></h1> -<p><a href="{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), "/spende") }}">{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), "/spende") }}</a></p> -<p>Mit Ihnen zusammen haben wir in den vergangenen Monaten eine neue -Erfolgsstory geschrieben: die Zahl der MetaGer-Nutzer steigt weiter und -stetig. Es ist kein Strohfeuer kurzfristigen Erfolges, sondern es ist die -Stetigkeit dieser Steigerung, die unseren Erfolg begründet. In drei Jahren -haben wir unsere Abfragezahlen verdreifacht. Wir sind nach Expertenmeinung -die sicherste Suchmaschine der Welt. Unsere Suchergebnisse sind zielgenau -und treffsicher. Beides verdanken wir der Tatsache, dass wir Programmierer -fest anstellen konnten. Aber auch Programmierer können nicht allein von der -Liebe zur Sache leben: Nur dank Ihrer Spendenbereitschaft konnten wir das -finanziell stemmen.</p> +<h1>MetaGer sagt: <i>Danke!</i></a></h1> <p> -Wir mussten auch einen Prozess gegen die Ausuferung des "Rechts auf -Vergessen" (nach dem EuGH Urteil vom 13.5.2014) durchstehen, um weiterhin -einen unzensierten Betrieb von Suchmaschinen zu ermöglichen -(<a href="http://suma-ev.de/presse/Suchmaschine-MetaGer-totgeklagt.html" target="_blank">http://suma-ev.de/presse/Suchmaschine-MetaGer-totgeklagt.html</a>). Wir haben -in allen Instanzen gewonnen. Anschließend jedoch hat die Klägerin sich für -zahlungsunfähig erklärt. Wir werden wohl auf den Kosten sitzenbleiben, was -unsere Finanzen weiter belastet. -</p> -<h3> -Um unsere gemeinsamen Erfolge fortzuschreiben, benötigen wir jetzt wieder -Ihre Hilfe. -</h3> -<p><a href="{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), "/spende") }}">{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), "/spende") }}</a></p> +Liebe hilfsbereite Menschen und metager-ische Freunde, wir hätten uns nie +vorstellen können, dass es um MetaGer so eine wundervolle Community gibt: +Die Spendenbereitsschaft ist oberhalb dessen, was wir uns bisher vorstellen +konnten. Sogar aus Ãœbersee haben uns Spenden und Hilfsangebote erreicht. <p> -Eine Internet-Suchmaschine muss stetig weiterentwickelt werden, -wenn sie nicht binnen kurzem veraltet sein soll. Unsere Werbeeinnahmen sind -stark gesunken. Eigentlich wollen wir in MetaGer auch gar keine Werbung. -Aber solange das Spendenaufkommen nicht reicht, können wir darauf noch nicht -verzichten. -</p> +Wir danken ganz herzlich allen, die für MetaGer gespendet haben! Wir haben +uns vorher nicht vorstellen können, dass die Resonanz auf unseren +Spendenaufruf so toll ist. SIE haben es damit auch möglich gemacht, dass +wir MetaGer jetzt international als freie Software in der Open-Source +Community implementieren konnten. MetaGer gibt es nun in Englisch und +demnächst dank der Hilfe eines engagierten Auslandsdeutschen auch in +Spanisch. SIE alle haben damit den Betrieb und die Weiterentwicklung von +MetaGer für die nächste Zeit gesichert. <p> -Wir bitten um Ihre Hilfe, damit wir MetaGer als unabhängige Alternative in -einem gemeinnützigen Verein weiter entwickeln und betreiben können. -Große Teile des Internet versinken im Kommerz und Werbemüll. -</p> +Wenn Sie darüber hinaus an MetaGer mitarbeiten und auch programmieren +möchten: Sie finden den Einstieg dazu und den Quellcode unter +https://gitlab.metager3.de/open-source/MetaGer (Hintergrundinfo dazu im +Heise-Ticker unter http://heise.de/-3295586) - wir freuen uns auf die +Zusammenarbeit mit Ihnen! <p> -Lassen Sie uns gemeinsam ein Zeichen gegen die zunehmende Kommerzialisierung -des Internet setzen! Der Betreiberverein von MetaGer, der SUMA-EV, ist als -gemeinnütziger Verein seit 2004 in das Register beim Amtsgericht Hannover -unter VR200033 eingetragen. -</p> +Am 18. Juli 2016 um 15.26 Uhr hatte der SUMA-EV als Betreiber von metager.de +den Spendenaufruf auf der MetaGer-Website gestartet. Keine zwei Minuten +später gingen die ersten Spenden ein. Und das ging bis heute so weiter - +es ist unglaublich toll zu erleben, wie unsere Nutzer die unabhängige und +nicht-kommerzielle Internet-Suche mit MetaGer unterstützen! Sowohl mit +Spenden als auch mit motivierenden Worten. +<p> +Wir DANKEN! Und wir beenden den Spendenaufruf heute. Die Finanzierung +unserer freien und unabhängigen Internetsuche ist nun für die nächste Zeit +gesichert. <p> -Bitte unterstützen Sie uns, damit die unabhängige, nicht-kommerzielle Suche -im Internet weiter entwickelt und betrieben werden kann: -<br /> -<a href="{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), "/spende") }}">{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), "/spende") }}</a> +<b>Wir wissen jetzt, dass wir uns auf unsere User verlassen können. Das +ist ein tolles Gefühl!</b> +<p> +P.S.: Wir haben auch allen, die dies zu erkennen gegeben haben, auf Wunsch +Spendenbescheinigungen gesandt. Bei einigen Spendern war das nicht möglich, +weil keine Adresse angegeben war. Wir können auch nicht ausschließen, dass +wir evtl. jemanden übersehen haben. In diesem wie in jenem Fall melden Sie +sich bitte noch einmal. +<p> +Herzliche Grüße, +das MetaGer-Team im SUMA-EV </p> -<h3>Helfen Sie mit, dass freie Suchmaschinen im Internet frei bleiben. Das digitale Wissen der Welt muss ohne Bevormundung durch Staaten oder Konzerne frei zugänglich sein und bleiben.</h3> -<div class=""> +<div class="" style="margin-top:50px"> + <h1>Weiter spenden:</h1>s <div class="col-sm-6"> <h2>{{ trans('spenden.bankinfo.1') }}</h2> <p style="white-space:pre;">{{ trans('spenden.bankinfo.2') }}</p> @@ -146,7 +141,7 @@ im Internet weiter entwickelt und betrieben werden kann: </div> </div> <div id="left" class="col-lg-6 col-md-12 col-sm-12 others"> - - + + </div> @endsection