Skip to content

Instantly share code, notes, and snippets.

@vedantk
Created January 12, 2011 06:23
Show Gist options
  • Save vedantk/775773 to your computer and use it in GitHub Desktop.
Save vedantk/775773 to your computer and use it in GitHub Desktop.
Why the hell do they have to delay this for so long...
#!/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