Skip to content

Instantly share code, notes, and snippets.

@emceeaich
Last active July 15, 2016 22:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emceeaich/9799c5b3ebd04df97c4c6022270fe087 to your computer and use it in GitHub Desktop.
Save emceeaich/9799c5b3ebd04df97c4c6022270fe087 to your computer and use it in GitHub Desktop.
Python Script to get Firefox Related Components
import json
import urllib2
import csv
fd = urllib2.urlopen("https://bugzilla.mozilla.org/rest/product?names=Core&names=Firefox&names=Toolkit&names=Firefox%20for%20iOS&names=Firefox%20for%20Android&type=selectable&include_fields=id,name,components,is_active")
d = json.load(fd)
components = []
for p in d['products']:
if not p['is_active']:
continue
for c in p['components']:
if not c['is_active']:
continue
component_data = {
'product_name': p['name'],
'component_name': c['name'],
}
components.append(component_data)
with open('firefox-components.csv', 'w') as csvfile:
fieldnames = ['product_name', 'component_name']
writer = csv.DictWriter(csvfile, fieldnames = fieldnames);
writer.writeheader();
for c in components:
writer.writerow(c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment