Skip to content

Instantly share code, notes, and snippets.

@valioDOTch
Created August 10, 2016 23: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 valioDOTch/7d0df1887b0cef55e5ba360d62dd0420 to your computer and use it in GitHub Desktop.
Save valioDOTch/7d0df1887b0cef55e5ba360d62dd0420 to your computer and use it in GitHub Desktop.
Anonymize Facebook discussions
//for now this has to be entered via the console
//TODO make a bookmarklet out of it
var pattern = prompt("Input the name"),
re = new RegExp(pattern, "g");
document.body.innerHTML = document.body.innerHTML.replace(re,"Anon");
var imgs = document.querySelectorAll("img[alt='Anon']");
var array = Array.prototype.concat.call(imgs[0],[]);
for (var i = 0; i<imgs.length; i++) {
imgs[i].src = "https://www.facebook.com/rsrc.php/v2/yX/r/XUrzDRBrRPS.png";
}
@valioDOTch
Copy link
Author

TODO:

  • make a bookmarklet out of it
  • use canvas + base64 data encoding to create a downloadable image out of it (to be defined: how to select area that should be downloaded)
  • consider implementation of name selection / discussion detection
  • consider anonymizing multiple parties of a discussion (e.g. both sides in a bilateral one; all but oneself in a group discussion, etc)
  • consider allowing other replacers

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