Created
March 18, 2010 14:53
-
-
Save caferrari/336426 to your computer and use it in GitHub Desktop.
Ubuntu Lucid Lynx Beta 1 release checker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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