Created
April 9, 2014 18:46
-
-
Save nolanlawson/10302047 to your computer and use it in GitHub Desktop.
print_pouchdb_size.py
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
#!/usr/bin/env python | |
# | |
# Prints the pouchdb.min.js and gzipped file sizes for | |
# all PouchDB builds in the past several months. | |
# | |
import requests, zlib | |
def main(): | |
print 'Commit','GitHub link','Date','pouchdb.min.js size','gzipped size' | |
url = 'http://pouchtest.com/couchdb/pouchdb_builds/' | |
response = requests.get(url + '_design/by_timestamp/_view/by_timestamp', params={'include_docs' : True}).json() | |
for row in response['rows']: | |
js = requests.get(url + row['id'] + '/pouchdb.min.js').text.decode('utf8') | |
gzipped_js = zlib.compress(js) | |
print row['id'], 'https://github.com/pouchdb/pouchdb/commit/' + row['id'], row['doc']['date'], len(js), len(gzipped_js) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment