Skip to content

Instantly share code, notes, and snippets.

@jaredwilli
Last active November 8, 2017 00:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaredwilli/76f1c833ff95127aa859a56b03e11b3f to your computer and use it in GitHub Desktop.
Save jaredwilli/76f1c833ff95127aa859a56b03e11b3f to your computer and use it in GitHub Desktop.
Documentation for unmasking Pendo emails for Cloudlock NPS report
/**
* Cloudlock NPS report email address unmasking.
*
* Original DevTools snippet is here:
* https://gist.github.com/jaredwilli/013a74dbdd6d630a254ee1a12f08c2c8
*
* I have the above script saved as a DevTools snippet. For info on how to do that check this out:
* https://developers.google.com/web/tools/chrome-devtools/snippets
*
*
* 1. Export the NPS report to CSV file and open the file.
*
* 2. Copy the column containing the masked email addresses. The emails will look something like this:
* user-kdjhgkajkbkasg@ORGNAME.com
*
* 3. You can use an online comma delimter tool to help convert the list to an Array.
* Go to: https://delim.co/ and paste the copied list of email addresses into the form.
* 4. Change the settings so that it will output the emails so they have qoutes around them and a comma at the end of each line.
* Then copy the output once it looks good.
*
* 5. Open up Chrome DevTools console and paste the output in, and edit as needed to make it an Array.
* NOTE: Make a variable named 'a' and set the value of it to the Array of emails
* Make it something like this and run it in the console:
* var a = [
* 'user-adkjnadgkljsdk@example.com',
* 'user-ajdkgnoakdkfnka@another-example.co.uk
* ];
*
* 6. Hit enter to set it.
* 7. The paste the snippet below into the console and run it.
*/
var r = [];
for (var i = 0; i < a.length; i++) {
var email = a[i].split('user-')[1];
r.push(window.atob(email.split('@')[0]));
}
console.log(r);
copy(r);
/**
* This will:
* - loop over each email,
* - split out the `user-` which we added so it just has the email address
* - decrypt the part of the address to the left of the @ sign
* - and push them to an array
*
* The array is then logged to the console and automatically copied to the clipboard.
* All you have to do is create a new column in the CSV file and paste the result in by selecting the columns top cell.
*
* That's it!!
* Easy as 1 2 3 .... 4 5 ... 8 9 10 11.... lol
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment