mirror of
https://github.com/kmein/niveum
synced 2026-03-16 18:21:07 +01:00
Packaged 14 scripts from .bin/ into packages/ with proper dependency declarations (writers.writeDashBin/writeBashBin/writePython3Bin): - 256color → two56color (terminal color chart) - avesta.sed → avesta (Avestan transliteration) - bvg.sh → bvg (Berlin transit disruptions) - unicode → charinfo (Unicode character info) - chunk-pdf → chunk-pdf (split PDFs by page count) - csv2json → csv2json (CSV to JSON converter) - fix-sd.sh → fix-sd (exFAT SD card recovery, improved output handling) - json2csv → json2csv (JSON to CSV converter) - mp3player-write → mp3player-write (audio conversion for MP3 players) - mushakkil.sh → mushakkil (Arabic diacritization) - nix-haddock-index → nix-haddock-index (GHC Haddock index generator) - pdf-ocr.sh → pdf-ocr (OCR PDFs via tesseract) - prospekte.sh → prospekte (German supermarket flyer browser) - readme → readme (GitHub README as man page) All added to overlay and packages output. .bin/ directory removed.
54 lines
1.2 KiB
Nix
54 lines
1.2 KiB
Nix
# Berlin BVG transit disruption checker
|
|
{
|
|
writers,
|
|
curl,
|
|
jq,
|
|
}:
|
|
writers.writeDashBin "bvg" ''
|
|
interesting="U6 N6 140 M46 184 N84"
|
|
|
|
${curl}/bin/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}/bin/jq --arg interesting "$interesting" '
|
|
.data.allDisruptions.disruptions
|
|
| map(select(
|
|
(.linie as $linie
|
|
| $interesting
|
|
| split(" ")
|
|
| index($linie))
|
|
and (.["__typename"] == "Traffic")
|
|
))
|
|
'
|
|
''
|