Created
July 16, 2010 04:13
-
-
Save davidu/477913 to your computer and use it in GitHub Desktop.
Get tickets to the TechCrunch party.
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/python | |
### INSTRUCTIONS ### | |
# 1. Make sure techcrunch.py is executable. | |
# 2. Put the following two lines into cron... | |
# MAILTO="1234567890@mobile.mycingular.com" | |
# * * * * * /path/to/techcrunch.py | |
# 3. Turn off the cronjob after you get your tickets. | |
# 4. Say hi to David Ulevitch <david at opendns dot com> at the party. | |
import urllib2 | |
import re | |
from BeautifulSoup import BeautifulSoup | |
page = urllib2.urlopen("http://techcrunchsocialcurrencycrunchuandaugustcapitparty.eventbrite.com/") | |
soup = BeautifulSoup(page) | |
s = soup.find(attrs={'name' : "cost_9214327"}).findNext('b') | |
if s.string != 'Sold Out': | |
print "There are tickets to the TechCrunch Party! Buy them: http://bit.ly/d1AVi3" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I know there are much easier ways to do this. I just wanted to play with BeautifulSoup.