Created
March 19, 2015 21:46
-
-
Save Joncom/32c95226c3d6a1c588cd to your computer and use it in GitHub Desktop.
Dump Mitel MiCollab Web Client Messages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery('.chat-session').each(function() { | |
var session = jQuery($(this)); | |
var other_name = session.find('.name').text(); | |
session.find('.chat-messages').each(function() { | |
var list = jQuery($(this)); | |
list.find('li').each(function() { | |
var list_item = jQuery($(this)); | |
for(var i=0; i<list_item.length; i+=2) { | |
var name = (list_item.hasClass('chat-incoming') ? other_name : 'Me'); | |
var headers = []; | |
list_item.children('.chat-message-header').each(function(){ | |
headers.push( jQuery($(this)).text() ); | |
}); | |
var entries = []; | |
list_item.children('.chat-message-entry').each(function(){ | |
entries.push( jQuery($(this)).text() ); | |
}); | |
for(var j=0; j<headers.length; j++) { | |
console.log(headers[j] + ' ' + name + ': ' + entries[j]); | |
} | |
} | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment