satnogs-wut/wut-obs

35 lines
736 B
Bash
Executable File

#!/bin/bash
# wut-obs
# Usage:
# wut-obs [Observation ID] [Observation ID] [Observation ID] ...
# Example:
# wut-obs 1446272 1456893
# Download Observation: JSON. Not waterfall, audio, or data files.
APIURL="https://network.satnogs.org/api"
DOWNDIR="/srv/satnogs/download"
cd $DOWNDIR || exit
# XXX Should check input is sane...
OBS="$@"
# Download JSON
for OBSID in $OBS
do mkdir -p $OBSID || exit
cd $OBSID || exit
curl \
--http2 --ipv4 \
--silent \
--output $OBSID.json \
"$APIURL/observations/?id=$OBSID&ground_station=&satellite__norad_cat_id=&transmitter_uuid=&transmitter_mode=&transmitter_type=&vetted_status=&vetted_user=&start=&end="
cat $OBSID.json | jq '.'
echo
cd ..
done
exit 0