-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrss-snippet.xql
More file actions
32 lines (26 loc) · 1 KB
/
rss-snippet.xql
File metadata and controls
32 lines (26 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
xquery version "3.1";
import module namespace csharv="https://correspSearch.net/harvester" at "modules/harvester.xql";
declare namespace tei="http://www.tei-c.org/ns/1.0";
let $url := request:get-parameter('url', ())
let $cmif-file := collection($csharv:data)//tei:TEI[.//tei:idno/matches(normalize-space(.), $url)]
let $items :=
for $bibl in $cmif-file//tei:bibl
let $title := substring-before($bibl/text(), '.')
let $description := $bibl//text()
let $guid := $bibl/@xml:id/data(.)
let $pubDate := format-dateTime(current-dateTime(), '[D] [MNn, 0-3] [Y] [H]:[m]:[s]')
return
(<item>
<title>New: {$title}</title>
<description>{$description}</description>
<link>https://correspsearch.net/de/suche.html?e={$guid}</link>
<guid>{$guid}</guid>
<pubDate>{$pubDate} +01:00</pubDate>
</item>,
<twitter>
Neu in correspSearch: {$description} https://correspsearch.net/de/suche.html?e={$guid}
</twitter>)
return
element rss-snippet {
$items
}