mirror of https://github.com/x89/Shreddit
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
437 B
17 lines
437 B
#!/usr/bin/env python2
|
|
|
|
import reddit
|
|
from datetime import datetime, timedelta
|
|
|
|
r = reddit.Reddit(user_agent="Shreddit-PRAW")
|
|
|
|
r.login()
|
|
|
|
before_time = datetime.now() - timedelta(days=7)
|
|
|
|
for comment in r.user.get_comments(limit=None, sort='new'):
|
|
now_time = datetime.fromtimestamp(comment.created)
|
|
if now_time < before_time:
|
|
print 'Deleting: [%s]: "%s"' % (comment.subreddit, comment.body[:20])
|
|
comment.delete()
|