Skip to content

Instantly share code, notes, and snippets.

@scr512
Last active December 29, 2015 00:59
Show Gist options
  • Save scr512/7589886 to your computer and use it in GitHub Desktop.
Save scr512/7589886 to your computer and use it in GitHub Desktop.
Send isi statistics heat to Dashing list widget
#!/bin/zsh
#Send top 10 results of isi statistics heat ordered by pathname to Dashing
heat=($(isi statistics heat --nodes=all --pathdepth=6 --totalby=Path | head -16 | grep ifs | awk '{print $5,$1}' | egrep -v ".ifsvar" | sed 's,/ifs/,/,g' | xargs))
heat_array=($heat)
/usr/local/bin/wget -O- --post-data='{ "auth_token": "<your auth token>", "items": [{ "label": "'"$heat_array[1]"'", "value": "'"$heat_array[2]"'" }, { "label": "'"$heat_array[3]"'", "value": "'"$heat_array[4]"'" }, { "label": "'"$heat_array[5]"'", "value": "'"$heat_array[6]"'" }, { "label": "'"$heat_array[7]"'", "value": "'"$heat_array[8]"'" }, { "label": "'"$heat_array[9]"'", "value": "'"$heat_array[10]"'" }, { "label": "'"$heat_array[11]"'", "value": "'"$heat_array[12]"'" }, { "label": "'"$heat_array[13]"'", "value": "'"$heat_array[14]"'" }, { "label": "'"$heat_array[15]"'", "value": "'"$heat_array[16]"'" }, { "label": "'"$heat_array[17]"'", "value": "'"$heat_array[18]"'" }, { "label": "'"$heat_array[19]"'", "value": "'"$heat_array[20]"'" } ] }' --header=Content-Type:application/json "http://10.112.81.131:3030/widgets/aus-topdirs"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment