Last active
June 26, 2017 23:06
-
-
Save mphasak/45855465cbd1d4338a207d33a6983747 to your computer and use it in GitHub Desktop.
BloomSky BitBar temperature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env PYTHONIOENCODING=UTF-8 /usr/local/Cellar/python/2.7.13/bin/python | |
import bloomsky_api | |
try: | |
bloomsky_key = "Your API key" | |
client = bloomsky_api.BloomSkyAPIClient(api_key=bloomsky_key) | |
data = client.get_data() | |
current_temp_int = int(round(data[0]['outdoor']['temperature'])) | |
current_temp_formatted = u'{0}\u00B0F'.format(current_temp_int) | |
print current_temp_formatted | |
except: | |
print u"\u2026" # ellipsis |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment