Created
July 14, 2011 20:47
-
-
Save davidu/1083406 to your computer and use it in GitHub Desktop.
How I get my tickets the TC 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. | |
# 5. Come to the OpenDNS 5 year birthday the night before: bit.ly/opendns-party | |
import urllib2, sys | |
from BeautifulSoup import BeautifulSoup | |
id = '11113455' #techcrunch party only | |
url = 'http://mobilefirstcrunchupandaugustcapitalparty2011.eventbrite.com/' | |
page = urllib2.urlopen(url) | |
soup = BeautifulSoup(page) | |
s = soup.find('input', attrs={'name':'cost_'+id}) | |
if s: | |
t = s.findNext('select', attrs={'name' : 'quant_'+id}) | |
if t: | |
print "There are tickets to the TechCrunch Party! http://bit.ly/iic8pj" | |
else: | |
sys.exit(1) | |
else: | |
sys.exit(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A line of amusing feedback...