X-Git-Url: http://gitweb.pimeys.fr/?p=today.git;a=blobdiff_plain;f=today_server.py;h=7e31652e9d049afb771de33c3857478d499db901;hp=120bd510d274915df19e60a832a8775753ba5bb5;hb=745bc217569cf2f81ecb74708c725b4ab53cdc25;hpb=7fe589dd1956cf47907d062105abee32db9dc0bf diff --git a/today_server.py b/today_server.py index 120bd51..7e31652 100755 --- a/today_server.py +++ b/today_server.py @@ -28,6 +28,9 @@ store_published_file = "lasts_published" #: Fichier où est stockée une copie de la liste des derniers IDs *lus* store_seen_file = "lasts_sync" +#: Afficher du garbage pour débuguer +DEBUG = False + def last_dtc(): """Vérifie si il y a des quotes DTC non lues""" return dtc.last_inserted() @@ -99,7 +102,11 @@ def last_noob_warpzone(): for serie in [noobs, warpzones]: # Les titres sont dans l'ordre antichronologique, on s'arrête donc au premier qu'on comprend for titre in serie: + if "noob le film" in titre or "making of" in titre: + continue try: + if DEBUG: + print titre saison, ep = get_season_episode(titre) except ValueError: pass @@ -132,6 +139,14 @@ def last_grenier(): titles = parse_youtube("joueurdugrenier") return len(titles) +def last_jl8(): + rss = urllib.urlopen("http://limbero.org/jl8/rss/") + t = rss.read() + x = etree.fromstring(t) + links = x.xpath("//link") + maxnum = links[1].text.split("/")[-1] + maxnum = int(maxnum) + return maxnum def get_file(): """Récupère la liste des derniers ids de chaque truc, stockée dans le fichier.""" @@ -157,6 +172,7 @@ FETCHS = { "norman" : last_norman, "cyprien" : last_cyprien, "grenier" : last_grenier, + "dc" : last_jl8, } def fetch_all(): @@ -189,6 +205,8 @@ def sync(): print json.dumps(on_server) if __name__ == "__main__": + if "--debug" in sys.argv or "--verbose" in sys.argv: + DEBUG = True if sys.argv[1] == "check": news = fetch_all() olds = get_file()