Skip to content

Instantly share code, notes, and snippets.

@alpeware
Last active May 24, 2017 10:17
Show Gist options
  • Save alpeware/e87b6baad5aa56b6a26062f9770f6e86 to your computer and use it in GitHub Desktop.
Save alpeware/e87b6baad5aa56b6a26062f9770f6e86 to your computer and use it in GitHub Desktop.
How to get the latest chrome versions from official Google Chrome PPA
# (c) 2017 Alpeware LLC
#
# curl -s https://dl.google.com/linux/chrome/rpm/stable/x86_64/repodata/other.xml.gz | gzip -df \
#| awk -F\" '/pkgid/{ sub(".*-","",$4); print $4": "$10 }'
#
# here's how to get the latest chrome versions in py
#
# result should be:
# versions.keys()
# ['google-chrome-stable', 'google-chrome-beta', 'google-chrome-unstable']
import httplib2
import zlib
import xml.etree.ElementTree as ET
h = httplib2.Http()
(resp, content) = h.request("https://dl.google.com/linux/chrome/rpm/stable/x86_64/repodata/other.xml.gz")
xml = zlib.decompress(content, 16+zlib.MAX_WBITS)
tree = ET.fromstring(xml)
versions = {}
for e in tree:
for i in e.getchildren():
versions[e.attrib['name']] = i.attrib['ver']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment