import schedule
import requests
def send_auto_message():
resp = requests.post('https://textbelt.com/text', {
'phone': "yourPhoneNumber",
'message': 'Your message goes here',
'key': "YourAPIKey"})
print(resp.json()) # prints the status
# send_auto_message()
# the task is scheduled for everyday in the morning at 6:00
schedule.every().day.at("06:00").do(send_auto_message)
# practice schedule with a simple function
def this():
print("I am the scheduled task.")
schedule.every(2).seconds.do(this)
while True:
schedule.run_pending()
Comments
Post a Comment
Write something to CodeWithAbdur!