Skip to content

Instantly share code, notes, and snippets.

@mitchyboy9
Created April 26, 2018 11:34
Show Gist options
  • Save mitchyboy9/8602cdade2fe7c73f1ba12e9ab3e58bd to your computer and use it in GitHub Desktop.
Save mitchyboy9/8602cdade2fe7c73f1ba12e9ab3e58bd to your computer and use it in GitHub Desktop.
import urllib, json
from anybar import AnyBar
def blink(url, portValue, textValue):
data = json.loads(urllib.urlopen(url).read())
status = data['status'].lower()
AnyBar(port=portValue).change(status, text=textValue)
envs = {"devint": 1738,"e2e": 1739,"ee2": 1740,"s1": 1741,"prd": 1742}
for env, port in envs.iteritems():
pmpUrl = "http://{}pmp.slu.bskyb.com:8087/monitor/fullStatus?detail=true".format(env)
blink(pmpUrl, port, env)
##/bin/bash
# ANYBAR_PORT=1738 open -n /Users/pmp/Applications/AnyBar.app
# ANYBAR_PORT=1739 open -n /Users/pmp/Applications/AnyBar.app
# ANYBAR_PORT=1740 open -n /Users/pmp/Applications/AnyBar.app
# ANYBAR_PORT=1741 open -n /Users/pmp/Applications/AnyBar.app
# ANYBAR_PORT=1742 open -n /Users/pmp/Applications/AnyBar.app
# sleep 1
# echo -n "white devint" | nc -4u -w0 localhost 1738
# echo -n "white e2e" | nc -4u -w0 localhost 1739
# echo -n "white ee2" | nc -4u -w0 localhost 1740
# echo -n "white s1" | nc -4u -w0 localhost 1741
# echo -n "white prd" | nc -4u -w0 localhost 1742
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment