mirror of
https://github.com/kmein/niveum
synced 2026-03-19 19:41:08 +01:00
feat: add bvg disruptions script
This commit is contained in:
46
.bin/bvg.sh
Executable file
46
.bin/bvg.sh
Executable file
@@ -0,0 +1,46 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
interesting="U6 N6 140 M46 184 N84"
|
||||||
|
|
||||||
|
curl -sSL 'https://www.bvg.de/disruption-reports/q' \
|
||||||
|
--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
|
||||||
|
}
|
||||||
|
}"}' \
|
||||||
|
| jq --arg interesting "$interesting" '
|
||||||
|
.data.allDisruptions.disruptions
|
||||||
|
| map(select(
|
||||||
|
(.linie as $linie
|
||||||
|
| $interesting
|
||||||
|
| split(" ")
|
||||||
|
| index($linie))
|
||||||
|
and (.["__typename"] == "Traffic")
|
||||||
|
))
|
||||||
|
'
|
||||||
Reference in New Issue
Block a user