├── .gitignore ├── Git PUSH Bot └── PUSH GITHUB.bat └── Send SMS ├── send_sms.js └── send_sms_script.py /.gitignore: -------------------------------------------------------------------------------- 1 | .env -------------------------------------------------------------------------------- /Git PUSH Bot/PUSH GITHUB.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | :repeat 4 | echo =================== 5 | echo START NEW GIT PUSH 6 | echo =================== 7 | set /p git_link="Enter the GitHub repository URL: " 8 | set /p lnk="Enter Link to Files: " 9 | 10 | cd %lnk% 11 | 12 | git init 13 | git add . 14 | git commit -m "#1" 15 | git branch -M main 16 | git remote add origin %git_link% 17 | 18 | echo =============== 19 | echo Processing... 20 | echo =============== 21 | 22 | git push -u origin main 23 | 24 | if %errorlevel% equ 0 ( 25 | echo Done! 26 | ) else ( 27 | echo Failed! 28 | ) 29 | echo ======= 30 | echo PUSHED. 31 | echo ======= 32 | pause 33 | 34 | goto repeat -------------------------------------------------------------------------------- /Send SMS/send_sms.js: -------------------------------------------------------------------------------- 1 | const { exec } = require('child_process'); 2 | 3 | function callPythonScript(message, messageTo) { 4 | return new Promise((resolve, reject) => { 5 | exec(`python send_sms_script.py "${message}" "${messageTo}"`, (error, stdout, stderr) => { 6 | if (error) { 7 | reject(error); 8 | } else { 9 | resolve(stdout); 10 | } 11 | }); 12 | }); 13 | } 14 | 15 | function handleApiResponse(response) { 16 | console.log("\nMessage Status\n========================\n\n") 17 | console.log(response); 18 | console.log("\n=======================\n") 19 | } 20 | 21 | 22 | const message = 'DATCH SMS from server'; 23 | const messageTo = '073XXXXXXX' 24 | 25 | callPythonScript(message, messageTo) 26 | .then(handleApiResponse) 27 | .catch(error => console.error('Error calling Python script:', error)); 28 | -------------------------------------------------------------------------------- /Send SMS/send_sms_script.py: -------------------------------------------------------------------------------- 1 | from dotenv import load_dotenv 2 | import requests 3 | import os 4 | import sys 5 | import json 6 | 7 | load_dotenv() 8 | 9 | message = sys.argv[1] if len(sys.argv) > 1 else 'Hello from DATCH' 10 | phone = sys.argv[2] if len(sys.argv) > 1 else '078XXXXXXX' 11 | 12 | username = os.getenv('USER_NAME') 13 | password = os.getenv('PASSWORD') 14 | sender = os.getenv('SENDER') 15 | 16 | data = { 17 | 'recipients': phone, 18 | 'message': message, 19 | 'sender': sender 20 | } 21 | 22 | r = requests.post( 23 | 'https://www.intouchsms.co.rw/api/sendsms/.json', 24 | data=data, 25 | auth=(username, password) 26 | ) 27 | 28 | response_json = json.dumps(r.json()) 29 | 30 | print(response_json, r.status_code) --------------------------------------------------------------------------------