jan
05
Hi,
Free.fr is playing with us on http://live.free.fr: they added a MD5 checksum on the side of the space shuffle.
It seems that the checksum value changed twice already, so I built a little script that will fetch the page in an infinite loop looking for a new value.
#!/usr/bin/python
from httplib2 import Http
from re import compile
from time import sleep
URL = "http://live.free.fr"
USER_AGENT = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20100101 Firefox/7.0.12011-10-16 20:23:00"
REGEX = "^[\s]*.*([0-9a-f])[|\\\\].*$"
def fetch():
h = Http()
response, content = h.request(URL, headers = { 'User-Agent' : USER_AGENT })
return content
def parse(content, regex):
lines = content.split('\n')
ret = ""
for line in lines:
occurences = regex.findall(line)
ret += "".join(occurences)
return ret
if __name__ == "__main__":
latest_hash = ""
regex = compile(REGEX)
while 1:
current_page = fetch()
current_hash = parse(current_page, regex)
if (current_hash != "") and (current_hash != latest_hash):
print "New hash value!"
print current_hash
latest_hash = current_hash
sleep(60)

Debian/Ubuntu/Mint users can install httplib2 using the following command:
# sudo apt-get install python-httplib2
Or:
# sudo apt-get install python3-httplib2
Depending on which version of Python you’re running.