Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
open-source
MetaGer
Commits
c5fb2283
Commit
c5fb2283
authored
Mar 13, 2017
by
Dominik Hebeler
Browse files
Merge branch '452-such-api' into 'development'
Resolve "Such-API" Closes
#452
See merge request
!769
parents
17f08c6a
18beb1de
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
app/MetaGer.php
View file @
c5fb2283
...
...
@@ -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
...
...
resources/views/layouts/resultPage.blade.php
View file @
c5fb2283
<!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"
/>
...
...
resources/views/metager3resultsrss20.blade.php
0 → 100644
View file @
c5fb2283
<?
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>
resources/views/plugin.blade.php
View file @
c5fb2283
...
...
@@ -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>
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment