Created
February 6, 2009 12:07
-
-
Save mattfoster/59370 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 python | |
# Grab the width of the macheist bar. | |
# Run using: | |
# while true; do sleep 60; python heist_parse.py >> heist_countdown; done | |
import urllib2 | |
import re | |
import time | |
from BeautifulSoup import BeautifulSoup | |
url='http://mainframe.macheist.com/' | |
page = urllib2.urlopen(url) | |
page = ''.join(page.readlines()) | |
soup = BeautifulSoup(page) | |
desc = soup.fetch('div',{'class':'progress'})[0]['style'] | |
print time.time(), '\t', re.search(r'^width: (.*)px$', desc).group(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment