diff --git a/app/MetaGer.php b/app/MetaGer.php index 6afd48b7e3bd1204105ddb77cbf71aeb5b0a87b7..a92b5f534084834a4c07ccbe23f016ddc780a21f 100644 --- a/app/MetaGer.php +++ b/app/MetaGer.php @@ -140,6 +140,13 @@ class MetaGer ->with('suspendheader', "yes") ->with('browser', (new Agent())->browser()); break; + case 'rss20': + return view('metager3resultsrss20') + ->with('results', $viewResults) + ->with('eingabe', $this->eingabe) + ->with('metager', $this) + ->with('resultcount', sizeof($viewResults)); + break; case 'result-count': # Wir geben die Ergebniszahl und die benötigte Zeit zurück: return sizeof($viewResults) . ";" . round((microtime(true) - $this->starttime), 2); @@ -974,7 +981,7 @@ class MetaGer } $this->out = $request->input('out', "html"); # Standard output format html - if ($this->out !== "html" && $this->out !== "json" && $this->out !== "results" && $this->out !== "results-with-style" && $this->out !== "result-count") { + if ($this->out !== "html" && $this->out !== "json" && $this->out !== "results" && $this->out !== "results-with-style" && $this->out !== "result-count" && $this->out !== "rss20") { $this->out = "html"; } # Wir schalten den Cache aus, wenn die Ergebniszahl überprüft werden soll diff --git a/resources/views/layouts/resultPage.blade.php b/resources/views/layouts/resultPage.blade.php index 59ad5de2065091adc55cd8ce80fb4b78afcdc864..370bbf638a572de8d704ff95547dd3700192c084 100644 --- a/resources/views/layouts/resultPage.blade.php +++ b/resources/views/layouts/resultPage.blade.php @@ -1,7 +1,7 @@ <!DOCTYPE html> <html> <head> - <title>{{ $metager->getQ() }} - MetaGer</title> + <title>{{ $eingabe }} - MetaGer</title> <link href="/favicon.ico" rel="icon" type="image/x-icon" /> <link href="/favicon.ico" rel="shortcut icon" type="image/x-icon" /> <meta content="width=device-width, initial-scale=1.0, user-scalable=no" name="viewport" /> diff --git a/resources/views/metager3resultsrss20.blade.php b/resources/views/metager3resultsrss20.blade.php new file mode 100644 index 0000000000000000000000000000000000000000..7b96fa9560cec5b2ac161d6e4149c203a0f4ac39 --- /dev/null +++ b/resources/views/metager3resultsrss20.blade.php @@ -0,0 +1,21 @@ +<?xmlversion = "1.0"encoding = "UTF-8"?> + <rss version="2.0" + xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" + xmlns:atom="http://www.w3.org/2005/Atom"> + <channel> + <title>{{ $eingabe }} - MetaGer</title> + <description></description> + <opensearch:totalResults>{{ $resultcount }}</opensearch:totalResults> + <opensearch:Query role="request" searchTerms="{{ htmlspecialchars($eingabe, ENT_QUOTES) }}"/> + + @foreach($metager->getResults() as $result) + <item> + <title>{{ $result->titel }}</title> + <link>{{ $result->link }}</link> + <description> + {{ $result->descr }} + </description> + </item> + @endforeach + </channel> + </rss> diff --git a/resources/views/plugin.blade.php b/resources/views/plugin.blade.php index b607dc760b88c66c0537a4068487c8fb874e5a16..966ab011bcf90765513d1f12cbf286695364c676 100644 --- a/resources/views/plugin.blade.php +++ b/resources/views/plugin.blade.php @@ -5,5 +5,6 @@ <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 }}&eingabe={searchTerms}" method="{{$request}}"></Url> + <Url type="application/rss+xml" xmlns:example="http://example.com/opensearchextensions/1.0/" template="{{ $link }}&eingabe={searchTerms}&out=rss20" method="{{$request}}"></Url> <InputEncoding>UTF-8</InputEncoding> </OpenSearchDescription>