X-Git-Url: http://gitweb.pimeys.fr/?p=today.git;a=blobdiff_plain;f=today_server.py;h=1f53b0e9329ffabd7151eda15005ae98a1d89e76;hp=209dd04b0e6bbc39f50c244ddf9feea62e1dcf91;hb=c1d2f1bec93d0f0559de08b517a5f0c8b1dd2183;hpb=4f02e7921995656a95d60ad07985bf1fc57f7856 diff --git a/today_server.py b/today_server.py index 209dd04..1f53b0e 100755 --- a/today_server.py +++ b/today_server.py @@ -16,6 +16,7 @@ import os import sys import urllib import json +import traceback os.chdir('/home/vincent/scripts/today/') sys.path.append("/home/vincent/scripts/dtc/") import dtc @@ -37,14 +38,18 @@ def last_dtc(): return dtc.last_inserted() def last_xkcd(): - try: - p = urllib.urlopen("http://xkcd.com") - except IOError: - return "Impossible de se connecter à xkcd" + p = urllib.urlopen("http://xkcd.com") t = p.read() current_id = int(re.findall("Permanent link to this comic: http://xkcd.com/(.*?)/", t)[0]) return current_id +def last_xantah(): + p = urllib.urlopen("http://www.adoprixtoxis.com/lite/download/xantah_downloads.php") + t = p.read() + ids = re.findall("""