Skip to content

Instantly share code, notes, and snippets.

@benbrittain
Created October 24, 2014 20:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benbrittain/851041c83a9e6f9ea4d9 to your computer and use it in GitHub Desktop.
Save benbrittain/851041c83a9e6f9ea4d9 to your computer and use it in GitHub Desktop.
import urllib2
log = urllib2.urlopen('http://geneious.ginkgobioworks.com/log.txt').read().split("\n")
active_users = dict()
for line in log:
line = line.split(' ')
if len(line) > 4:
print(line)
time = line[0]
status = line[2]
user = line[4]
if status == "IN:":
active_users[user] = time
print("user: " + user)
elif status == "OUT:":
if user in active_users:
del active_users[user]
for user in active_users.keys():
print(user + " has been using geneious since " + active_users[user])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment