Last active
August 16, 2017 18:23
-
-
Save kjaymiller/d92a63279350aa051fd137d6e2b39e09 to your computer and use it in GitHub Desktop.
Tweet Stormer created by kjaymiller - https://repl.it/KMRm/4
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
var text = prompt("Enter Your Tweet"); | |
var txt_split = text.match(/\(?[^\.\?\!]+[\.!\?]\)?/g); | |
txt_split = txt_split.map((e) => e.trim()); | |
txt_split; | |
var final_tweets = ['']; | |
for (i = 0, a = 0; a < txt_split.length;) { | |
if (txt_split[a].length + final_tweets[i].length < 135) { | |
final_tweets[i] = final_tweets[i] + txt_split[a]; | |
a++ | |
} | |
else { | |
i++; | |
final_tweets[i] = ''; | |
} | |
} | |
total_tweets = final_tweets.length; | |
for (i = 0; i < final_tweets.length ; i++) { | |
tweet_index = i + 1; | |
final_tweets[i] = tweet_index.toString() + "/" + total_tweets.toString() + " " + final_tweets[i]; | |
} | |
final_tweets; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment