Skip to content

Instantly share code, notes, and snippets.

@SkyWriter
Created February 22, 2021 15:10
Show Gist options
  • Save SkyWriter/fd5d014535a9471e51a2b457c2a29f43 to your computer and use it in GitHub Desktop.
Save SkyWriter/fd5d014535a9471e51a2b457c2a29f43 to your computer and use it in GitHub Desktop.
Generate BrandMeister repeater map for Google Earth
#!/usr/bin/env bash
curl -sS 'https://api.brandmeister.network/v1.0/repeater/?action=LIST&callback=jQuery21409266752848243749_1614003744281&_=1614003744283' | sed 's#^jQuery[0-9_]*(##g' | sed 's#)$##g' | jq '.[] | select(.pep != null) | select((.pep | tonumber) > 1.0) | select(.status == "3") | {name: .callsign, desc: "\(.repeaterid) \(.callsign) RX\(.rx) TX\(.tx) CC\(.colorcode)", latitude: .lat, longitude: .lng}' | jq -s | jq -r '(map(keys) | add | unique) as $cols | map(. as $row | $cols | map($row[.])) as $rows | $cols, $rows[] | @csv' > repeaters.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment