Created
February 24, 2012 00:07
-
-
Save benburton/1895967 to your computer and use it in GitHub Desktop.
Script that lets you know if you drink for free at Antarctica this month!
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/env python | |
import sys | |
import urllib2 | |
from lxml import etree | |
from pyquery import PyQuery as pq | |
if len(sys.argv) != 2: | |
print "Usage: ./antparse.py name" | |
else: | |
name = sys.argv[1] | |
d = pq(url = "http://antarcticabar.com/NameNight.html") | |
if d("font:contains('%s')" % name).length > 0: | |
print "It's your Ant month!" | |
else: | |
print "Better luck next time." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment