Commit e38dbf29 authored by Mathias Goebel's avatar Mathias Goebel 🎠
Browse files

misc

parent 60279b48
......@@ -243,7 +243,7 @@ declare function f-misc:list($datadir, $param, $num as xs:integer) {
attribute data-original {$img}
else ()
}
}
}
</div>
</div>
</div>
......@@ -425,19 +425,20 @@ switch ($develop)
declare function f-misc:textgridStatus($node as node(), $model as map(*)) {
let $col := "/db/sade-projects/textgrid"
let $res := "tgstatus.xml"
let $url := "https://dariah-de.github.io/status/textgrid/repstatus.html"
let $lastMod := xmldb:last-modified($col, $res)
let $doc := doc( $col || "/" || $res )
let $active := not( exists( $doc//ok ) )
let $getStatus :=
if( not( $active ) and $lastMod < (current-dateTime() - xs:dayTimeDuration("PT12H")) )
then
let $status := httpclient:get(xs:anyURI("https://raw.githubusercontent.com/DARIAH-DE/textgridrep-status/master/repstatus.html"), false(), ())//xhtml:div[contains(@class, 'repstatus')][not( contains(@class, 'ok') )]
let $status := httpclient:get(xs:anyURI($url), false(), ())//xhtml:div[contains(@class, 'repstatus')][not( contains(@class, 'ok') )]
let $status := if( exists( $status ) ) then $status else <ok/>
return
xmldb:store($col, $res, $status)
else if($active and $lastMod < (current-dateTime() - xs:dayTimeDuration("PT2H")))
then
let $status := httpclient:get(xs:anyURI("https://raw.githubusercontent.com/DARIAH-DE/textgridrep-status/master/repstatus.html"), false(), ())//xhtml:div[contains(@class, 'repstatus')][not( contains(@class, 'ok') )]
let $status := httpclient:get(xs:anyURI($url), false(), ())//xhtml:div[contains(@class, 'repstatus')][not( contains(@class, 'ok') )]
let $status := if( exists( $status ) ) then $status else <ok/>
return
xmldb:store($col, $res, $status)
......
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