Created
January 26, 2009 00:48
-
-
Save johnboxall/52639 to your computer and use it in GitHub Desktop.
This file contains 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
# Official API: | |
>>> import api | |
>>> DA = api.DaApi() | |
>>> tree = DA.getTreeFromFile('DeviceAtlas.json') # What the juice? | |
>>> ua = 'SonyEricssonW850i/R1GB Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1' | |
>>> DA.getProperties(tree, ua) | |
{u'gprs': '1', u'mpeg4': '1', u'drmOmaForwardLock': '1', ... | |
# Awesome API: | |
>>> from deviceatlas import DeviceAtlas | |
>>> DA = DeviceAtlas(''DeviceAtlas.json') | |
>>> ua = 'SonyEricssonW850i/R1GB Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1' | |
>>> DA.device(ua) | |
{u'gprs': '1', u'mpeg4': '1', u'drmOmaForwardLock': '1', ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment