From 697853b825e28e55875b6c6b7517191bcfe84e40 Mon Sep 17 00:00:00 2001 From: omegafrost Date: Sun, 27 Nov 2016 10:44:06 -0200 Subject: [PATCH] Add more verbosity --- dislike.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/dislike.py b/dislike.py index c4ca4d0..0314228 100644 --- a/dislike.py +++ b/dislike.py @@ -81,8 +81,10 @@ def post(url, data): def login(): - username = input('Username') - password = getpass('Password') + username = input('Username: ') + password = getpass('Password: ') + + print('logging in... ', end='', flush=True) page = post('http://forum.outerspace.com.br/index.php?login/login', { "login" : username, @@ -94,9 +96,12 @@ def login(): }) if page.find('section visitorPanel') < 0: + print('failed!') print(page) raise Exception("Login failed!") + print('ok.') + ############################################################################### # ############################################################################### @@ -127,6 +132,8 @@ def dislike(posts): login() + print('going through %d posts...' % len(posts)) + for p in posts: # Posts or Profile posts @@ -157,7 +164,7 @@ def dislike(posts): else: raise Exception('Unknown option %s' % p) - print('-' if dislike_one(p) else '.', end='') + print('-' if dislike_one(p) else '.', end='', flush=True) ############################################################################### # Post list compressed using zlib and encoded in base 64