Last active
May 24, 2017 10:17
-
-
Save alpeware/e87b6baad5aa56b6a26062f9770f6e86 to your computer and use it in GitHub Desktop.
How to get the latest chrome versions from official Google Chrome PPA
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
# (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