Example #1
0
        api.post_swipe(auth_token, device_id, event_id, timestamp, swipe)    
        api.create_identity(auth_token, swipe, zid)

print "Bark API Login"
username = raw_input("Username: "******"UNSW LDAP Login (Zid + Zpass). Don't get this wrong..."
zid = raw_input("Zid: ")
zpass = getpass.getpass()
ldap = LdapLookup(zid, zpass)

print "Connecting to serial reader"
reader = USBSerialReader()

auth_token = api.get_auth_token(username, password)

events = api.get_events(auth_token)
print 'Select Event:'
for x in range(len(events)):
    print str(x) + ': ' + events[x]['name']

event_number = int(raw_input())
event_id = events[event_number]['id']
print 'Event Id:', event_id

device_id = api.register_device(auth_token, event_id)
print 'Device Id:', device_id

while(True):
    act = raw_input('(s)wipe, (q)uit?')
 def __init__(self, username, password, verbose=False, offline=False):
     self.auth_token = bark_api.get_auth_token(username, password)
     self.offline = offline