Skip to content

Commit

Permalink
the-powder-toy.py: Initial version
Browse files Browse the repository at this point in the history
Add an upstream watcher for the game "The Powder Toy".
http://powdertoy.co.uk/

The download link does not contain the version. The version
is only text on the page. This upstream watcher gets the version
and creates a download link for it. This link does not exist so
you get a 404. But at least you know where to look for the real
download link because the version is prefixed with the homepage URL.
  • Loading branch information
Christoph Korn committed Nov 9, 2012
1 parent 0ad6eb0 commit aa60f1e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions the-powder-toy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/python
import re
import urllib2
import sys
h=urllib2.urlopen("http://powdertoy.co.uk/").read()
v_finder=re.compile('<p class="extra-links">(?P<version>[\d\.]+) ', re.M)
m=v_finder.finditer(h)
if not m: sys.exit()
for x in m:
v=x.group("version")
print "<a href='http://powdertoy.co.uk/%s'>%s</a>"%(v,v)
1 change: 1 addition & 0 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ python gens-gs.py > gens-gs.html 2> gens-gs.log
python jag.py > jag.html 2> jag.log
python nikki.py > nikki.html 2> nikki.log
python legends.py > legends.html 2> legends.log
python the-powder-toy.py > the-powder-toy.html 2> the-powder-toy.log

0 comments on commit aa60f1e

Please sign in to comment.