File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import urllib3
22from twilio .rest import Client
3- import SendGmail as sg
3+ from mailtext import SendGmail as sg
44
55http = urllib3 .PoolManager ()
66
77content = http .request (method = "GET" , url = "https://www.lenovo.com/us/en/outletus/laptops/thinkpad/thinkpad-x-series/ThinkPad-X1-Carbon-5th-Gen/p/20HRX004US" )
88
99body = content .data .decode ('UTF-8' ).lower ()
1010
11- if ("out of stock" in body ):
11+ if ("out of stock" in body ):
1212 print ('It is out of stock' )
1313else :
1414 print ('It is in stock' )
15- sg .sendTMOSMS ()
15+ sg .sendTMOSMS ()
Original file line number Diff line number Diff line change 11import smtplib
22from email .mime .text import MIMEText
3+ import datetime
34
45if __name__ == "__main__" :
56 print ("In Main" )
7+ currentDT = datetime .datetime .now ();
8+ print ("Now is" + str (currentDT ))
69
710def sendTMOSMS ():
11+ currentDT = datetime .datetime .now ()
812
9- msg = MIMEText ("X1C Carbon In Stock!" )
13+ msg = MIMEText ("X1C Carbon In Stock! Time=" + str ( currentDT ) )
1014 msg ["Subject" ] = "X1C Carbon in Stock!"
1115 msg ["From" ] = "stealthsun@gmail.com"
1216 msg ["To" ] = "15082452331@tmomail.net"
1317
18+
19+
1420 print ("--- In Send TOM SMS. Before Sending Text ---" )
1521 gmail_user = 'stealthsun@gmail.com'
1622 gmail_password = 'cowgirlsm'
1723 server = smtplib .SMTP ("smtp.gmail.com" , 587 )
1824 server .ehlo ()
1925 server .starttls ()
2026 server .login (gmail_user , gmail_password )
21- #server.sendmail("stealthsun@gmail.com", "15082452331@tmomail.net", "X1C in Stock! 3:58PM")
2227 server .send_message (msg )
2328 server .close ()
2429 print ("--- In Send TOM SMS. After Sending Text ---" )
You can’t perform that action at this time.
0 commit comments