summaryrefslogtreecommitdiff
path: root/wikifolio-rss
blob: 5034dd7a2225fc5af60046ba17ea7f02515b91f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/python3
import os
import sys
import logging

import wikifolio
import wikifolio.rss
import os

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, _ = os.path.splitext(name)
    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))