Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sspeedy99/whatsapp-cli
Command line interface for whatsapp web for terminal.
https://github.com/sspeedy99/whatsapp-cli
cli selenium-webdriver whatsapp-chat whatsapp-web
Last synced: about 1 month ago
JSON representation
Command line interface for whatsapp web for terminal.
- Host: GitHub
- URL: https://github.com/sspeedy99/whatsapp-cli
- Owner: sspeedy99
- License: mit
- Created: 2019-06-02T19:58:37.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-06-11T07:43:50.000Z (over 5 years ago)
- Last Synced: 2024-10-01T00:24:11.972Z (about 2 months ago)
- Topics: cli, selenium-webdriver, whatsapp-chat, whatsapp-web
- Language: Python
- Size: 4.73 MB
- Stars: 16
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# whatsapp-cli
Command line interface of whatsapp web in the terminal (Unofficial).
This works with selenium-webdriver to login to whatsapp web interface and search the reciever name.### Features
- Send and receive messages to and from any contact/group in your WhatsApp *from command line*.
- Switch between different chats *from command line*.## Requirements
- [Python 3](https://www.python.org/downloads) Tested with 3.4.3, 3.6.1. **Python 2 will not work**
- [selenium](http://selenium-python.readthedocs.io/installation.html) Tested with 2.53.6, 3.4.2
- [ChromeDriver](https://sites.google.com/a/chromium.org/chromedriver/downloads) Tested with 2.24, 2.29
- [Chrome Web Browser](https://www.google.com/chrome/browser/desktop) compatible with the ChromeDriver version you downloaded. (Eg. ChromeDriver 2.29 supports Chrome v56-58) You can get this info from the ChromeDriver download page.## Installation
1. Clone this repository. `$ git clone https://github.com/sspeedy/whatsapp-cli.git`
2. Install virtualenv `$ sudo pip3 install virtualenv`
3. Create the virtual environment `$ virtualenv whatsapp`
4. Activate the virtual environment `$ source whatsapp/bin/activate`
5. Install selenium. `$ sudo pip3 install selenium`
6. Download and extract [ChromeDriver](https://sites.google.com/a/chromium.org/chromedriver/downloads).zip
7. Put path to ChromeDriver executable in the line `'chromedriver_path': '/path/to/chromedriver'` in `chat.py` file of this repository.## Related Repository
In order to not reinvent the wheel, some of the stuff and generic ideas are taken from here.
[WhatsApp Bot](https://github.com/harshirtsidhwa/WhatsApp-bot-selenium)## Usage
#### Start Chatting
`$ python chat.py `
1. Replace `` with the name of a contact or a group in your WhatsApp. Even partial names will work.
2. Scan the QR code displayed on screen from the WhatsApp mobile app.
3. Press `y` in console after WhatsApp Web is done loading, to connect your phone.#### Stop sending messages and only receive messages
`stopsending`
1. Type it while `chat.py` is running.
1. This will allow you to only see incoming messages. Your messages won't be sent. To send messages again, restart the script.#### Configuration
In `chat.py` file:
```
config = {
'chromedriver_path': '/path/to/chromedriver',
'get_msg_interval': 5, # Time (seconds). Recommended value: 5
'colors': True, # True/False. True prints colorful msgs in console
...
}
```#### Exit
Press `Ctrl+C` two times.
### Updates
To add Recent chats option.
Ability to see all the unread messages
Automate the activate using shell scripts### License
[MIT](https://choosealicense.com/licenses/mit/)