Skip to content

Instantly share code, notes, and snippets.

@projectweekend
Last active January 2, 2016 07:59
Show Gist options
  • Save projectweekend/8273789 to your computer and use it in GitHub Desktop.
Save projectweekend/8273789 to your computer and use it in GitHub Desktop.
Since Facebook feels the need to capture stuff I do not choose to post, I'm going to have some fun with it! I don't have the time to type stuff into textareas all day, but this JavaScript snippet does. Go to your Facebook news feed, open up your browser's dev tools, paste this into console, and press enter.
var mySpecialMessage = "Suck It!";
var sendMySpecialMessage = function () {
var textareasOnPage = document.getElementsByTagName("textarea");
for (var i = 0; i < textareasOnPage.length; ++i) {
var item = textareasOnPage[i];
if (i % 2 == 0) {
item.value = mySpecialMessage;
} else {
// every odd cycle through loop, blank out the message
item.value = "";
}
}
console.log("Sending message: " + mySpecialMessage);
};
window.setInterval(function () { sendMySpecialMessage() }, 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment