2026-02-17 21:32:10 +01:00
|
|
|
# Berlin BVG transit disruption checker
|
|
|
|
|
{
|
2026-02-17 21:35:28 +01:00
|
|
|
lib,
|
2026-02-17 21:32:10 +01:00
|
|
|
writers,
|
|
|
|
|
curl,
|
|
|
|
|
jq,
|
|
|
|
|
}:
|
|
|
|
|
writers.writeDashBin "bvg" ''
|
2026-02-17 21:35:28 +01:00
|
|
|
${lib.getExe curl} -sSL 'https://www.bvg.de/disruption-reports/q' \
|
2026-02-17 21:32:10 +01:00
|
|
|
--data-raw '{"variables":{},"query":"{
|
|
|
|
|
allDisruptions {
|
|
|
|
|
disruptions {
|
|
|
|
|
meldungsId
|
|
|
|
|
linie
|
|
|
|
|
verkehrsmittel
|
|
|
|
|
__typename
|
|
|
|
|
... on Traffic {
|
|
|
|
|
datum
|
|
|
|
|
gueltigVonDatum
|
|
|
|
|
gueltigVonZeit
|
|
|
|
|
gueltigBisDatum
|
|
|
|
|
gueltigBisZeit
|
|
|
|
|
richtungName
|
|
|
|
|
richtungHafasId
|
|
|
|
|
beginnAbschnittName
|
|
|
|
|
beginnAbschnittHafasId
|
|
|
|
|
endeAbschnittName
|
|
|
|
|
endeAbschnittHafasId
|
|
|
|
|
textIntUrsache
|
|
|
|
|
sev
|
|
|
|
|
textIntAuswirkung
|
|
|
|
|
umfahrung
|
|
|
|
|
textWAPSMSUrsache
|
|
|
|
|
textWAPSMSAuswirkung
|
|
|
|
|
prioritaet
|
|
|
|
|
__typename
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
__typename
|
|
|
|
|
}
|
|
|
|
|
}"}' \
|
2026-02-17 21:35:28 +01:00
|
|
|
| ${lib.getExe jq} --arg interesting "$interesting" '
|
2026-02-17 21:32:10 +01:00
|
|
|
.data.allDisruptions.disruptions
|
|
|
|
|
| map(select(
|
|
|
|
|
(.linie as $linie
|
|
|
|
|
| $interesting
|
|
|
|
|
| split(" ")
|
|
|
|
|
| index($linie))
|
|
|
|
|
and (.["__typename"] == "Traffic")
|
|
|
|
|
))
|
|
|
|
|
'
|
|
|
|
|
''
|