Add Alert-Hub.org OPML generator

This commit is contained in:
~lucidiot 2023-11-18 16:38:06 +01:00
parent e3ed825cf7
commit 99803ac2e0
1 changed files with 38 additions and 0 deletions

38
xquery/opml/alert-hub.xqy Normal file
View File

@ -0,0 +1,38 @@
<opml version="2.0">
<head>
<title>Alert-Hub.org CAP alert feeds</title>
<dateModified>{format-dateTime(adjust-dateTime-to-timezone(current-dateTime(), xs:dayTimeDuration("PT0S")), "[FNn,*-3], [D01] [MNn,*-3] [Y0001] [H01]:[m01]:[s01] GMT")}</dateModified>
<ownerName>lucidiot</ownerName>
<ownerEmail>lucidiot@envs.net</ownerEmail>
<ownerId>https://tilde.town/~lucidiot/contact.html</ownerId>
<docs>http://dev.opml.org/spec2.html</docs>
</head>
<body>
<outline text="Sources">
{
json(fn:unparsed-text("https://alert-hub-sources.s3.amazonaws.com/json"))/sources/source
! <outline
type="rss"
xml:id="{sourceId}"
text="{byLanguage/name[1]}"
xmlUrl="{capAlertFeed}"
htmlUrl="{registerUrl}"
/>
}
</outline>
<outline text="Generated feeds">
{
json(fn:unparsed-text("https://alert-hub-subscriptions.s3.amazonaws.com/json"))//subscriptions/subscription
! <outline
type="rss"
xml:id="{subscriptionId}"
text="{subscriptionName}"
title="{subscriptionName}"
xmlUrl="{subscriptionUrl}"
version="RSS"
description="{fn:parse-xml(feedRssXml)/rss/channel/description}"
/>
}
</outline>
</body>
</opml>