From eebbe9ac22298d9398c5977acd519a2ee82c173b Mon Sep 17 00:00:00 2001 From: paulwalko Date: Wed, 2 Aug 2017 20:24:12 -0400 Subject: [PATCH] use actual bash --- modules/bash.py | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/modules/bash.py b/modules/bash.py index c6ff72e..e4d547a 100644 --- a/modules/bash.py +++ b/modules/bash.py @@ -5,7 +5,7 @@ author: paulwalko """ from threading import Thread -import os, sqlite3, time +import os, sqlite3, time, web queue = [] @@ -123,22 +123,15 @@ def bash(phenny, input): final_lines.append(line[0]) final_lines = ''.join(final_lines) - """Write quotes to file""" - files = os.listdir(phenny.bash_quotes_path) - files_num = [0] - new_file = '1.txt' - for f in files: - f = f.strip('.txt') - if f.isdigit(): - files_num.append(int(f)) - new_file = str(max(files_num) + 1) + '.txt' - new_path = os.path.join(phenny.bash_quotes_path, new_file) - with open(new_path, 'w') as f: - f.write(final_lines) - f.close() + quote_json = { + 'body': final_lines, + 'tags': '', + 'key': "SUPERSECRETAPIKEY" + } + web.post('https://bash.vtluug.org/quotes', quote_json) - phenny.say('%s: Check bash.walko.org to see your quote' % (input.nick)) + phenny.say('Check https://bash.vtluug.org/quotes to see your quote!') def logger(phenny, input): """logs EVERYTHING"""