Skip to content

Instantly share code, notes, and snippets.

@gboone
Created November 27, 2014 14:50
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 gboone/a9d0a103117ef1d399ea to your computer and use it in GitHub Desktop.
Save gboone/a9d0a103117ef1d399ea to your computer and use it in GitHub Desktop.
YOMYOFFICECLOSED
import requests
import os
url = 'http://www.opm.gov/json/operatingstatus.json'
yourl = 'https://api.justyo.co/yoall/'
yokey = os.environ['YO_KEY']
status = requests.get(url)
openclosed = status.json()['Icon']
if openclosed == u'Closed':
requests.post(yourl, data={'api_token': yokey, 'username': 'YOMYOFFICECLOSED', 'link': status.json()['StatusWebPage']});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment