Skip to content

Commit

Permalink
Readme: Add instruction for CLI options
Browse files Browse the repository at this point in the history
  • Loading branch information
ananthanandanan committed May 16, 2020
1 parent 9e1fc89 commit 0624b30
Showing 1 changed file with 92 additions and 1 deletion.
93 changes: 92 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,99 @@ $ sudo mkdir /var/log/nawab

* Run the script
```
$ python3 nawab_bot.py
$ python3 nawab.py
```
### CLI Arguments

* The bot provides the user with arguments to input and use. To view all the arguments try:

```console
$ python3 nawab.py -h
usage: nawab.py [-r] [-b BLACKLIST] [-p PATH] [-V] [-s] [-h] [-v]

optional arguments:
-r, --retweet Retweet all tweets automatically, doesn't spawn a
telegram bot
-b BLACKLIST, --blacklist BLACKLIST
Blacklist the given username
-p PATH, --path PATH Path where the log files be stored. Note to create
directory in that path beforehand.
-V, --verbose
-s, --silent
-h, --help Show this help message and exit.
-v, --version Show program's version number and exit.

```
### Usage

#### -r --retweet
This argument enables the user to retweet the tweets automatically without use of telegram bot and only the view button will be visible in the bot. Note by default, if the argument is not provided, then both retweet and view button will be visible in the telegram bot from which user can retweet manually.

example:

```console
$ python3 nawab.py -r
```

#### -b blacklist
This argument when used, enables the user to input the usernames that they want to blacklist. The argument will take a list of usernames.

example:

```console
$ python3 nawab.py -b Macdonalds Agaro23
```
#### -p path
This argument when used, the user could change the path to the directory where they want to store the log files. Note that by default, the log files are store in the /var/log/nawab directory.

example:

```console
$ python3 nawab.py -p /home/user/nawab
```
#### -V --verbose
This argument when used, the logger will change to verbose mode ie; it will print all log messages onto console.

example:

```console
$ python3 nawab.py -V
INFO:05/12/2020 10:55:56 PM |starting new query search: #netsec
INFO:05/12/2020 10:55:58 PM |https://twitter.com/%&^^&^&/status/12****************60
INFO:05/12/2020 10:55:58 PM |Id: 12****************60is stored to the db from this iteration
INFO:05/12/2020 10:55:58 PM |starting new query search: #DNS
INFO:05/12/2020 10:56:00 PM |https://twitter.com/Ho----a/status/12****************90
INFO:05/12/2020 10:56:00 PM |Id: 12****************90 is stored to the db from this iteration
INFO:05/12/2020 10:56:00 PM |starting new query search: #DANE
INFO:05/12/2020 10:56:01 PM |https://twitter.com/b^%^%an/status/12****************29
INFO:05/12/2020 10:56:01 PM |Id: 12****************29 is stored to the db from this iteration
INFO:05/12/2020 10:56:01 PM |starting new query search: #DNSSEC
INFO:05/12/2020 10:56:03 PM |https://twitter.com/om$%$t/status/12****************76
INFO:05/12/2020 10:56:03 PM |Id: 12****************76 is stored to the db from this iteration
INFO:05/12/2020 10:56:03 PM |starting new query search: #QUIC

```
#### -s --silent
This argument when used, the logger will change to silent mode ie; it will not print any log message onto console.Note by default only error and warning messages gets logged to console.

example:

```console
$ python3 nawab.py -s

```

#### Argument type

| Parameter | Default/value |
| :------------------------ |:-------------:|
| -r --retweet | boolean |
|-b --blacklist | list |
| -p --path | string |
| -V, --verbose | 20(integer) |
| -s, --silent | 50(integer) |
| -h, --help | |
| -v, --version | |

## Developers
1. [Aniketh Girish](https://github.com/Aniketh01/)
Expand Down

0 comments on commit 0624b30

Please sign in to comment.