Skip to content

Instantly share code, notes, and snippets.

@fcrespo82
Forked from viticci/DevCenter.py
Last active December 20, 2015 17:29
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 fcrespo82/5b9b35bc8a0a62c7ec1a to your computer and use it in GitHub Desktop.
Save fcrespo82/5b9b35bc8a0a62c7ec1a to your computer and use it in GitHub Desktop.
Check Apple DevCenter Status
from bs4 import BeautifulSoup
import requests
import console
import sys
import notification
url="https://developer.apple.com/support/system-status/"
console.show_activity()
resp = requests.get(url)
console.hide_activity()
html_doc = resp.text
soup = BeautifulSoup(html_doc)
console.clear()
console.set_font('Futura', 16)
down = 0
up = 0
for td in soup.find_all('td'):
if td['class'][0] == 'offline':
console.set_color(1, 0.5, 0)
down+=1
else:
console.set_color(0, 0, 0)
up+=1
print td.text
console.set_color(0, 0, 0)
print '_______________________'
console.set_color(1, 0.5, 0)
print 'Offline:',down
console.set_color(0, 0, 0)
print 'Online:',up
runagain = notification.schedule('Checking Dev Center Status', 21600, 'default', 'pythonista://DevCenter?action=run')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment