Skip to content

Commit 278bba3

Browse files
committed
Add date stamp
1 parent 3ff6ed7 commit 278bba3

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

mailtext/CheckX1C.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import urllib3
22
from twilio.rest import Client
3-
import SendGmail as sg
3+
from mailtext import SendGmail as sg
44

55
http = urllib3.PoolManager()
66

77
content = 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

99
body = 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')
1313
else:
1414
print ('It is in stock')
15-
sg.sendTMOSMS()
15+
sg.sendTMOSMS()

mailtext/SendGmail.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,29 @@
11
import smtplib
22
from email.mime.text import MIMEText
3+
import datetime
34

45
if __name__ == "__main__":
56
print ("In Main")
7+
currentDT = datetime.datetime.now();
8+
print ("Now is" + str(currentDT))
69

710
def 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 ---")

0 commit comments

Comments
 (0)