scan-feeds: Accept a list of users

This commit is contained in:
Nelson Elhage 2010-05-24 15:21:03 -04:00
parent 8ff29c9bd7
commit fccb5948cf
1 changed files with 10 additions and 4 deletions

View File

@ -48,10 +48,16 @@ def parse_feeds(weeks, uri):
if post['url'] not in [p['url'] for p in weeks[wn]]: if post['url'] not in [p['url'] for p in weeks[wn]]:
weeks[wn].append(post) weeks[wn].append(post)
for (username, u) in users.items(): if len(sys.argv) > 1:
weeks = log.setdefault(username, []) for username in sys.argv[1:]:
for l in u['links']: weeks = log.setdefault(username, [])
parse_feeds(weeks, l[2]) 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: with open('out/report.yml', 'w') as f:
yaml.safe_dump(log, f) yaml.safe_dump(log, f)