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
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