Created
May 10, 2014 23:11
-
-
Save el3ment/a200058efd8a8b72bcdd to your computer and use it in GitHub Desktop.
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
//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) | |
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