-
Notifications
You must be signed in to change notification settings - Fork 0
yowsup cli
yowsup-cli is a command line interface to Yowsup library. It provides you with the options of registration, reading/sending messages, and even engaging in an interactive conversation.
## Requirements * python 2.6+ * [python-dateutil](http://labix.org/python-dateutil) * [argparse](http://code.google.com/p/argparse/) for python < 2.7 ## Usageusage: yowsup-cli [-h] [-l | -s <phone> <message> | -i <phone>] [-w] [-a] [-k]
[-r (sms|voice) | -R code] [-c file] [-p] [-D] [-d] [-v]
yowsup-cli Command line options
optional arguments:
-h, --help show this help message and exit
-c file, --config file
Path to config file. Config file should contain full
phone number including country code without '+' or
'00', and Identity, separated by a colon. Identity is
the phone's IMEI if your account is setup on a Nokia
or Android device, or your phone's WLAN's MAC Address
for iphone devices. Example:
123456789:FF:FF:FF:FF:FF:FF
-p, --assumepassword Assume provided identity is the actual login password
-D, --dbus Start DBUS interface
-d, --debug Enable debug messages
-v, --version show program's version number and exit
Client options:
-l, --listen Listen to messages
-s <phone> <message>, --send <phone> <message>
Send message to phone number and close connection.
Phone is full number including country code, without
'+' or '00'
-i <phone>, --interactive <phone>
Start an interactive conversation with a contact.
Phone is full number including country code, without
'+' or '00'
-w, --wait If used with -s, then connection will not close until
server confirms reception of the message
-a, --autoack If used with -l or -i, then a message received ack
would be automatically sent for received messages
-k, --keepalive When used with -l or -i, Yowsup will automatically
respond to server's ping requests to keep connection
alive
Registration options:
-r (sms|voice), --requestcode (sms|voice)
Request the 3 digit registration code from Whatsapp.
-R code, --register code
Register account on Whatsapp using the provided 3
digit code
PhoneNumber:IMEI
or
PhoneNumber:MAC
If you are not able to obtain these info or using an unsupported phone, you might want to register first. To tell yowsup-cli about your config file, you just pass the path to that file using the -c switch. The config file is used everytime you login, in order to obtain your credentials, and during registration.
Registration is done through 2 steps similar to how it works on official Whatsapp clients. First you request a registration code from Whatsapp:
yowsup-cli --requestcode sms
The code will then be delivered to your phone number via your preferred method (sms/voice). Once you have obtained the code, you proceed with the 2nd step, which is to send that code using --register argument:
yowsup-cli --register 123
Your phone number and password are those stored in the config file specified by -c (see how your config file should look like)