Skip to content

Instantly share code, notes, and snippets.

@paultag
Created November 28, 2011 14:58
Show Gist options
  • Save paultag/1400681 to your computer and use it in GitHub Desktop.
Save paultag/1400681 to your computer and use it in GitHub Desktop.
Debian Changes via CLI :)
#!/usr/bin/env python
import time
import urllib
import json
service = "http://pault.ag:8080/tail"
lastts = 0
def loop():
global lastts
while True:
f = urllib.urlopen("%s?since=%s" % (service, str(lastts)))
msgs = json.loads(f.read())
for x in msgs['messages']:
print x['text']
if lastts < x['timestamp']:
lastts = x['timestamp']
loop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment