Skip to content

Instantly share code, notes, and snippets.

@Joncom
Created March 19, 2015 21:46
Show Gist options
  • Save Joncom/32c95226c3d6a1c588cd to your computer and use it in GitHub Desktop.
Save Joncom/32c95226c3d6a1c588cd to your computer and use it in GitHub Desktop.
Dump Mitel MiCollab Web Client Messages
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