- weeks[wn].append(dict(
- date=date,
- title=post.title,
- url=get_link(post)))
-
-for (username, u) in users.items():
- weeks = []
- print "[%s]" % (username)
- for l in u['links']:
- parse_feeds(weeks, l[2])
- log[username] = weeks
- for (i, w) in enumerate(weeks):
- print " [%d]: %s" % (i, w)
+
+ post = dict(date=date,
+ title=post.title,
+ url=get_link(post))
+ if post['url'] not in [p['url'] for p in weeks[wn]]:
+ weeks[wn].append(post)
+
+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])