Skip to content

Instantly share code, notes, and snippets.

@sbp
Created August 28, 2012 15:55
Show Gist options
  • Save sbp/3499391 to your computer and use it in GitHub Desktop.
Save sbp/3499391 to your computer and use it in GitHub Desktop.
Check Warcraft realm status, up or down
import re
import urllib
def status(name):
u = urllib.urlopen("http://www.mywowarmory.com/realmstatus.php")
bytes = u.read()
u.close()
search = re.search('(?i)(up|down).png[^>]*>' + name, bytes)
if search:
print "%s is %s" % (name, search.group(1))
else:
print "The status of %s is uncertain" % name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment