Skip to content

Instantly share code, notes, and snippets.

Last active Apr 20, 2017
What would you like to do?
#!/usr/bin/env python
import urllib, json, subprocess, time
lastCommandDate = None
url = ''
while True:
response = urllib.urlopen(url)
data = json.loads(
lastIndex = len(data['feed']['entry']) - 1
currentCommandDate = data['feed']['entry'][lastIndex]['updated']['$t']
if lastCommandDate != currentCommandDate:
lastCommandDate = currentCommandDate
outletCode = data['feed']['entry'][lastIndex]['gsx$outletid']['$t']["/var/www/html/rfoutlet/codesend", outletCode])
except KeyError:
print "No commands exist."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment