satnogs-wut/wut-obs

35 lines
736 B
Plaintext
Raw Normal View History

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