Created
September 14, 2016 13:19
-
-
Save pascalchevrel/5e2ca24d79a998acc1bcb0ba1dff0ee1 to your computer and use it in GitHub Desktop.
Script to check if an update to Nightly is available for a platform. Usage: nightlyUpdate.py en-GB win64
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/python | |
import sys | |
import urllib2 | |
import json | |
from datetime import datetime, timedelta | |
import sys | |
if (len(sys.argv) < 2): | |
locale = 'en-US' | |
platform = 'win64' | |
else: | |
locale = sys.argv[1] | |
platform = sys.argv[2] | |
# Build a fake build ID for yesterday | |
yesterday = datetime.now() - timedelta(days=1) | |
buildID = yesterday.strftime('%Y%m%d%H%M%S') | |
# Get the latest version number for Nightly | |
response = urllib2.urlopen('https://product-details.mozilla.org/1.0/firefox_versions.json') | |
version = json.load(response)["FIREFOX_NIGHTLY"] | |
# Variables to adjust | |
if platform == 'mac': | |
platformID = 'Darwin_x86_64-gcc3-u-i386-x86_64' | |
elif platform == 'linux': | |
platformID = 'Linux_x86_64-gcc3' | |
elif platform == 'win32': | |
platformID = 'WINNT_x86-msvc' | |
elif platform == 'win64': | |
platformID = 'WINNT_x86_64-msvc-x64' | |
else: | |
platformID = 'WINNT_x86-msvc' | |
url = 'https://aus5.mozilla.org/update/6/Firefox/' + version + '/' + buildID + '/' + platformID + '/' + locale + '/nightly/Windows_NT%2010.0.0.0%20(x64)/NA/default/default/update.xml?force=1' | |
response = urllib2.urlopen(url) | |
html = response.read() | |
print '== Check if there is an update for Firefox Nightly ==' | |
print '' | |
print 'Locale: ' + locale | |
print 'Version: ' + version | |
print 'Platform: ' + platform | |
print 'BuildID: ' + buildID | |
print 'url: ' + url | |
print '' | |
print html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment