Created
July 26, 2017 18:04
-
-
Save laurenancona/cde3e96a9b0ba58c327acef2ff637fc9 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
Agent.receive = function() { | |
var self = this; | |
var events = this.incomingEvents(); | |
// emailPattern from http://stackoverflow.com/a/1373724/123776 | |
var emailPattern = /[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/gi; | |
events.forEach(function(event) { | |
event.payload['q3_whatWould'] = event.payload['q3_whatWould'].replace(emailPattern, '***@***.***'); | |
event.payload['q4_whatNeighborhood'] = event.payload['q4_whatNeighborhood'].replace(emailPattern, '***@***.***'); | |
self.createEvent(event.payload); | |
}); | |
} | |
// TODO: add phone number, SSID filters |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment