mirror of https://github.com/hak5/ToorChat.git
Websites working say what?
parent
714d3ff925
commit
a6c4150adc
14
toorchat.py
14
toorchat.py
|
@ -7,6 +7,7 @@ import atexit
|
||||||
from libtoorchat import *
|
from libtoorchat import *
|
||||||
from os import system
|
from os import system
|
||||||
import curses
|
import curses
|
||||||
|
import webbrowser
|
||||||
import time
|
import time
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
|
|
||||||
|
@ -36,12 +37,19 @@ def thread_run(visual):
|
||||||
if toor_message.type == ToorChatProtocol.get_web_response_type():
|
if toor_message.type == ToorChatProtocol.get_web_response_type():
|
||||||
# lets see if its the response were looking for
|
# lets see if its the response were looking for
|
||||||
if toor_message.xid == visual.request_xid:
|
if toor_message.xid == visual.request_xid:
|
||||||
print "here!"
|
|
||||||
find_message_in_website(toor_message, visual)
|
find_message_in_website(toor_message, visual)
|
||||||
if len(visual.website_buffer) == toor_message.last:
|
if len(visual.website_buffer) == int(toor_message.last)+1:
|
||||||
#sort messages
|
#sort messages
|
||||||
|
newlist = sorted(visual.website_buffer, key=lambda x: int(x.index), reverse=False)
|
||||||
|
os.remove('temp.html')
|
||||||
|
temp_file = open('temp.html', 'w')
|
||||||
|
total = ""
|
||||||
|
for item in newlist:
|
||||||
|
total += item.data
|
||||||
|
temp_file.write(total)
|
||||||
|
temp_file.close()
|
||||||
#Render website
|
#Render website
|
||||||
print "Winner winner chicken dinners!!"
|
webbrowser.get('firefox').open_new('temp.html')
|
||||||
|
|
||||||
except ChipconUsbTimeoutException:
|
except ChipconUsbTimeoutException:
|
||||||
pass
|
pass
|
||||||
|
|
Loading…
Reference in New Issue