rsrsss/xquery/opml/usgs/earthquakes.xqy

45 lines
1.3 KiB
Plaintext

import module namespace rsrsss = "https://envs.net/~lucidiot/rsrsss/rsrsss-functions" at "../../functions.xqy";
rsrsss:make-opml(
"USGS Earthquake Hazards Program feeds",
(
<outline text="Atom">
{
doc('https://earthquake.usgs.gov/earthquakes/feed/v1.0/atom.php')//div[h2[text() = 'Feeds']]/h3
! <outline text="{normalize-space(text())}">
{
./following-sibling::ul//a
! <outline
type="rss"
version="ATOM"
text="{normalize-space(text())}"
xmlUrl="{resolve-uri(@href)}"
language="en-us"
/>
}
</outline>
}
</outline>,
<outline text="KML">
{
doc('https://earthquake.usgs.gov/earthquakes/feed/v1.0/kml.php')//div[h2[text() = 'Automatic Feeds']]/h2
! <outline text="{normalize-space(text())}">
{
./following-sibling::h3
! <outline text="{normalize-space(text())}">
{
./following-sibling::ul//a
! <outline
type="link"
text="{normalize-space(text())}"
url="{resolve-uri(@href)}"
/>
}
</outline>
}
</outline>
}
</outline>
)
)