Created
February 8, 2018 09:08
-
-
Save osahyoun/6df904068881ad6ca42aea6e1e7c2f2c to your computer and use it in GitHub Desktop.
redirect.html
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
<script> | |
// Array of tweets | |
var tweets = ["Tweet 1","Tweet 2","Tweet 3"]; | |
var url = "https://twitter.com/intent/tweet?text="; | |
var tweet = tweets[Math.floor(Math.random() * tweets.length)]; | |
var content = encodeURIComponent(tweet); | |
window.location.href = url + content; | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment