Skip to content

Instantly share code, notes, and snippets.

@mphasak
Last active June 26, 2017 23:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mphasak/45855465cbd1d4338a207d33a6983747 to your computer and use it in GitHub Desktop.
Save mphasak/45855465cbd1d4338a207d33a6983747 to your computer and use it in GitHub Desktop.
BloomSky BitBar temperature
#!/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