Skip to content

Instantly share code, notes, and snippets.

@caferrari
Created March 18, 2010 14:53
Show Gist options
  • Save caferrari/336426 to your computer and use it in GitHub Desktop.
Save caferrari/336426 to your computer and use it in GitHub Desktop.
Ubuntu Lucid Lynx Beta 1 release checker
#!/usr/bin/python2.6
# -*- coding: utf-8 -*-#
import urllib2, hashlib, sys, pynotify
from time import sleep
url = 'http://cdimage.ubuntu.com/releases/lucid/'
md5_base = 'f67f811ea2bf1e0c14a233d319685f50'
pynotify.init("Ubuntu Lucid")
while (True):
try:
res = urllib2.urlopen(url)
if (res.getcode() == 200):
md5 = hashlib.md5(res.read()).hexdigest()
if (md5 == md5_base):
pynotify.Notification('Ubuntu Lucid Lynx', 'Ainda não lançou').show()
else:
pynotify.Notification('Ubuntu Lucid Lynx', 'Lançou! ' * 10).show()
sys.exit()
else:
print 'Erro de comunicação'
sleep(120)
finally:
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment