Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,6 @@ nosetests.xml
.project
.pydevproject
.ropeproject

# IDE
.idea
30 changes: 30 additions & 0 deletions how_rich.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env python

import time, requests, alpha_vantage, json, urllib
import ZeroSeg.led as led
from datetime import datetime

# cleanup before run
device = led.sevensegment(cascaded=2)
device.clear()

# set brightness to minimal
level = 1
device.brightness(level)

# check Zendesk stock price
def stock():
API_URL = "https://www.alphavantage.co/query"
symbols = ['ZEN']
for symbol in symbols:
data = { "function": "GLOBAL_QUOTE",
"symbol": symbol,
"datatype": "json",
"apikey": "YOUR_API_KEY" }
response = requests.get(API_URL, data)
data = response.json()
output = data["Global Quote"]["05. price"]
how_rich = float(output) * NUMBER_OF_STOCKS_HERE
device.write_text(1, str(how_rich))

stock()
1 change: 1 addition & 0 deletions info.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Try to create a new branch again
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
requests
alpha_vantage
30 changes: 30 additions & 0 deletions stock.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env python

import time, requests, alpha_vantage, json, urllib
import ZeroSeg.led as led
from datetime import datetime

# cleanup before run
device = led.sevensegment(cascaded=2)
device.clear()

# set brightness to minimal
level = 1
device.brightness(level)

# check Zendesk stock price
def stock():
API_URL = "https://www.alphavantage.co/query"
symbols = ['ZEN']
for symbol in symbols:
data = { "function": "GLOBAL_QUOTE",
"symbol": symbol,
"datatype": "json",
"apikey": "YOUR_API_KEY" }
response = requests.get(API_URL, data)
data = response.json()
output = data["Global Quote"]["05. price"]
output_filtered = output[:6]
device.write_text(1, " " + output_filtered)

stock()