What is WhatsApp
WhatsApp Messenger is a cross-platform mobile messaging app which allows you to exchange messages without having to pay for SMS.
WhatsApp Messenger is available for iPhone, BlackBerry, Android, Windows Phone and Nokia and yes, those phones can all message each other! Because WhatsApp Messenger uses the same internet data plan that you use for email and web browsing, there is no cost to message and stay in touch with your friends.
Installing and Configuring Yowsup in ubuntu
Yowsup is a python library that enables you build application which use WhatsApp service. Yowsup has been used to create an unofficial WhatsApp client Nokia N9 through the Wazapp project which was in use by 200K + users as well as another fully featured unofficial client for Blackberry 10.
It act as a WhatsApp service under platforms like Linux, MAC and windows.
It act as a WhatsApp service under platforms like Linux, MAC and windows.
Yowsup Architecture
A running Yowsup is a stack of several layers. The previous figure is a breakdown of the core Yowsup stack. A layer is a bidirectional channel that transforms the data passing through it before passing it to underlying or the above layer.
Yowsup Installation
We need to install yowsup library, it enables you to send an messages using WhatsApp.
Before we need to setup configuration for yowsup.
First step, we need to install all the dependencies using the below command as the root user
> apt-get install python python-dateutil python-argparse python-dev python-setuptools
After installation of python, then download yowsup WhatsApi on github
> git clone https://github.com/tgalal/yowsupAfter download, go to inside the yowsup folder
> cd yowsupProvide permission to setup.py
> chmod +x setup.pyRun the following command
> python setup.py installAfter finish the installation complete, you can setup whatsapp configuation by
> chmod +x yowsup-cli
Yowsup-Cli
yowsup-cli is a command line interface to Yowsup library. It provides you with the options of registration, and provides a few demos such as a command line client
First you need to register using your phone number and password for setup the yowsup library.
> ./yowsup-cliThis above input provides the following results
Available commmands:
====================
demos, registration, versionThen you need to register your phone number using yowsup with the registration command
> ./yowsup-cli registration --requestcode sms --phone xxxxxxxx --cc 49 --mcc 24 --mnc 07You must be given your phone number with country code, for example 9196xxxxxx39 (In india country code is 91)
It provides the following output if the above command is correct. and you will receive whatsapp one time password.
INFO:yowsup.common.http.warequest:{"status":"sent","length":6,"method":"sms","retry_after":1805}Registration Option:
status: sent
retry_after: 1805
length: 6
method: sms
-m MCC, --mcc MCC Mobile Country Code. Check your mcc here: https://en.wikipedia.org/wiki/Mobile_country_codeThen you need to finish the registration by using the following command and provide OTP here.
-n MNC, --mnc MNC Mobile Network Code. Check your mnc from https://en.wikipedia.org/wiki/Mobile_country_code
-p PHONE, --phone PHONE Your full phone number including the country code you
defined in 'cc', without preceeding '+' or '00'
-C CC, --cc CC Country code. See http://www.ipipi.com/help/telephone-country-codes.htm.
./yowsup-cli registration --register 263-541 --phone 91xxxxxxx --cc 49
If the above command is correct, then you will get the following results in command
INFO:yowsup.common.http.warequest:{"status":"ok","login":"xxxxxxxxxxxxxxx","pw":"0pJj5cLaGSk6pDTa6rJR/5bDiR0=","type":"new","expiration":1471273284,"kind":"free","price":"0,89 \u20ac","cost":"0.89","currency":"EUR","price_expiration":1442376976}Here you need to note the password (pw). Just copy it and paste in vim editor.
status: ok
kind: free
pw: 0pJj5cLaGSk6pDTa6rJR/5bDiR0=
price: 0,89 €
price_expiration: 1442376976
currency: EUR
cost: 0.89
expiration: 1471273284
login: xxxxxxxxxxxxxx
type: new
Create the config file as following.
> vim yowsup-cli.confThen add content as follows
cc=49 #Your country code
phone=xxxxxxxxxxxx #Your phone number with country code 91(india)
id= #This is where you insert your IMEI number (not needed)
password=0pJj5cLaGSk6pDTa6rJR/5bDiR0= #your password which you got from registration command
Then save this file by using press Esc button and type !wq then enter to exit.
Then test your configuration by sending message by using the following command.
./yowsup-cli demos -c yowsup-cli.conf -s ************ “testing msg”******** is the receiver number.
Thats all.
If you facing an any issue, kindly let me know.
Thanks for reading our blog.
No comments:
Post a Comment