Add GUIDs and date parsing error handling on JTSB feeds
This commit is contained in:
parent
f922078daf
commit
adee9e05f9
|
@ -33,7 +33,13 @@ import "./helpers" as helpers;
|
|||
+ .children[6].children[0].text
|
||||
),
|
||||
"link": (.children[-1].children[0].href|helpers::urlresolve("http://www.mlit.go.jp/jtsb/")),
|
||||
"pubDate": (try (.children[1].children[0].text | strptime("%Y.%m.%d") | mktime | strftime("%a, %d %b %Y %T %z")))
|
||||
"guid": (.children[-1].children[0].href|helpers::urlresolve("http://www.mlit.go.jp/jtsb/")),
|
||||
"pubDate": (try (
|
||||
.children[1].children[0].text
|
||||
| strptime("%Y.%m.%d")
|
||||
| mktime
|
||||
| strftime("%a, %d %b %Y %T %z")
|
||||
) catch [])
|
||||
}]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,13 @@ import "./helpers" as helpers;
|
|||
+ .children[5].children[0].text
|
||||
),
|
||||
"link": (.children[-1].children[0].href|helpers::urlresolve("http://www.mlit.go.jp/jtsb/")),
|
||||
"pubDate": (try (.children[1].children[0].text | strptime("%Y.%m.%d") | mktime | strftime("%a, %d %b %Y %T %z")))
|
||||
"guid": (.children[-1].children[0].href|helpers::urlresolve("http://www.mlit.go.jp/jtsb/")),
|
||||
"pubDate": (try (
|
||||
.children[1].children[0].text
|
||||
| strptime("%Y.%m.%d")
|
||||
| mktime
|
||||
| strftime("%a, %d %b %Y %T %z")
|
||||
) catch [])
|
||||
}]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,13 @@ import "./helpers" as helpers;
|
|||
+ .children[5].children[0].text
|
||||
),
|
||||
"link": (.children[-1].children[0].href|helpers::urlresolve("http://www.mlit.go.jp/jtsb/")),
|
||||
"pubDate": (try (.children[1].children[0].text | strptime("%Y.%m.%d") | mktime | strftime("%a, %d %b %Y %T %z")))
|
||||
"guid": (.children[-1].children[0].href|helpers::urlresolve("http://www.mlit.go.jp/jtsb/")),
|
||||
"pubDate": (try (
|
||||
.children[1].children[0].text
|
||||
| strptime("%Y.%m.%d")
|
||||
| mktime
|
||||
| strftime("%a, %d %b %Y %T %z")
|
||||
) catch [])
|
||||
}]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,16 +22,23 @@
|
|||
),
|
||||
"description": (
|
||||
.children[4].text
|
||||
+ " "
|
||||
+ " "
|
||||
+ .children[3].text
|
||||
+ .children[3].children[0].text
|
||||
+ " "
|
||||
+ " "
|
||||
+ .children[2].text
|
||||
+ " "
|
||||
+ " "
|
||||
+ .children[1].text
|
||||
),
|
||||
"link": .children[5].children[2].href,
|
||||
"pubDate": (try (.children[5].text | sub("[^0-9]"; ""; "g") | strptime("%Y%m%d") | mktime | strftime("%a, %d %b %Y %T %z")))
|
||||
"link": .children[5].children[2].href,
|
||||
"guid": .children[5].children[2].href,
|
||||
"pubDate": (try (
|
||||
.children[5].text
|
||||
| sub("[^0-9]"; ""; "g")
|
||||
| strptime("%Y%m%d")
|
||||
| mktime
|
||||
| strftime("%a, %d %b %Y %T %z")
|
||||
) catch [])
|
||||
}]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,13 +22,20 @@
|
|||
),
|
||||
"description": (
|
||||
.children[3].text
|
||||
+ " "
|
||||
+ " "
|
||||
+ .children[2].text
|
||||
+ " "
|
||||
+ " "
|
||||
+ .children[1].text
|
||||
),
|
||||
"link": .children[4].children[2].href,
|
||||
"pubDate": (try (.children[4].text | sub("[^0-9]"; ""; "g") | strptime("%Y%m%d") | mktime | strftime("%a, %d %b %Y %T %z")))
|
||||
"link": .children[4].children[2].href,
|
||||
"guid": .children[4].children[2].href,
|
||||
"pubDate": (try (
|
||||
.children[4].text
|
||||
| sub("[^0-9]"; ""; "g")
|
||||
| strptime("%Y%m%d")
|
||||
| mktime
|
||||
| strftime("%a, %d %b %Y %T %z")
|
||||
) catch [])
|
||||
}]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,14 +22,21 @@
|
|||
),
|
||||
"description": (
|
||||
.children[3].text
|
||||
+ " "
|
||||
+ " "
|
||||
+ .children[2].text
|
||||
+ .children[2].children[0].text
|
||||
+ " "
|
||||
+ " "
|
||||
+ .children[1].text
|
||||
),
|
||||
"link": .children[4].children[2].href,
|
||||
"pubDate": (try (.children[4].text | sub("[^0-9]"; ""; "g") | strptime("%Y%m%d") | mktime | strftime("%a, %d %b %Y %T %z")))
|
||||
"link": .children[4].children[2].href,
|
||||
"guid": .children[4].children[2].href,
|
||||
"pubDate": (try (
|
||||
.children[4].text
|
||||
| sub("[^0-9]"; ""; "g")
|
||||
| strptime("%Y%m%d")
|
||||
| mktime
|
||||
| strftime("%a, %d %b %Y %T %z")
|
||||
) catch [])
|
||||
}]
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue