ok so i didnt - i just realize i was duplicating the results…
but this is what i have:
i wrapped the url in “” and still the same thing…
# Curl for token
curl -X POST 'https://id.twitch.tv/oauth2/token?client_id='$client_id'&client_secret='$client_secret'&grant_type=client_credentials&scope=user:read:email' >> token.txt && awk -F '"' '{print $4}' token.txt >> token_only.txt
token=$(cat token_only.txt)
# Get User ID
curl -H 'Client-ID: '$client_id -H 'Authorization: Bearer '$token 'https://api.twitch.tv/helix/users?login='$name >> user_id.txt && awk -F '"' '{print $6}' user_id.txt >> uid_only.txt
user_id=$(cat uid_only.txt)
# Get follow list for user
curl -H 'Client-ID: '$client_id -H 'Authorization: Bearer '$token 'https://api.twitch.tv/helix/users/follows?to_id='$user_id'&first=100' | json_pp >> fl_list.txt
cat fl_list.txt | grep '"cursor"' | awk -F ':' '{print $2}' | sed 's/"//g' >> cursor.txt
cursor=$(cat cursor.txt)
curl -H 'Client-ID: '$client_id -H 'Authorization: Bearer '$token "https://api.twitch.tv/helix/users/follows?to_id="$user_id"&after="$cursor | json_pp >> fl_list.txt
cat fl_list.txt | grep '"from_id"' | awk -F ':' '{print $2}' | sed 's/"//g' | sed 's/,//g' >> clean_fl_list.txt
wc clean_fl_list.txt
# See if follower is live
for followers in `cat clean_fl_list.txt`
do
curl -H 'Client-ID: '$client_id -H 'Authorization: Bearer '$token 'https://api.twitch.tv/helix/streams?user_id='$followers | json_pp >> live_list.txt
done
cat live_list.txt | grep "user_name" && cat live_list.txt | grep "user_id" && cat live_list.txt | grep "type"
# Remove Token for next go
rm token* uid* user* fl_list* clean_fl* cursor* live_list*