1
0
Fork 0
fake-firehose/get-stream.sh

25 lines
517 B
Bash
Raw Normal View History

2022-12-17 05:20:35 +00:00
host=$1
while true
do
today=`date +"%Y%m%d"`
curl -X "GET" "https://$host/api/v1/streaming/public" \
--no-progress-meter | \
2022-12-17 23:17:52 +00:00
tee -a "$today.json" | \
2022-12-17 05:20:35 +00:00
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