]> gitweb.pimeys.fr Git - today.git/blobdiff - sagas.py
Modularisation++ : sagas.py pour xantah
[today.git] / sagas.py
diff --git a/sagas.py b/sagas.py
new file mode 100644 (file)
index 0000000..9e05694
--- /dev/null
+++ b/sagas.py
@@ -0,0 +1,18 @@
+#!/usr/bin/env python
+# -*- encoding: utf-8 -*-
+
+""" Récupération des sagas MP3 """
+
+import urllib
+import re
+
+def last_xantah():
+    p = urllib.urlopen("http://www.adoprixtoxis.com/lite/download/xantah_downloads.php")
+    t = p.read()
+    ids = re.findall("""<div class="top">Xantah (.*?)</div>""", t)
+    ids = [int(i) for i in ids]
+    return max(ids)
+
+functions = {
+    "xantah" : last_xantah
+    }