fake-firehose/get-stream.sh
2022-12-17 23:17:52 +00:00

24 lines
517 B
Bash
Executable file

host=$1
while true
do
today=`date +"%Y%m%d"`
curl -X "GET" "https://$host/api/v1/streaming/public" \
--no-progress-meter | \
tee -a "$today.json" | \
grep url | \
sed 's/data://g' | \
while read -r line
do
if [[ $line == *"uri"* ]]
then
url=`echo $line | jq .url| sed 's/\"//g'`
uri=`echo $line | jq .uri| sed 's/\"//g'`
echo "$host $url"
echo $uri >> "$today.uris.txt"
fi
done
done