summaryrefslogtreecommitdiff
path: root/wikifolio-rss
diff options
context:
space:
mode:
authorYves Fischer <yvesf-git@xapek.org>2016-02-17 00:10:30 +0100
committerYves Fischer <yvesf-git@xapek.org>2016-02-17 00:10:30 +0100
commitd9a668312c152d4f64318010ec84340015d896bb (patch)
treebe85c9bc2da8d2f286f6ca680fdaa768934805b3 /wikifolio-rss
downloadwikifolio-rss-d9a668312c152d4f64318010ec84340015d896bb.tar.gz
wikifolio-rss-d9a668312c152d4f64318010ec84340015d896bb.zip
Import to git
Diffstat (limited to 'wikifolio-rss')
-rwxr-xr-xwikifolio-rss18
1 files changed, 18 insertions, 0 deletions
diff --git a/wikifolio-rss b/wikifolio-rss
new file mode 100755
index 0000000..e285f06
--- /dev/null
+++ b/wikifolio-rss
@@ -0,0 +1,18 @@
+#!/usr/bin/python3
+import os
+import sys
+import logging
+
+import wikifolio
+import wikifolio.rss
+
+logging.basicConfig(level=logging.INFO)
+
+if len(sys.argv) == 2 and os.path.exists(sys.argv[1]):
+ filename = sys.argv[1]
+ name = os.path.basename(filename)
+ name = name[:name.find('.')]
+ cert = wikifolio.get_id_from_name(name)
+ comments = wikifolio.get_comments(cert)
+ with open(filename, "w") as f:
+ f.write(wikifolio.rss.dump(cert, comments))