Skip to content

Instantly share code, notes, and snippets.

@osahyoun
Created February 8, 2018 09:08
Show Gist options
  • Save osahyoun/6df904068881ad6ca42aea6e1e7c2f2c to your computer and use it in GitHub Desktop.
Save osahyoun/6df904068881ad6ca42aea6e1e7c2f2c to your computer and use it in GitHub Desktop.
redirect.html
<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