monerosms-client/send.py

21 lines
502 B
Python
Raw Permalink Normal View History

2022-07-26 15:54:42 +00:00
import sys
import requests
from appconfig import base_url, user, proxies
def send_message(num):
if not num:
2022-12-06 20:17:09 +00:00
num = int(input("Enter number to text: "))
print("Enter the message to send, then EOF (Ctrl+D) to send")
2022-07-26 15:54:42 +00:00
body = ''
try:
for i in sys.stdin:
body += i
except KeyboardInterrupt:
return None
body = body.strip()
print('Sending...')
req = requests.post(f"{base_url}{user}/send/{num}", data=body, proxies=proxies)
return req