Skip to content

Instantly share code, notes, and snippets.

@jwhitlock
Created May 22, 2015 19:37
Show Gist options
  • Select an option

  • Save jwhitlock/4c7a6012567559c8f054 to your computer and use it in GitHub Desktop.

Select an option

Save jwhitlock/4c7a6012567559c8f054 to your computer and use it in GitHub Desktop.
Gather unknown versions from web-platform-compat MDN import
#!/usr/bin/env python
"""Gather the unknown versions from a web-platform-compat MDN import
This assumes that data/import_issues_by_url.csv has been generated by
running tools/gather_import_issues.py.
The output is csv data that could be redirected to a file.
"""
import csv
import json
import sys
csv.field_size_limit(sys.maxsize)
version = []
with open('data/import_issues_by_url.csv') as f:
csv_reader = csv.reader(f)
first = True
for row in csv_reader:
if first:
first = False
continue
slug, url, issue, start, end, raw_params = row
params = json.loads(raw_params)
if issue == 'unknown_version':
version.append((
str(params['browser_id']), params['browser_slug'],
params['version']))
for v in version:
print ",".join(v)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment