indexnotfound

Whatsapp Spam (Via Console)

Jan 23rd, 2019
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var allElementsClassName = "m6ZEb";
  2. var buttonSendClass = "._35EW6";
  3. var inputMessageClassName = "_2S1VP";
  4.  
  5. var timer = setInterval(general, 1000);
  6.  
  7. function general() {
  8.     if (document.getElementsByClassName(allElementsClassName)[0] != null) {
  9.         var item = document.getElementsByClassName(allElementsClassName)[0];
  10.         var element = item.cloneNode(true);
  11.         element.innerHTML = 'WhatsApp !!!!<div style="height: 110px; width: 100%;"> \
  12.                                <input type="text" id="inputMessage" placeholder="Message" style="margin-left: 10px; margin-top: 10px; width: calc(100% - 50px); height: 30px; padding-left: 10px"> \
  13.                                <hr style="border-color: white; color: #dbdbdb; background-color: #dbdbdb; border: none; height: 1px;"> \
  14.                                <div style="padding-left: 10px;"> \
  15.                                    <div data-icon="send" class="imgiconicon-send" style="cursor:pointer; height: 36px; display: inline-block; width: 100%;"> \
  16.                                        <input type="number" min="1" id="timesSend" placeholder="Number of text" style="width:50px;padding-left: 10px;max-width: 40%;width: 80%;height: 30px;margin-right: 10px;float:left;"> \
  17.                                        <button type="button" id="spam" style="background-color: transparent; color: transparent;"> \
  18.                                            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="36" height="36" style="display: inline"> \
  19.                                                <path opacity=".4" d="M1.101 21.757L23.8 12.028 1.101 2.3l.011 7.912 13.623 1.816-13.623 1.817-.011 7.912z"></path> \
  20.                                            </svg> \
  21.                                        </button> \
  22.                                    </div>  \
  23.                                </div> \
  24.                            </div>';
  25.         item.appendChild(element);
  26.         console.log("Ready 💣 . . .");
  27.         document.getElementById("spam").addEventListener("click", spam);
  28.         clearInterval(timer);
  29.     } else {
  30.         console.log("Waiting for whatsapp to load...");
  31.     }
  32. }
  33.  
  34. function dispatch(input, message) {
  35.     var evt = new InputEvent('input', {
  36.         bubbles: true
  37.     });
  38.     input.innerHTML = message;
  39.     input.dispatchEvent(evt);
  40.     document.querySelector(buttonSendClass).click();
  41. }
  42.  
  43. function spam() {
  44.     var text = document.getElementById("inputMessage").value;
  45.     var reps = document.getElementById("timesSend").value;
  46.     var input = document.getElementsByClassName(inputMessageClassName + " copyable-text selectable-text")[0];
  47.     var counter = 1;
  48.     while (counter <= reps) {
  49.         dispatch(input, text);
  50.         counter++;
  51.     }
  52. }
Add Comment
Please, Sign In to add comment