From 10b7dcc3fa02c46a76f483b57d020e8d145ad530 Mon Sep 17 00:00:00 2001 From: David Trail Date: Sun, 18 Mar 2012 20:57:28 +0100 Subject: [PATCH] Always appears to return {} from conn regardless of id. Confused --- kill.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/kill.py b/kill.py index 551cbbf..3a17b31 100755 --- a/kill.py +++ b/kill.py @@ -52,16 +52,16 @@ for dat in deletion_ids: subreddit = dat['subreddit'] text = dat[u'body'][:20] - print '{time} {subreddit}: "{text}..."'.format(subreddit=subreddit, id=id, time=time, text=text) + print '{id}: {time} {subreddit}: "{text}..."'.format(subreddit=subreddit, id=id, time=time, text=text) # And now for the deleting conn = httplib.HTTPConnection('www.reddit.com') params = urllib.urlencode({ - 'id': dat['id'], + 'id': id, 'uh': modhash, 'api_type': 'json'}) conn.request('POST', '/api/del', params, headers) http = conn.getresponse() - if http.read() != '{}': - print '''Failed to delete "%s" (%s - %s - %s)''' % (text, id, time, subreddit) - break # Still in-testing + print http.read() + #print '''Failed to delete "%s" (%s - %s - %s)''' % (text, id, time, subreddit) + break sleep(2)