Last active
December 23, 2015 18:49
-
-
Save beaugunderson/6678409 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python2.7 | |
| import json | |
| import sys | |
| try: | |
| log = json.loads(sys.stdin.read()) | |
| except: | |
| print "Couldn't parse." | |
| sys.exit(1) | |
| for message in log: | |
| try: | |
| print "%s %s: %s" % (message["date"], message["from"]["name"], | |
| message["message"]) | |
| except: | |
| print "Couldn't print message from %s" % message["from"]["name"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment