From: Nelson Elhage Date: Mon, 24 May 2010 19:21:03 +0000 (-0400) Subject: scan-feeds: Accept a list of users X-Git-Url: https://projects.mako.cc/source/iron-blogger/commitdiff_plain/fccb5948cff4ebd9d6407238eba681ac6d6d13a9 scan-feeds: Accept a list of users --- diff --git a/scan-feeds.py b/scan-feeds.py index bf60aef..82438bb 100755 --- a/scan-feeds.py +++ b/scan-feeds.py @@ -48,10 +48,16 @@ def parse_feeds(weeks, uri): if post['url'] not in [p['url'] for p in weeks[wn]]: weeks[wn].append(post) -for (username, u) in users.items(): - weeks = log.setdefault(username, []) - for l in u['links']: - parse_feeds(weeks, l[2]) +if len(sys.argv) > 1: + for username in sys.argv[1:]: + weeks = log.setdefault(username, []) + for l in users[username]['links']: + parse_feeds(weeks, l[2]) +else: + for (username, u) in users.items(): + weeks = log.setdefault(username, []) + for l in u['links']: + parse_feeds(weeks, l[2]) with open('out/report.yml', 'w') as f: yaml.safe_dump(log, f)