GithubHelp home page GithubHelp logo

infiny's Introduction

NOTE : ARCHIVING THE PROJECT

The project is going to be archived as I am not able to actively maintain it, and the whatsapp web code have changed a lot.

Infiny

WhatsApp Web automation using javascript

Current Stage

Can get and select chats by name

Usage

Open WhatsApp Web. Copy infiny script, select a chat with

selectContact("Mommy")

Then send a message to the contact with

sendMessage("Hey mommy, i can use the console!")

infiny's People

Contributors

akhilerm avatar benschza avatar nmasnadithya avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

infiny's Issues

Please explain the use properly

I am facing some trouble using the script. When I run the script, it redirects me to a blank page. Kindly describe how and where to call the defined functions. Thank You.

not all contacts are indexed

because web.whatsapp.com update dom every time we scroll. only 15-17 chat lists can be captured by getChatname(). to get all the contact list I have to shrink the zoom from body using,

document.body.style.zoom = '1%'

before_zoomed_out
this is the contact list before zooming out

after_zoomed_out
and this is the contact list after zooming out

but there is a bit of a problem. its chat view so not too readable. and when I zoomed the dom changed again. hence sometimes I fail to get the contact I mean because it is lost from the dom.

maybe you can get a better solution for this. thanks

Giving this error

When pasted on console dev tools it is showing

Uncaught TypeError: Cannot read property 'click' of null at <anonymous>:9:10

the css must have been changed when you created it hence now it works with following changes
var button = document.querySelector('button.compose-btn-send');

Is it still working?

WhatsApp rearranged quite some code on May 30th. The script doesn't work for me, could it be a div has to be updated?

button is null

Hi,

The code work partially for me.
SelectContact -> works.
SendMessage -> The text is received in the field, but fails to trigger the click event of the submit button.
I have made some modifications but I do not understand Java Script well.
Thanks if anyone can help

Code:

var jq = document.createElement('script');
jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);

contacts = [];
chat_div = [];

function triggerMouseEvent(node, eventType) {
var event = document.createEvent('MouseEvents');
event.initEvent(eventType, true, true);
node.dispatchEvent(event);
}

function getChatname(){
$("#pane-side > div > div > div").find("._2FBdJ > div._25Ooe").each(function(){
contacts.push($(this).text());
chat_div.push($(this));
})
}

function selectContact(name){
getChatname()
for (i = 0; i < contacts.length; i++){
if (name.toUpperCase() === contacts[i].toUpperCase()){
console.log(name.toUpperCase() + " match with "+contacts[i].toUpperCase())
triggerMouseEvent(chat_div[i][0],"mousedown")
}else{
console.log(name.toUpperCase() + " mismatch with "+contacts[i].toUpperCase())
}
}
}

function sendMessage(text){
$("#main > footer > div._3pkkz > div._1Plpp > div > div._2S1VP.copyable-text.selectable-text").text(text)
input = document.querySelector("#main > footer > div._3pkkz > div._1Plpp > div > div._2S1VP.copyable-text.selectable-text");
input.dispatchEvent(new Event('input', {bubbles: true}));
var button = document.querySelector('#main > footer > div._3pkkz > div._weEq5 > button');
button.click();
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.