def firstImplementation(): bots = list() threads = list() for i in range(0, BOTS_N): a = omegleExtractor() bots.append(a) thread = Thread(target=startBot, args=(a, )) threads.append(thread) for t in threads: t.start() t.join() for t in threads: t.join() print( "==============================================================================================================" ) repFiles = saveReplies(bots) emotionsAndSentiments = analyze(repFiles) metrics = analytics.getMetrics(bots)
def firstImplementation(): """ Threads of bot, initializer. """ bots = list() threads = list() for i in range(0, BOTS_N): a = omegleExtractor() bots.append(a) thread = Thread(target=startBot, args=(a, )) threads.append(thread) for t in threads: t.start() t.join() for t in threads: t.join() print( "==============================================================================================================" ) # repFiles is an array with all files names repFiles = saveReplies(bots) emotionsAndSentiments = analyze(repFiles) metrics = analytics.getMetrics(bots)
t.join() for t in threads: t.join() print( "==============================================================================================================" ) # repFiles is an array with all files names repFiles = saveReplies(bots) emotionsAndSentiments = analyze(repFiles) metrics = analytics.getMetrics(bots) #saveMetrics( emotionsAndSentiments[0], emotionsAndSentiments[1], metrics, repFiles ) if __name__ == '__main__': telegram = telegramExtractor() omegle = omegleExtractor() threadTelegram = Thread(target=startBot, args=(telegram, )) threadTelegram.start() condition = threading.Condition() while (True): tradeTelegram = omegle.moti(telegram) # TELEGRAM NOTIFICATION # omegle.getTradeAccomplish() # Trade Accomplish to notify telegram if (tradeTelegram): # End of telegram conversation # Get telegram user replies print("========LOLACQUIRE==============") condition.acquire() print("========LOLTRADE==============") telegram.tradeAccomplish(condition) condition.wait()