From 9513b3b79e39bcea54b32867cca47dd6167fb3c3 Mon Sep 17 00:00:00 2001 From: overflowerror Date: Mon, 23 Mar 2015 14:09:46 +0100 Subject: [PATCH] 140 char tweet limit --- main.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 6032dc3..cdf5015 100644 --- a/main.py +++ b/main.py @@ -132,7 +132,11 @@ if __name__ == "__main__": output = Popen(UPDATE_COMMANDS[command], shell=True, stdout=PIPE, stderr=STDOUT).stdout.read().decode("utf-8") if len(DESTINATION_ACCOUNTS): for username in DESTINATION_ACCOUNTS: - api.update_status(status = (username + " " + command + COMMAND_NAME_SEPERATOR + output)) + text = (username + " " + command + COMMAND_NAME_SEPERATOR + output) + while len(text) != 0 + api.update_status(status = text[:140]) + text = text[140:] + else: api.update_status(status = (command + COMMAND_NAME_SEPERATOR + output))