Skip to content

Instantly share code, notes, and snippets.

@rastalamm
Forked from jaywon/Ruh-Roh.md
Last active August 29, 2015 14:22
Show Gist options
  • Save rastalamm/0b9d73c49bc8d3064636 to your computer and use it in GitHub Desktop.
Save rastalamm/0b9d73c49bc8d3064636 to your computer and use it in GitHub Desktop.
Email Hell
var emailLog = require('./email_log.json');
//create a new empty object
var newList = {};
//loops through the object's array
for(var i = 1; i < emailLog.emails.length; i++){
//if the current email is not in the new object,
if(!newList.hasOwnProperty(emailLog.emails[i]['email']) ){
//set current email as varabile
var currentEmail = emailLog.emails[i]['email'];
//add it to the new object and give it the value of 1
newList[currentEmail] = 1;
//if the current email is in the new object
}else{
//set current email as variable
var currentEmail = emailLog.emails[i]['email'];
//add 1 to its counter
newList[currentEmail] += 1;
}
}
console.log(newList);
// (function emailList(){
// console.log('inside of a function');
// })();
{
"emails": [
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
},
{
"email": "[email protected]",
"sent": "Thu, 4 June 2015 23:04:49 GMT"
}
]
}

###Email Hell

We just found out that there is a bug in production that our e-mail function was iterating errantly and sending duplicate e-mails to many users. We need to fix this quickly but we don't want to send out a mass apology letter to all of our users.

Our sysadmin gave us the SMTP logs and we need to process the logs and identify which users received multiple e-mails so that we can directly send them a follow up e-mail explaining the situation and offer super cool swag to keep them on as customers.

Also, the boss wants this done ASAP, we don't have time to do this manually...HAAALLLLPPP!

###The Fix

Write a function that takes in the data below from our logs that has all the email addresses that were sent to and create a report of all of the e-mails and the number of times an e-mail was sent to them.

###The Gotcha

We're not sure when we'll get out a hotfix for the errant code so this may happen again. Can you write us an interface for doing this on our own so we don't have to bother you every time this happens? Thaaaaanks :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment