Skip to content
Snippets Groups Projects
Commit c5fb2283 authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

Merge branch '452-such-api' into 'development'

Resolve "Such-API"

Closes #452

See merge request !769
parents 17f08c6a 18beb1de
No related branches found
No related tags found
2 merge requests!773Development,!769Resolve "Such-API"
...@@ -140,6 +140,13 @@ class MetaGer ...@@ -140,6 +140,13 @@ class MetaGer
->with('suspendheader', "yes") ->with('suspendheader', "yes")
->with('browser', (new Agent())->browser()); ->with('browser', (new Agent())->browser());
break; break;
case 'rss20':
return view('metager3resultsrss20')
->with('results', $viewResults)
->with('eingabe', $this->eingabe)
->with('metager', $this)
->with('resultcount', sizeof($viewResults));
break;
case 'result-count': case 'result-count':
# Wir geben die Ergebniszahl und die benötigte Zeit zurück: # Wir geben die Ergebniszahl und die benötigte Zeit zurück:
return sizeof($viewResults) . ";" . round((microtime(true) - $this->starttime), 2); return sizeof($viewResults) . ";" . round((microtime(true) - $this->starttime), 2);
...@@ -974,7 +981,7 @@ class MetaGer ...@@ -974,7 +981,7 @@ class MetaGer
} }
$this->out = $request->input('out', "html"); $this->out = $request->input('out', "html");
# Standard output format 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"; $this->out = "html";
} }
# Wir schalten den Cache aus, wenn die Ergebniszahl überprüft werden soll # Wir schalten den Cache aus, wenn die Ergebniszahl überprüft werden soll
......
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <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="icon" type="image/x-icon" />
<link href="/favicon.ico" rel="shortcut 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" /> <meta content="width=device-width, initial-scale=1.0, user-scalable=no" name="viewport" />
......
<?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>
...@@ -5,5 +5,6 @@ ...@@ -5,5 +5,6 @@
<Contact>office@suma-ev.de</Contact> <Contact>office@suma-ev.de</Contact>
<Image width="16" height="16" type="image/x-icon">{{ url('/favicon.ico') }}</Image> <Image width="16" height="16" type="image/x-icon">{{ url('/favicon.ico') }}</Image>
<Url type="text/html" template="{{ $link }}&amp;eingabe={searchTerms}" method="{{$request}}"></Url> <Url type="text/html" template="{{ $link }}&amp;eingabe={searchTerms}" method="{{$request}}"></Url>
<Url type="application/rss+xml" xmlns:example="http://example.com/opensearchextensions/1.0/" template="{{ $link }}&amp;eingabe={searchTerms}&amp;out=rss20" method="{{$request}}"></Url>
<InputEncoding>UTF-8</InputEncoding> <InputEncoding>UTF-8</InputEncoding>
</OpenSearchDescription> </OpenSearchDescription>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment