Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Python script to get the latest version number of Chrome from Google and compare it to the version of Chrome installed on the local Mac. Then updates an Extension Attribute in Jamf Pro with either 'Latest' or 'Old'.
import json
import urllib2
import os.path
import plistlib
url = ''
resp = urllib2.urlopen(url)
data = json.loads(
for each in data:
if each.get("os") == "mac":
versions = each.get("versions")
for version in versions:
if version.get("channel") == "stable":
latest = (version.get("current_version"))
print latest
print os.path.exists("/Applications/Google")
plistloc = "/Applications/Google"
pl = plistlib.readPlist(plistloc)
pver = pl["CFBundleShortVersionString"]
print pver
if latest == pver:
print "<result>Latest</result>"
print "<result>Old</result>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.