X-Git-Url: http://gitweb.pimeys.fr/?a=blobdiff_plain;ds=inline;f=today_server.py;h=ec60fe4ee9da16af02ca44b5266cc654507257d0;hb=4f4431b576ad8bc3012d9d6811ce1d215ff29743;hp=0c5016048f04f009ed06e71982598bbd0a1dd543;hpb=f858db9ed9baa860032d2777838aa029c0cb99b9;p=today.git
diff --git a/today_server.py b/today_server.py
index 0c50160..ec60fe4 100755
--- a/today_server.py
+++ b/today_server.py
@@ -24,13 +24,6 @@ import serverconfig
#: Récupération de toutes les nouveautés
import gather
-def last_xantah():
- p = urllib.urlopen("http://www.adoprixtoxis.com/lite/download/xantah_downloads.php")
- t = p.read()
- ids = re.findall("""
Xantah (.*?)
""", t)
- ids = [int(i) for i in ids]
- return max(ids)
-
def get_file():
"""Récupère la liste des derniers ids de chaque truc, stockée dans le fichier."""
f = open(serverconfig.store_published_file)
@@ -44,20 +37,6 @@ def update_file(news):
json.dump(news, f)
f.close()
-FETCHS = {
- "xantah" : last_xantah,
- }
-
-def fetch_all():
- """Va chercher sur les différents sites les nouveaux trucs."""
- news = {}
- for (k, f) in FETCHS.iteritems():
- try:
- news[k] = f()
- except Exception as e:
- raise
- news.update(gather.gather())
- return news
def sync():
"""Reçoit une requête de synchronisation."""
@@ -80,7 +59,7 @@ def sync():
if __name__ == "__main__":
DEBUG = ("--debug" in sys.argv) or ("--verbose" in sys.argv) or serverconfig.DEBUG
if sys.argv[1] == "check":
- news = fetch_all()
+ news = gather.gather()
if "--init" in sys.argv:
olds = news
else: