Skip to content

Instantly share code, notes, and snippets.

@jhubert
Created February 18, 2014 23:39
Show Gist options
  • Save jhubert/9082925 to your computer and use it in GitHub Desktop.
Save jhubert/9082925 to your computer and use it in GitHub Desktop.
Delete all the messages from the Hipchat message log that were sent from the expected sender
$('form').each(function(i, el){
var sender = $(this).parent().siblings('p').text().trim();
if (sender == 'Errbit') {
var data = 'action=delete';
data += '&message_id='+$(el).find('input[name="message_id"]').val();
data += '&xsrf_token='+$(el).find('input[name="xsrf_token"]').val();
data += '&message_index='+$(el).find('input[name="message_index"]').val();
$.ajax({
type: $(el).attr('method'),
url: $(el).attr('action'),
data: data
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment