Skip to content

Instantly share code, notes, and snippets.

@Shugabuga

Shugabuga/README.md

Last active May 9, 2018
Embed
What would you like to do?
Some Twitter DM experiment [Twitter Web // Full]

The Shittiest Twitter Bot™️

The code is a mess.

Limitations

  • Can only process one command every 0.5 seconds.
  • Your window must remained focus
  • You cannot use the computer the bot is running on.
  • Not totally autonomous: must be open on a specific DM thread to work.

How to Use

Just copy the JS code in shitty-twitter-dm-bot.js into your JavaScript console and abandon your computer. Use a phone to communicate instead or something.

License

Licensed under CC-0. Some form of attribution would be nice though.

console.info("Running the world's worst bot. RIP your computer.")
window.setInterval(()=>{
if(document.querySelectorAll("li:not(.DirectMessage--sent)>div>div>div>.DirectMessage-text>div>p")[document.querySelectorAll(".DirectMessage-text:not(.DirectMessage--sent)>div>p").length-1].innerHTML == "rng") {
document.querySelector(".DMComposer-editor>div").innerHTML = Math.round(Math.random()*100) + " is your random number. [bot]";
window.setTimeout((e)=>{
document.querySelector(".DMComposer-send>.EdgeButton").click();
},300);
console.info("Bot message sent -> rng");
} else if(document.querySelectorAll("li:not(.DirectMessage--sent)>div>div>div>.DirectMessage-text>div>p")[document.querySelectorAll(".DirectMessage-text:not(.DirectMessage--sent)>div>p").length-1].innerHTML == "owo") {
document.querySelector(".DMComposer-editor>div").innerHTML = "Please stop [bot]";
window.setTimeout((e)=>{
document.querySelector(".DMComposer-send>.EdgeButton").click();
},300);
console.info("Bot message sent -> owo");
} else if(document.querySelectorAll("li:not(.DirectMessage--sent)>div>div>div>.DirectMessage-text>div>p")[document.querySelectorAll(".DirectMessage-text:not(.DirectMessage--sent)>div>p").length-1].innerHTML == "Please stop [bot]") {
document.querySelector(".DMComposer-editor>div").innerHTML = "Stop impersonating me. :( [bot]";
window.setTimeout((e)=>{
document.querySelector(".DMComposer-send>.EdgeButton").click();
},300);
console.info("Bot message sent -> impersonate");
}
},500);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.