|
|
@ -76,7 +76,7 @@ class MUCBot(slixmpp.ClientXMPP): |
|
|
|
# Save the image to the output folder |
|
|
|
url = msg['oob']['url'] # grep the url in the message |
|
|
|
filename = os.path.basename(url) # grep the filename in the url |
|
|
|
output_path = os.path.join(output, filename) |
|
|
|
output_path = os.path.join(self.output, filename) |
|
|
|
u = urllib.request.urlopen(url) # read the image data |
|
|
|
f = open(output_path, 'wb') # open the output file |
|
|
|
f.write(u.read()) # write image to file |
|
|
@ -101,9 +101,8 @@ class MUCBot(slixmpp.ClientXMPP): |
|
|
|
|
|
|
|
# Add message to log |
|
|
|
message = '<p class="message">{}</p>'.format(msg['body'].replace('@bot','')) |
|
|
|
output = self.output |
|
|
|
log = 'log.html' |
|
|
|
log_path = os.path.join(output, log) |
|
|
|
log_path = os.path.join(self.output, log) |
|
|
|
f = open(log_path, 'a+') |
|
|
|
f.write(message+'\n') |
|
|
|
f.close() |
|
|
|