Created
January 13, 2016 12:24
-
-
Save devopsmariocom/a81628b8b767bcd32a53 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
function pickWinner() { | |
const tweets = document.querySelectorAll('.tweet-text strong') | |
const winnerHash = tweets[Math.floor(Math.random() * tweets.length)]; | |
alert( '@' + winnerHash.parentElement.parentElement.parentElement.parentElement.querySelector('.username>b').innerText ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment