Quantcast
Channel: xda-developers - Android Software and Hacking General [Developers Only]
Viewing all articles
Browse latest Browse all 3614

[GUIDE] Send Whatsapp messages using Tasker

$
0
0
For a long time, I was looking the way to send automated Whatsapp messages using Tasker. Some days ago, I read a blog with the steps to run a Python Script (on Linux), and gave me the idea to test it on my HTC One using SL4A

I tried to use with SL4A, but it didn't work.. I had to modified the script (by trial and error.. Sorry I do not know Phyton).. And it WORKED!!!

All the credits goes to Tarek who created the yowsup-cli script: https://github.com/tgalal/yowsup/wiki/yowsup-cli

As you see, I'm not "an expert", but I wanted to share what I did with you .. Probably you could improve it a lot..

Prerequisites:
(I'm not going to explain how to install it):
SL4A ==> https://code.google.com/p/android-scripting/)
Phyton for Android ==> https://code.google.com/p/python-for...downloads/list (I use PythonForAndroid_r5.apk)
Tasker
Yowsup-cli ==> https://github.com/tgalal/yowsup/wiki/yowsup-cli
python-dateutil ==> http://labix.org/python-dateutil
Modified Scripts ==> Attachment 2426260
A phone number not registered on Whatsapp

STEPS:
1. Download Yowsup-cli, open the zip and copy the folders Yowsup and Examples on sl4a folder ( /sdcard/sl4a/scripts)
2. Download python-dateutil, open the tar and copy the folder dateutil on /sdcard/sl4a/scripts/Yowsup/Common
3. Download wa_scripts.rar, open and copy the _wa_code.py, _wa_reg.py, wa_send.py files on /sdcard/sl4a/scripts/
4. Open _wa_code.py modify these lines with your country code and phone number and save

countryCode = "58"
login = "584147777777"

You will ask a registration code on next step. It supposed to be sent by SMS. This could be a little bit frustrating because sometimes the SMS does not arrives. There are a lot of Issues reported of it (https://github.com/tgalal/yowsup/issues/147)
In my case, I tried with six different phone numbers until the first SMS arrived.

5. Open SL4A and run _wa_code.py script. It should send you a SMS code with this format (XXX-XXX). Copy the code without "-". You will use it on next step. It could take some time.
If you do not receive the SMS, could try with this https://coderus.openrepos.net/whitesoft/whatsapp_sms
Attachment 2426268

6. Register the code: open _wa_reg.py, modify these lines with your country code,phone number code , save and run.

countryCode = "58"
login = "584147777777"
code = "999999"

Attachment 2426269

7. If you successfully register, Whatsapp will generate a password for you, which will be displayed in the command output. Copy the pw (password) and paste on file

wa_send.py like this:

login = "584247777777"
phone = "584147777777"
message = "Test WhatsApp #1"
countryCode = "58"
method = "sms"
identity = ""
password = "MDAwMDAwMDAwMA=="

8. Now you could run wa_send.py script on SL4A to test if it works. It should be like this:

Attachment 2426270

9. create a task in Tasker like this:
Attachment 2426272 Attachment 2426275

Fill %phone and %text variables and you are ready to send the message.

I hope it works for you.. I use it to auto reply Whatsapps and all kind of schedule messages

Attached Thumbnails
Click image for larger version

Name:	2013-11-26 01.19.28.jpg
Views:	N/A
Size:	141.5 KB
ID:	2426268   Click image for larger version

Name:	2013-11-26 01.21.47.jpg
Views:	N/A
Size:	148.9 KB
ID:	2426269   Click image for larger version

Name:	2013-11-26 01.27.54.jpg
Views:	N/A
Size:	148.7 KB
ID:	2426270   Click image for larger version

Name:	2013-12-01 14.01.31.png
Views:	N/A
Size:	200.5 KB
ID:	2426272   Click image for larger version

Name:	2013-12-01 14.01.39.jpg
Views:	N/A
Size:	104.8 KB
ID:	2426275  

Attached Files
File Type: rar wa_scripts.rar - [Click for QR Code] (2.6 KB)

Viewing all articles
Browse latest Browse all 3614

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>