Skip to content

Instantly share code, notes, and snippets.

@el3ment
Created May 10, 2014 23:11
Show Gist options
  • Save el3ment/a200058efd8a8b72bcdd to your computer and use it in GitHub Desktop.
Save el3ment/a200058efd8a8b72bcdd to your computer and use it in GitHub Desktop.
//SMS
var ourMessages = $('sms[address*="2094842514"]')
var csvData = "";
for(var i = 0; i < ourMessages.length; i++){
csvData += "" + $(ourMessages[i]).attr('body') + "|" + $(ourMessages[i]).attr('address') + "|" + $(ourMessages[i]).attr('type') + "|" + $(ourMessages[i]).attr('readable_date') + "|" + $(ourMessages[i]).attr('contact_name') + "<br>"
}
$('smses').html(csvData)
//Facebook
var ourMessages = $('div._50dw, div._5xjf')
var csvData = "";
var lastDate = "";
for(var i = 0; i < ourMessages.length; i++){
if($(ourMessages[i]).is('._5xjf'))
var lastDate = $(ourMessages[i]).text().replace(/2013 .*/, '2013').replace(/(st|nd|rd|th).*/, ', 2014');
else{
var date = new Date(lastDate);
csvData += "" + $(ourMessages[i]).text().replace("\"", "'") + " | " + ($(ourMessages[i]).is('._50kd') ? 'Brianne' : 'Robert') + " | " + date.getTime() + " | " + lastDate + " | " + $('._kso', ourMessages[i]).attr('title') + "<br>"
}
}
$('.fbNubFlyoutBodyContent').html(csvData)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment