Last active
August 10, 2016 20:27
-
-
Save nikolaiwarner/b1e34e8c0aca120957c50d0e50ce33a4 to your computer and use it in GitHub Desktop.
bookmarklet to choose a random facebook comment
This file contains 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
// <3 Copy the code below and save as a bookmark. Then click the bookmark while on FB after loading a page with some comments: | |
javascript:(function(){ | |
var comments = document.getElementsByClassName("UFICommentContent"); | |
var randomComment = comments[Math.floor(Math.random() * comments.length)]; | |
var randomCommentName = randomComment.getElementsByClassName("UFICommentActorName")[0].textContent; | |
var randomCommentBody = randomComment.getElementsByClassName("UFICommentBody")[0].textContent; | |
alert(randomCommentName + ": " + randomCommentBody); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment