-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTracker.py
67 lines (47 loc) · 1.85 KB
/
Tracker.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import requests
from time import sleep
Sub = "BOT"
Body = "Your Cosmic byte keybrod price fell check out\nhttps://www.amazon.in/gp/product/B09MQZY875/ref=ox_sc_act_image_2?smid=A14CZOWI0VEHLG&psc=1"
Email = "[email protected]"
#Make Function For the sending mail to notify
def Email_alert(subject,body,to):
'''Impoet Some Librery For The perfoming'''
import smtplib
from email.message import EmailMessage
#Take Input for The Subjext Body And Emali For The Sender
msg = EmailMessage()
msg.set_content(body)
msg['subject'] = subject
msg['to'] = to
user = "[email protected]"
msg['from'] = user
password = 'nhscvtwijvmogtvg'
server = smtplib.SMTP("smtp.gmail.com",587)
server.starttls()
server.login(user,password)
server.send_message(msg)
server.quit()
#print('Source:')
#print('https://www.youtube.com/watch?v=B1IsCbXp0uE')
#print('for mobile Check Below link:')
#print('https://www.digitaltrends.com/mobile/how-to-send-a-text-from-your-email-account/')
#This is Amazon Price Api Thats Give the Price Data
import requests
url = "https://amazon-product-price-data.p.rapidapi.com/product"
querystring = {"asins":"B09MQZY875,B07PQYFPV8","locale":"IN"}
headers = {
"X-RapidAPI-Host": "amazon-product-price-data.p.rapidapi.com",
"X-RapidAPI-Key": "867fcb8387msh034f2da34f91894p1015dbjsn0af672c8f15a"
}
response = requests.request("GET", url, headers=headers, params=querystring)
while True:
Data = response.json()
title_venth = Data[0]['product_name']
Price_venth = Data[0]['current_price']
title_neon = Data[1]['product_name']
Price_neon = Data[1]['current_price']
if (Price_neon < 2199) or (Price_venth < 1950):
Email_alert(Sub,Body,Email)
else:
pass
sleep(43200)