sampleuserhere
Active member
Recently, a redditor in r/tasker shared a project to automate whatsapp with whatsmeow library. The library and the project itself work great in Tasker. I could send and receive the messages just fine.
github.com
github.com
Now, This is where it gets interesting. Upon inspecting the project, I got to know that the project uses a local server to communicate with the library. The workflow is simple, It posts JSON data to the server to send the messages. What does this mean?
We can send the message as well with Macrodroid using HTTP Request!
To be precise, the JSON data contains the accepted arguments for mdtest. They must be stored under "args" key as an array. Example, here's what I should write if I were to send a message via terminal.
Then, If I were to do the same stuff, the JSON data needs to be constructed like this.
Now, here's the query in action.
It was sent successfully!
Unfortunately, this is the only part I could interact directly with the local server. Receiving message and initiating the server ( It gets killed often ) requires Tasker to interact directly with the server. Technically it's running as tasker's process so that's to be expected.
However I can always forward every incoming messages via intent broadcast and I can also open up another port so Macrodroid can interact directly with Tasker via HTTP Request.
Now what's else can we do with this library besides sending and receiving message?
Tasker is not a must
You can always interact with mdtest via Termux. The redditor also shared the basic guide in the github page above, you can check them out. I haven't tried that yet though.
Closure
I personally find the project a good news in a way, so I'd like to share it to the community. Hopefully this post could shed some lights to those who seeks a way to automate WhatsApp fully in background. Cheers!
https://www.reddit.com/r/tasker/comments/15ydqa1
GitHub - HunterXProgrammer/Tasker-MdtestV5: Mdtest V5 - Sending WhatsApp messages from Tasker in Android. Also supports terminal (Termux).
Mdtest V5 - Sending WhatsApp messages from Tasker in Android. Also supports terminal (Termux). - HunterXProgrammer/Tasker-MdtestV5
GitHub - tulir/whatsmeow: Go library for the WhatsApp web multidevice API
Go library for the WhatsApp web multidevice API. Contribute to tulir/whatsmeow development by creating an account on GitHub.
Now, This is where it gets interesting. Upon inspecting the project, I got to know that the project uses a local server to communicate with the library. The workflow is simple, It posts JSON data to the server to send the messages. What does this mean?
We can send the message as well with Macrodroid using HTTP Request!
To be precise, the JSON data contains the accepted arguments for mdtest. They must be stored under "args" key as an array. Example, here's what I should write if I were to send a message via terminal.
Code:
cd "dir for mdtest"
./mdtest send number text
Then, If I were to do the same stuff, the JSON data needs to be constructed like this.
Code:
{"args":["send","number","text"]}
Now, here's the query in action.
It was sent successfully!
Unfortunately, this is the only part I could interact directly with the local server. Receiving message and initiating the server ( It gets killed often ) requires Tasker to interact directly with the server. Technically it's running as tasker's process so that's to be expected.
However I can always forward every incoming messages via intent broadcast and I can also open up another port so Macrodroid can interact directly with Tasker via HTTP Request.
Now what's else can we do with this library besides sending and receiving message?
- Mark as read
- Revoke messages
- Download Media Messages (New!)
Now includes downloading media like:-- Images
- Videos
- Audio
- Documents
- Status
- Contacts
- Link previews
- Location previews
- Mute/Unmute chats (New!)
- Pin/Unpin chats (New!)
- Archive/Unarchive chats (New!)
Tasker is not a must
You can always interact with mdtest via Termux. The redditor also shared the basic guide in the github page above, you can check them out. I haven't tried that yet though.
Closure
I personally find the project a good news in a way, so I'd like to share it to the community. Hopefully this post could shed some lights to those who seeks a way to automate WhatsApp fully in background. Cheers!
https://www.reddit.com/r/tasker/comments/15ydqa1