Open ElijahLynn opened 4 years ago
Setting up a simple script to curl and return a number. Getting a trailing comma:
Mainly posting this to rubber duck here, will post updates as I find them. Searched for trailing comma here, no cigar.
#!/usr/bin/env bash TWITCH_VIEWER_COUNT=$(curl --silent --header 'Accept: application/vnd.twitchtv.v5+json' \ --header 'Client-ID: ojg7299re08d2nor9gg4a78oof5il5' \ --request GET https://api.twitch.tv/kraken/streams/242513/ | python -m json.tool | grep viewers | tr -d " " | awk -F":" '{ print $2 }') echo LIVE: $TWITCH_VIEWER_COUNT --- echo $TWITCH_VIEWER_COUNT
Thought it was a newline but doesn't appear to be so. I <output> | tr --delete "\n" and no go.
<output> | tr --delete "\n"
Setting up a simple script to curl and return a number. Getting a trailing comma:
Mainly posting this to rubber duck here, will post updates as I find them. Searched for trailing comma here, no cigar.