Commit 6f6c3417 authored by Dominik Hebeler's avatar Dominik Hebeler

readded rss20 feed

parent 867bda38
......@@ -214,7 +214,15 @@ class MetaGer
->with('browser', (new Agent())->browser())
->with('fokus', $this->fokus);
break;
case 'rss20':
return view('resultpages.metager3resultsrss20')
->with('results', $viewResults)
->with('eingabe', $this->eingabe)
->with('apiAuthorized', $this->apiAuthorized)
->with('metager', $this)
->with('resultcount', sizeof($viewResults))
->with('fokus', $this->fokus);
break;
case 'api':
return view('resultpages.metager3resultsatom10', ['eingabe' => $this->eingabe, 'resultcount' => sizeof($viewResults), 'key' => $this->apiKey, 'metager' => $this]);
break;
......@@ -1107,7 +1115,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" && $this->out !== "atom10" && $this->out !== "api") {
if ($this->out !== "html" && $this->out !== "json" && $this->out !== "results" && $this->out !== "results-with-style" && $this->out !== "result-count" && $this->out !== "atom10" && $this->out !== "api" && $this->out !== "rss20") {
$this->out = "html";
}
# Wir schalten den Cache aus, wenn die Ergebniszahl überprüft werden soll
......
<?xmlversion = "1.0"encoding = "UTF-8"?>
<rss version="2.0"
xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/"
xmlns:mg="http://metager.de/opensearch/"
xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>{!! htmlspecialchars($eingabe, ENT_XML1, 'UTF-8'); !!} - MetaGer</title>
<opensearch:totalResults>{{ $resultcount }}</opensearch:totalResults>
<opensearch:Query role="request" searchTerms="{{ htmlspecialchars($eingabe, ENT_QUOTES) }}"/>
<mg:nextSearchResults url="{{htmlspecialchars($metager->nextSearchLink() ,ENT_QUOTES)}}" />
@if($apiAuthorized)
@foreach($metager->getResults() as $result)
<item>
<title>{!! htmlspecialchars($result->titel, ENT_XML1, 'UTF-8'); !!}</title>
<link>{!! htmlspecialchars($result->link, ENT_XML1, 'UTF-8'); !!}</link>
<mg:anzeigeLink>{!! htmlspecialchars($result->anzeigeLink, ENT_XML1, 'UTF-8'); !!}</mg:anzeigeLink>
<description>
{!! htmlspecialchars($result->longDescr, ENT_XML1, 'UTF-8'); !!}
</description>
</item>
@endforeach
@endif
</channel>
</rss>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment