p-e-w / argos

Create GNOME Shell extensions in seconds
https://extensions.gnome.org/extension/1176/argos/
1.65k stars 112 forks source link

Trailing comma #91

Open ElijahLynn opened 4 years ago

ElijahLynn commented 4 years ago

Setting up a simple script to curl and return a number. Getting a trailing comma:

image

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
ElijahLynn commented 4 years ago

Thought it was a newline but doesn't appear to be so. I <output> | tr --delete "\n" and no go.