Created
January 4, 2016 18:27
-
-
Save adngdb/a8c999f2edaef93d0cdf to your computer and use it in GitHub Desktop.
This file contains hidden or 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
release beta aurora nightly | |
---------- --------- ------- -------- --------- | |
2014-12-25 69952943 1738103 66862 45328 | |
2014-12-26 79407038 2012413 75219 48960 | |
2014-12-27 74701774 1957618 68368 47283 | |
2014-12-28 73474760 1755038 67833 47795 | |
2014-12-29 94104371 2334070 88696 54151 | |
2014-12-30 90880260 2315405 87093 54051 | |
2014-12-31 76797584 2135065 75351 48533 | |
2015-01-01 69296349 1822021 65846 46986 | |
2015-01-02 83625497 2129676 79653 52032 | |
2015-01-03 76463162 2007495 71203 49951 | |
2015-12-25 62292164 1373476 75739 33169 | |
2015-12-26 64963136 1616455 75552 34076 | |
2015-12-27 66165040 1424934 76893 34635 | |
2015-12-28 88627883 2115395 101041 41165 | |
2015-12-29 87420090 2054037 100641 41229 | |
2015-12-30 85357262 2055078 98375 40489 | |
2015-12-31 70783101 1811839 73618 30956 | |
2016-01-01 62151734 1419538 64736 29123 | |
2016-01-02 69168360 1676594 70339 31057 | |
2016-01-03 70869246 1466451 71906 32073 |
This file contains hidden or 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
import requests | |
import datetime | |
from tabulate import tabulate | |
base_url = 'https://crash-analysis.mozilla.com/rkaiser/%(day)s/ff-%(channel)s-adu.csv' | |
channels = ('release', 'beta', 'aurora', 'nightly') | |
def fetch_adus(start, end): | |
adus = [] | |
while start <= end: | |
day = start.isoformat() | |
adu = [day] | |
for channel in channels: | |
url = base_url % ({'day': day, 'channel': channel}) | |
r = requests.get(url) | |
adu.append(r.text) | |
adus.append(adu) | |
start += datetime.timedelta(days=1) | |
return adus | |
if __name__ == '__main__': | |
start = datetime.date(2014, 12, 25) | |
end = datetime.date(2015, 1, 3) | |
adu_2014 = fetch_adus(start, end) | |
start = datetime.date(2015, 12, 25) | |
end = datetime.date(2016, 1, 3) | |
adu_2015 = fetch_adus(start, end) | |
output = [] | |
output.extend(adu_2014) | |
output.extend(adu_2015) | |
headers = [''] | |
headers.extend(channels) | |
print(tabulate(output, headers=headers)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment