From 846255259bc03054e1b7ebe7d51a2ecd6fc06212 Mon Sep 17 00:00:00 2001 From: Christoph Korn Date: Sat, 9 Feb 2013 22:33:18 +0100 Subject: [PATCH] the-powder-toy.py: Get version from homepage an point to GitHub Unfortunately, the project does not use version numbers but build numbers as their git tags. So we have to search the version on the homepage and point to GitHub. This will 404 but at least we are on the correct site for the source code. The homepage seems to make some crazy OS guessing: In my browser there is: "Version 85.0 for Linux" but with python there is just "Version 85.0 for " (probably because of the missing user agent). --- the-powder-toy.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/the-powder-toy.py b/the-powder-toy.py index 0ed0793..257a598 100644 --- a/the-powder-toy.py +++ b/the-powder-toy.py @@ -2,10 +2,10 @@ import re import urllib2 import sys -h=urllib2.urlopen("https://github.com/FacialTurd/PowderToypp/tags").read() -v_finder=re.compile('Version (?P[\d\.]+) (?:.*)\(build (?P[\d]+)\)', re.M) +h=urllib2.urlopen("http://powdertoy.co.uk/Download.html").read() +v_finder=re.compile('Version (?P[\d\.]+) for (?:.*)', re.M) m=v_finder.finditer(h) if not m: sys.exit() for x in m: v=x.group("version") - print "%s"%(v,v) + print "%s"%(v,v)