So now the script send me a photo

This commit is contained in:
Stefano Assenzo 2023-01-29 16:01:53 +00:00 committed by GitHub
parent 74da1235b4
commit 931cf9975e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 8 deletions

5
app.py
View File

@ -37,11 +37,6 @@ def orario():
day = str(["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"])
return render_template('orario/orario.html', data=dict, number=number, day=day)
@app.route('/calendario')
def calendario():
logging.info("A user went up: Calendario")
return render_template('html/calendario.html')
if __name__ == '__main__':
logging.info("Web server started!")
app.run(port=4999, debug=True)

Binary file not shown.

After

Width:  |  Height:  |  Size: 125 KiB

View File

@ -1,5 +1,9 @@
from selenium.webdriver.firefox.options import Options # Selenium
from selenium import webdriver # Selenium
from dotenv import load_dotenv
from twilio.rest import Client
import time
import subprocess
import os
load_dotenv()
@ -10,6 +14,11 @@ PHONE_NUMBER_PERSONAL = os.getenv('PHONE_NUMBER_PERSONAL')
client = Client(SID, AUTH_TOKEN)
message = client.messages.create(to=PHONE_NUMBER_PERSONAL,
message = client.messages \
.create(
body="Test",
media_url=['IMAGE URL'],
from_=PHONE_NUMBER_BOT,
body="Hello from Python!")
to=PHONE_NUMBER_PERSONAL
)
print(message.sid)