GithubHelp home page GithubHelp logo

adarshsanjeev / whatsapi Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mukulhase/webwhatsapp-wrapper

0.0 3.0 0.0 23 KB

An API for sending and receiving messages over web.whatsapp

JavaScript 21.10% Python 78.90%

whatsapi's Introduction

[WIP] WhatsAPI (Based on web.whatsapp)

##Usage:

  • Import library

from webwhatsapp import WhatsAPIDriver

  • Instantiate driver and set username

driver = WhatsAPIDriver("mkhase")

  • If the module is to be used as part of a script, and you need an image of the QR code, run the firstrun method. This saves the QR as username.png in, stored in the same directory after running command.

driver.firstrun()

If not, you can skip the above step, and directly scan the QR with your phone.

  • And now, the fun part, sending messages.

driver.send(contact, message,[ entry]) OR driver.send_to_number(phonenumber, message)

If the entry parameter is not given, and there are multiple contacts which match the contact argument, they are returned as a list. To choose an entry out of the list, call the function, with the index of the contact as entry argument.

  • Viewing unread messages

driver.view_unread()

Incase a search for 'contact' yields multiple contacts, the list will be returned. To send the message to a specific person, call the function again, and pass the entry argument, and the message will be sent to that entry on the list

  • Callback on receiving messages

For scripting, to set a function to be called whenever a message is received, use the create_callback method, and pass as the only argument, a function. The function must accept an argument, which is the received messages as a list.

##Use Cases:

  • Auto Reply bot for whatsapp, “I am away from phone”
  • Can use whatsapp on phone and this api at the same time, (unlike the other whatsapp APIs, since this uses web.whatsapp)
  • No need for number registration
  • Hackathons, very easy to setup a whatsapp messaging service, just simple ajax requests!
  • API for custom bot making
  • Whatsapp cloud( A service):- -- User can access and send messages from anywhere without scanning qr anymore, just simple user login and password

Limitation:- Phone has to be ON and connected to the internet

whatsapi's People

Contributors

mukulhase avatar adarshsanjeev avatar

Watchers

James Cloos avatar  avatar  avatar

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.