From 58fd77499f6fca1d474584de311a502a0953fe91 Mon Sep 17 00:00:00 2001 From: Christoph Korn Date: Wed, 13 Apr 2016 21:07:35 +0200 Subject: [PATCH] xnviewmp.py: Add upstream watcher for XnView MP The version is not included in the tarball name. Only exists as text on the download page. So just parse the text. --- xnviewmp.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 xnviewmp.py diff --git a/xnviewmp.py b/xnviewmp.py new file mode 100644 index 0000000..ffb4e6a --- /dev/null +++ b/xnviewmp.py @@ -0,0 +1,11 @@ +#!/usr/bin/python +import re +import urllib2 +import sys +h=urllib2.urlopen("http://www.xnview.com/en/xnviewmp/").read() +v_finder=re.compile('Download XnView MP (?P[\d\.]+) :', re.M) +m=v_finder.finditer(h) +if not m: sys.exit() +for x in m: + v=x.group("version") + print "%s"%(v,v)