X-Git-Url: http://gitweb.pimeys.fr/?a=blobdiff_plain;f=today_server.py;h=abff785e5a957ba29c5677d0d77cdaae9a94ced8;hb=87f6710ddca369461483de6b546c455c7d6e8de6;hp=598a421fad662ec52baac72f42786947ef21c305;hpb=b51baa9dd11477238323855734eeefd82145d5e5;p=today.git diff --git a/today_server.py b/today_server.py index 598a421..abff785 100755 --- a/today_server.py +++ b/today_server.py @@ -102,7 +102,7 @@ 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: + if "noob le film" in titre or "making of" in titre or "noob versus rct" == titre: continue try: if DEBUG: @@ -139,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.""" @@ -164,6 +172,7 @@ FETCHS = { "norman" : last_norman, "cyprien" : last_cyprien, "grenier" : last_grenier, + "dc" : last_jl8, } def fetch_all(): @@ -200,8 +209,11 @@ if __name__ == "__main__": DEBUG = True if sys.argv[1] == "check": news = fetch_all() - olds = get_file() - olds.update(news) + if "--init" in sys.argv: + olds = news + else: + olds = get_file() + olds.update(news) update_file(olds) elif sys.argv[1] == "whatsup": news = get_file()