Automation whatsapp DON'T use it for spam
$ git clone https://github.com/emichester/whatsapp_bot.git
$ cd whatsapp_bot
$ mkdir config && touch config/data.py
$ mkdir -p config/session && touch config/session/session.ini
$ touch messages.py
$ echo "
[SESSION]
session_id = ''
executor_url = ''
" > config/session/session.ini
$
$ chmod +x bot_whatsapp_firefox_init.py
$ chmod +x bot_whatsapp_firefox_instance.py
Go to your favorite web browser and find the user data folder, here you have the firefox default directory. Once you have it:
$ echo "USER_DATA_PATH = 'path/to/your/user/data/folder'" > config/data.py
Download "geckodriver" from here. Then:
$ tar -xvzf geckodriver*
$ chmod +x geckodriver
$ sudo mv geckodriver /usr/bin/
Define the messages you want to be sent by oppening messages.py
, look at the following example.
messages = {
'contact 1' : """
The message for the contact 1.
The last line will be sent alone as it has a \\n at the end of the line.
""",
'contact 2' : """This message will be sent all together because it doesn't have a endline character. This one also.""",
}
Open a bash (main bash) in the folder, install the requirements.txt and do the following.
$ ./bot_whatsapp_firefox_init.py
Scan the QR code (I couldn't automate this step), and in another bash.
$ ./bot_whatsapp_firefox_instance.py
Modify the instance for the purpose you want to use it.
IMPORTANT: to close the webdriver just press enter in the main bash, this will automatically close the webdriver. Or you can call the close_father_webdriver(drive) method to it.
See more about selenium here. And for the options: Firefox, Chrome, ...