rsrsss/xquery/cta_opml.xqy

29 lines
1.1 KiB
Plaintext

<opml version="2.0">
<head>
<title>Chicago Transit Authority RSS 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>
{
(: Open the CTA RSS feeds page and grab the list items. :)
x:parse-html(x:request('https://www.transitchicago.com/rss/default.aspx')/raw)//ul[@class="rsslist"]/li
! <outline text="{substring-after(a/normalize-space(text()), 'All ')}">
{
(., ul/li)
! <outline
type="rss"
version="RSS"
text="{a/normalize-space(text())}"
xmlUrl="{resolve-uri(a/@href, 'https://www.transitchicago.com/rss/default.aspx')}"
language="en-us"
/>
}
</outline>
}
</body>
</opml>