Skip to content

Commit

Permalink
Added start/stop scripts
Browse files Browse the repository at this point in the history
Signed-off-by: avaakash <[email protected]>
  • Loading branch information
avaakash committed Jan 8, 2022
1 parent 8ba330a commit 5879945
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
env
env.json
__pycache__
__pycache__
run_logs.txt
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ How to get Twitter API keys:

Give the tokens and keys to the env.json file (a sample is given, follow that naming convention only)
Run the main.py file and voila, now send any text to your telegram bot and it will tweet it
Or you can run the start.sh file to start a background process. And stop.sh to kill the process

Telegram bot commands
/start: displays a info message
Expand Down
7 changes: 7 additions & 0 deletions start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# !/bin/bash
echo $HOME
source "$HOME/tweet-from-message/env/bin/activate"
echo Starting Bot...
python main.py > run_logs.txt &
sleep 3
echo Bot started.
2 changes: 2 additions & 0 deletions stop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# !/bin/bash
kill -9 $(ps aux | grep "[p]ython main.py" | awk '{print $2}')

0 comments on commit 5879945

Please sign in to comment.