This repository has been archived by the owner on Mar 29, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from aahnik/dev
Release 0.5.0.beta
- Loading branch information
Showing
22 changed files
with
368 additions
and
337 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
whatsapp_web_url: https://web.whatsapp.com/ | ||
mBox: /html/body/div/div/div/div[4]/div/footer/div[1]/div[2]/div/div[2] | ||
mainScreenLoaded: ._3FRCZ | ||
searchSelector: .cBxw- > div:nth-child(2) | ||
whatsapp_web_url: 'https://web.whatsapp.com/' | ||
messageBox: '/html/body/div/div/div/div[4]/div/footer/div[1]/div[2]/div/div[2]' | ||
mainScreenLoaded: '._3FRCZ' | ||
searchSelector: '.cBxw- > div:nth-child(2)' | ||
person: '//*[@title="name"]' | ||
attach: '//span[@data-icon="clip"]' | ||
send: '//span[@data-icon="send"]' | ||
media: '//input[@accept="image/*,video/mp4,video/3gpp,video/quicktime"][@type="file"]' | ||
file: '//input[@accept="*"]' | ||
# Aahnik 2020 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
4 | ||
5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,33 +3,30 @@ | |
Wondering how to send WhatsApp messages using Python using only few lines of code? You have come to the right place! | ||
|
||
[![Tests](https://img.shields.io/badge/tests-passing-green)](https://aahnik.github.io/wappdriver/docs/Tests.html) | ||
[![Maintenance](https://img.shields.io/maintenance/yes/2020)](https://github.com/aahnik/wappdriver/graphs/commit-activity) | ||
[![GitHub Release](https://img.shields.io/github/v/release/aahnik/wappdriver)](https://github.com/aahnik/wappdriver/releases) | ||
[![CodeFactor](https://www.codefactor.io/repository/github/aahnik/wappdriver/badge)](https://www.codefactor.io/repository/github/aahnik/wappdriver) | ||
|
||
|
||
_`wappdriver` enables you to send WhatsApp messages programmatically, using only 3 lines of code._ | ||
|
||
**A python package that helps you automate sending messages through WhatsApp Web 😎** | ||
|
||
[![Maintenance](https://img.shields.io/maintenance/yes/2020)](https://github.com/aahnik/wappdriver/graphs/commit-activity) | ||
[![GitHub Release](https://img.shields.io/github/v/release/aahnik/wappdriver)](https://github.com/aahnik/wappdriver/releases) | ||
[![CodeFactor](https://www.codefactor.io/repository/github/aahnik/wappdriver/badge)](https://www.codefactor.io/repository/github/aahnik/wappdriver) | ||
|
||
### *🌟🌟 New* | ||
WappDriver now supports sending **images** , **videos**, **documents** and other file types... *[learn usage](https://aahnik.github.io/wappdriver/docs/Documentation.html)* | ||
|
||
|
||
### It's very simple to use | ||
|
||
```python | ||
import wappdriver as wa | ||
bot = wa.WappDriver() | ||
bot.send_message(to='aahnik',msg='Hi ! sent by a bot :-p ') | ||
# the recipients name must be saved in your contacts ... | ||
|
||
``` | ||
![wapp_driver_scrnsht](https://user-images.githubusercontent.com/66209958/90502857-2879a600-e16c-11ea-8f7f-7bbf2a993a13.png) | ||
![using wappdriver](docs/images/wappdriver.png). | ||
|
||
### How to install ?? | ||
|
||
``` | ||
pip3 install wappdriver | ||
pip install wappdriver | ||
``` | ||
For Mac and Linux, you may need to use `pip3`. | ||
|
||
[PyPI](https://pypi.org/project/wappdriver/) | ||
|
||
[![MIT LICENSE](https://img.shields.io/pypi/l/ansicolortags.svg)](/LICENSE) | ||
|
@@ -42,8 +39,6 @@ So **make sure to close any chrome tab which has WhatsApp Web open**. Not doing | |
- Your phone which is having that WhatsApp account, must stay connected to internet for WhatsApp Web to work | ||
|
||
|
||
|
||
|
||
### Requirements | ||
|
||
[![made-with-python](https://img.shields.io/badge/Made%20with-Python-1f425f.svg)](https://www.python.org/) | ||
|
@@ -58,24 +53,17 @@ I recommend to use the latest version of both, for the best performance. | |
|
||
### Documentation | ||
|
||
[Read](https://aahnik.github.io/wappdriver/docs/Documentation.html) the full Documentation. | ||
|
||
### Tests | ||
|
||
[Learn more](https://aahnik.github.io/wappdriver/docs/Tests.html) about testing. | ||
|
||
[Read](https://aahnik.github.io/wappdriver/docs/Documentation.html) the full Documentation to know about all the features. | ||
|
||
|
||
### Want to contribute ? | ||
|
||
Please look at [Code of Conduct](https://github.com/aahnik/wappdriver/blob/master/.github/CODE_OF_CONDUCT.md#contributor-covenant-code-of-conduct) and [Contributing Guidelines](https://github.com/aahnik/wappdriver/blob/master/.github/CONTRIBUTING.md#how-to-contribute-to-wappdriver-) | ||
|
||
Please read the explanation of the detailed working of `wappdriver` from the [Developer's Guide.](https://aahnik.github.io/wappdriver/docs/For_Developers.html) | ||
|
||
|
||
|
||
### Special Thanks to @VISWESWARAN1998 | ||
I learned a lot from his [repo](https://github.com/aahnik/Simple-Yet-Hackable-WhatsApp-api) and had initially started working on it. In future, due to certain requirements, I created a seperate repo, with a different working all together. | ||
|
||
### Help | ||
|
||
For _help_ you can **email me** at [[email protected]](mailto:[email protected]) or **chat** on [Telegram](https://t.me/AahnikDaw).You can expect a reply within 48 hours. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
__version__ = "0.3.2" | ||
__version__ = "0.5.0.beta" | ||
|
||
from .driver import WappDriver | ||
# from .context import Wapp | ||
from .data.local import set_chrome_driver_path, update_vars | ||
|
||
from .error import handle_errors | ||
from .driver import WappDriver | ||
from .whatsapp import category,WhatsApp | ||
# AAHNIK 2020 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,26 @@ | ||
from . import __version__ | ||
import argparse | ||
from pyfiglet import Figlet | ||
|
||
try: | ||
from pyfiglet import Figlet | ||
except Exception: | ||
print('''Could not find pyfiglet | ||
Run | ||
pip install pyfiglet | ||
''') | ||
|
||
|
||
def main(): | ||
parser = argparse.ArgumentParser() | ||
args = parser.parse_args() | ||
print(f'wappdriver: {__version__}') | ||
print(f''' | ||
wappdriver: {__version__} | ||
Command Line App is not availaible. | ||
Please Update wappdriver | ||
''') | ||
f = Figlet(font='big') | ||
print(f.renderText('wappdriver')) | ||
|
||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
''' | ||
The errors that occur during Data Handling are handled by the decorators defined in this module | ||
''' | ||
|
||
|
||
def handle_connection(func): | ||
def wrapper_func(*args): | ||
try: | ||
return func() | ||
except Exception as err: | ||
print(f''' | ||
----------------------------------- | ||
😞 | ||
Could not fetch data from Internet. | ||
Please check your connection | ||
{err} | ||
For help visit | ||
https://aahnik.github.io/wappdriver/docs/help.html | ||
----------------------------------- | ||
''') | ||
quit() | ||
return wrapper_func | ||
|
||
|
||
def handle_dependancy(func): | ||
def wrapper_func(*args): | ||
try: | ||
return func() | ||
except Exception as err: | ||
print(f''' | ||
----------------------------------- | ||
😞 | ||
Dependancies Missing | ||
{err} | ||
Please run | ||
pip install pyyaml requests | ||
And then try again | ||
For help visit | ||
https://aahnik.github.io/wappdriver/docs/help.html | ||
----------------------------------- | ||
''') | ||
quit() | ||
return wrapper_func |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,35 @@ | ||
'''This module remote.py provides access to remote. It fetches latest data from the internet''' | ||
|
||
import requests | ||
from .data_error import handle_connection, handle_dependancy | ||
|
||
|
||
@handle_dependancy | ||
def rqst(): | ||
import requests | ||
return requests | ||
|
||
|
||
prefix = 'https://raw.githubusercontent.com/aahnik/wappdriver/main/.github/' | ||
|
||
version_url = f'{prefix}ver' | ||
var_url = f'{prefix}var' | ||
|
||
|
||
@handle_connection | ||
def version(): | ||
''' | ||
Returns remote version | ||
''' | ||
return float(requests.get(url=version_url).text) | ||
ver = float(rqst().get(url=version_url).text) | ||
return ver | ||
|
||
|
||
@handle_connection | ||
def fetch_vars(): | ||
''' | ||
Returns the content of remote vars as a string | ||
''' | ||
return requests.get(url=var_url).text | ||
dynamic_vars = rqst().get(url=var_url).text | ||
return dynamic_vars | ||
|
||
|
Oops, something went wrong.