def register(beacon): payload = Beacon.jsonify_beacon(beacon) r = requests.post(REGISTER_URL, data=payload) if r.ok: print 'Registration successful!' else: print "Registration failed"
def pulse(beacon): while True: payload = Beacon.jsonify_beacon(beacon) print 'pulsing...' r = requests.post(LISTEN_URL, data=payload) time.sleep(2)