Changed days to hours. Updated the readme. Added some helpful comments to the config file.

pull/5/head
David Trail 13 years ago
parent 58d50a07da
commit b9e121fec7

@ -8,6 +8,7 @@ Uses the reddit_api over at https://github.com/mellort/reddit_api to do all the
Usage Usage
----------- -----------
- Just run `./schreddit` - Just run `./schreddit`
- You may want to check out the reddit_api, build it using `python setup.py build` and then copy the /reddit directory to this directory. The reason I don't provide it is that the reddit_api changes frequently and I don't want to include a static old version here. I also don't want to have a git repo in a git repo.
Caveats Caveats
----------- -----------

@ -7,7 +7,7 @@ from datetime import datetime, timedelta
config = ConfigParser.RawConfigParser() config = ConfigParser.RawConfigParser()
config.read('shreddit.cfg') config.read('shreddit.cfg')
days = config.getint('main', 'days') hours = config.getint('main', 'hours')
whitelist = config.get('main', 'whitelist') whitelist = config.get('main', 'whitelist')
whitelist_ids = config.get('main', 'whitelist_ids') whitelist_ids = config.get('main', 'whitelist_ids')
sort = config.get('main', 'sort') sort = config.get('main', 'sort')
@ -22,7 +22,7 @@ r.login()
if verbose: if verbose:
print "Logged in as %s" % r.user print "Logged in as %s" % r.user
before_time = datetime.now() - timedelta(days=days) before_time = datetime.now() - timedelta(hours=hours)
if verbose: if verbose:
print "Deleting messages before %s" % before_time print "Deleting messages before %s" % before_time

@ -2,8 +2,13 @@
# or can be edited in the reddit_api [reddit] section # or can be edited in the reddit_api [reddit] section
[main] [main]
# How many days of comments you want to keep # How many hours of comments you want to keep
days = 2 # 24 hours in a day,
# 168 hours in a week,
# 672 hours in two fortnights,
# 720 hours in a month (30 days),
# 8766 hours in a year (365.25 days)
hours = 24
# Options: new, top, controversial, more? # Options: new, top, controversial, more?
sort = new sort = new
@ -25,4 +30,4 @@ item = overview
whitelist = AskScience, TheCulture, redditdev, programming, charity whitelist = AskScience, TheCulture, redditdev, programming, charity
# If you want any specific posts to be whitelisted stick 'em in here # If you want any specific posts to be whitelisted stick 'em in here
whitelist_ids = abcdef whitelist_ids = abcdef

Loading…
Cancel
Save