-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '887-rss' of https://github.com/hbz/lobid-resources
Resolves #887 See: http://lobid.org/resources/search?q=köln http://lobid.org/resources/search?q=köln&format=rss http://lobid.org/resources/api#content_types
- Loading branch information
Showing
10 changed files
with
153 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,11 +66,14 @@ <h2 id='content_types'>Inhaltstypen <small><a href='#content_types'><span class= | |
|
||
<p>Standardmäßig liefert dieser Dienst strukturierte API-Antworten (als JSON):</p> | ||
<p><code>curl http://[email protected]("HT018472857")</code></p> | ||
<p>Er unterstützt Content-Negotiation über den Accept-Header für JSON (application/json), JSON lines (application/x-jsonlines) oder HTML (text/html):</p> | ||
<p>Er unterstützt Content-Negotiation für JSON (application/json), JSON lines (application/x-jsonlines), RSS (application/rss+xml) und HTML (text/html):</p> | ||
<p><code>curl --header "Accept: application/json" http://[email protected]("kunst")</code></p> | ||
<p><code>curl --header "Accept: application/rss+xml" http://[email protected]("kunst")</code></p> | ||
<p><code>curl --header "Accept: application/x-jsonlines" http://[email protected]("kunst") > kunst.jsonl</code></p> | ||
<p>Der Query-Parameter "format" (Werte: html,json,jsonl) kann verwendet werden, um den Accept-Header aufzuheben, z.B. zur Anzeige von JSON im Browser:</p> | ||
<p>Der Query-Parameter "format" (Werte: html,json,jsonl,rss) kann verwendet werden, um den Accept-Header aufzuheben, z.B. zur Anzeige von JSON im Browser:</p> | ||
<p><a href='@resources.routes.Application.resource("HT018472857", format="json")'>@resources.routes.Application.resource("HT018472857", format="json")</a></p> | ||
<p>Oder zum Abonnieren eines RSS-Feeds:</p> | ||
<p><a href='@resources.routes.Application.query("kunst", format="rss")'>@resources.routes.Application.query("kunst", format="rss")</a></p> | ||
<p>Der Wert des Format-Parameters kann für Einzeltreffer auch in URLs als Dateiendung verwendet werden:</p> | ||
<p><a href='@resources.routes.Application.resourceDotFormat("HT018472857", format="json")'>@resources.routes.Application.resourceDotFormat("HT018472857", format="json")</a></p> | ||
<p>Für größere Anfragen kann die Antwort als gzip komprimiert werden:</p> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
@* Copyright 2018 Fabian Steeg, hbz. Licensed under the GPLv2 *@ | ||
@(result: String, uri: String, query: String)@defining(play.api.libs.json.Json.parse(result).asOpt[Seq[play.api.libs.json.JsValue]].getOrElse(Seq()).zipWithIndex) { hits =><?xml version="1.0" encoding="utf-8" standalone="yes" ?> | ||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> | ||
<channel> | ||
<title>lobid-resources @query</title> | ||
<link>@controllers.resources.Application.CONFIG.getString("host")@uri</link> | ||
<description>hbz union catalogue query @query</description> | ||
@for((doc,i) <- hits; id = (doc\\"hbzId")(0).as[String]) { | ||
<item> | ||
<title>@((doc\"title").asOpt[String].getOrElse(""))</title> | ||
<link>@controllers.resources.Application.CONFIG.getString("host")@resources.routes.Application.resource(id, null)</link> | ||
<pubDate>@controllers.resources.Application.RSS_DATE_FORMAT.format(controllers.resources.Application.LOBID_DATE_FORMAT.parse((doc\"describedBy"\"dateCreated").asOpt[String].getOrElse("")))</pubDate> | ||
<description><![CDATA[@tags.result_doc(doc)]]></description> | ||
</item> | ||
} | ||
</channel> | ||
</rss> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
host="http://lobid.org" | ||
hbz01.api="http://lobid.org/hbz01" | ||
orgs.api="http://lobid.org/organisations/" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters