-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.py
29 lines (24 loc) · 846 Bytes
/
main.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
import pandas_datareader as web
import time
from twilio.rest import Client
def send_sms(message):
account_sid = "Your ID From Twilio"
auth_token = "Auth Token From Twilio"
sending = 'Twilio Number'
reciving = 'Your Recinving Number' #Add your information
client = Client(account_sid, auth_token)
message = client.messages.create(
body=message,
from_=sending,
to=reciving
)
def get_stock_data(stock):
data = web.DataReader(stock, data_source='yahoo').iloc[-1]['Close']
return data
def main():
stocks = ["AAPL", "JPM", "GOOGL", "SBUX"] #You can change stock
for j in range(0,4):
data = get_stock_data(stocks[j])
send_sms("\n\nStock price of \n\n{} is {}\n\nSent by: S World Codes".format(stocks[j], data))
if __name__ == '__main__':
main()