Created
January 12, 2011 06:23
-
-
Save vedantk/775773 to your computer and use it in GitHub Desktop.
Why the hell do they have to delay this for so long...
This file contains 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/python2 | |
import time | |
import webbrowser | |
from datetime import datetime | |
import urllib2 as url | |
from BeautifulSoup import BeautifulSoup | |
site = "http://ftpcontent.worldnow.com/wdrb/news/closings.html" | |
def check(): | |
page = url.urlopen(site) | |
soup = BeautifulSoup(page) | |
orgs = soup.findAll("font", attrs={"class": "orgname"}) | |
reports = soup.findAll("font", attrs={"class": "status"}) | |
for i in xrange(len(orgs)): | |
if "jcps" in orgs[i].contents[0].lower(): | |
return reports[i].contents[0] | |
def process(s): | |
print datetime.now(), s | |
if "pending" not in s.lower(): | |
webbrowser.open("http://listen.grooveshark.com/#/s/Work+It/1MbCyl") | |
while True: | |
process(check()) | |
time.sleep(60 * 5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment