Python

From BlackberryTracker

Jump to: navigation, search

Introduction

Release Date: 11/5/2007 Current Version: 0.1

Download Link: http://www.tech9computers.com/BBTracker-Python-0.1.tar.gz

Installation

wget http://www.tech9computers.com/BBTracker-Python-0.1.tar.gz
tar -xvzf BBTracker-Python-0.1.tar.gz
cd BBTracker-Python-0.1.tar.gz
python setup.py install

Example

Example of the Python API

This example prints all of your devices and their locations.

from bbtracker import BBTracker

bb = BBTracker('YOUR_API_KEY')
resp = bb.get_devices()
print '-------------------------'
for device in resp.devices:
    
    print "Device Name: " + device.name
    print 'Device ID: ' + str(device.id)
    
    try:
        resp = bb.get_location(device.id)
        print 'Latitude: ' + resp.location.latitude
        print 'Longitude: ' + resp.location.longitude
        print 'Elevation: ' + resp.location.elevation
        print 'Date: ' + resp.location.date
    except Exception, msg:
        print 'Location Error: ' + str(msg)
    
    print '-------------------------'
Personal tools