Skip to content

Commit

Permalink
xnviewmp.py: Add upstream watcher for XnView MP
Browse files Browse the repository at this point in the history
The version is not included in the tarball name.
Only exists as text on the download page.
So just parse the text.
  • Loading branch information
ckorn committed Apr 13, 2016
1 parent ed8ff74 commit 58fd774
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions xnviewmp.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://www.xnview.com/en/xnviewmp/").read()
v_finder=re.compile('Download <strong>XnView MP (?P<version>[\d\.]+) :</strong>', re.M)
m=v_finder.finditer(h)
if not m: sys.exit()
for x in m:
v=x.group("version")
print "<a href='http://www.xnview.com/en/xnviewmp/%s'>%s</a>"%(v,v)

0 comments on commit 58fd774

Please sign in to comment.