Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
39 lines (25 sloc) 752 Bytes
#!/usr/bin/env python
import sys
import lxml.html
HOMEPAGE = 'http://www.brain-dump.org/projects/dvtm'
LATEST = '0.6'
def main():
tree = lxml.html.parse(HOMEPAGE)
if not tree:
print 'Failure to load home page'
return -1
tree = tree.getroot()
for elementelem, attr, link, pos in tree.iterlinks():
if not link.endswith('.tar.gz'):
continue
filename = link.replace('.tar.gz', '')
junk, version = filename.split('-')
# In theory, the first tarball link on the page should be the latest
# release
if not version == LATEST:
print 'New version!'
return 1
break
return 0
if __name__ == '__main__':
sys.exit(main())