Skip to content

Instantly share code, notes, and snippets.

@jmaher
Created August 31, 2009 17:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jmaher/178605 to your computer and use it in GitHub Desktop.
Save jmaher/178605 to your computer and use it in GitHub Desktop.
mport simplejson, urllib
import types
tbox_url = 'http://tinderbox.mozilla.org/showbuilds.cgi?tree=Mobile&json=1&noignore=1'
logroot = "http://tinderbox.mozilla.org/showlog.cgi?log=Mobile/"
def search():
jsonurl = urllib.urlopen(tbox_url)
#Hack to remove the tinderbox_data = from the front
data = jsonurl.read().split("=", 1)
jsonurl.close()
#Hack to replace the " in the json with ', and replace the original ' with "
data = data[1].strip("\n; ").replace("\"", "\\\"").replace("'", "\"").replace("\\\"", "'")
result = simplejson.loads(data)
if 'Error' in result:
return "Error found in result"
return result
data = search()
build_table = data['build_table']
build = build_table[0]
print build
for build in build_table:
for b in build:
if type(b) == types.IntType:
pass
else:
for k in b:
if (k == "buildname"):
print b[k] + " : " + logroot + b['logfile'] + "&fulltext=1"
#if b['logfile'] doesn't exist, download, parse, and upload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment