Resolve URLs properly in Denmark feeds
This commit is contained in:
parent
40a858c183
commit
a4eeecec21
|
@ -8,6 +8,7 @@
|
|||
# $link: Channel link
|
||||
# Expects pup JSON output holding <li> tags, outputs xmltodict-compatible JSON
|
||||
# WARNING: Dates are locale-sensitive; the RSS feed might not generate correctly with another locale.
|
||||
import "./helpers" as helpers;
|
||||
|
||||
{
|
||||
"rss": {
|
||||
|
@ -30,8 +31,8 @@
|
|||
| {
|
||||
"title": .children[-1].children[0].children[0].text,
|
||||
"description": .children[-1].children[-1].text,
|
||||
"link": .["data-url"],
|
||||
"guid": .["data-url"],
|
||||
"link": (.["data-url"] | helpers::urlresolve($link)),
|
||||
"guid": (.["data-url"] | helpers::urlresolve($link)),
|
||||
"pubDate": (
|
||||
.children[-1].children[1].text[-10:]
|
||||
| strptime("%d-%m-%Y")
|
||||
|
@ -47,7 +48,9 @@
|
|||
}
|
||||
# Optional MediaRSS thumbnail
|
||||
| if $item.children[0].class == "media-left" then
|
||||
.["http://search.yahoo.com/mrss/:thumbnail"] = {"@url": $item.children[0].children[0].src}
|
||||
.["http://search.yahoo.com/mrss/:thumbnail"] = {
|
||||
"@url": ($item.children[0].children[0].src | helpers::urlresolve($link))
|
||||
}
|
||||
else . end
|
||||
]
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue