Created
November 23, 2016 05:26
-
-
Save rchacon/6ee01bfbf5e3c1f86dfee2a20cba2c06 to your computer and use it in GitHub Desktop.
Script to send text about status of time passes to NMAAHC for April to June 2017
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
""" | |
$ pip install pygooglevoice==0.5.2 requests | |
$ python timed_passes.py | |
""" | |
from googlevoice import Voice | |
import requests | |
URL = 'https://nmaahc.si.edu/visit/passes' | |
TEXT = 'We will announce soon when Advanced Timed Passes for April through June 2017 will be available.' | |
def passes_avail(): | |
resp = requests.get(URL) | |
if resp.ok: | |
return TEXT not in resp.text | |
return None | |
if __name__ == '__main__': | |
voice = Voice() | |
voice.login() | |
if passes_avail(): | |
voice.send_sms('5105555555', 'Yay. Timed Passes for April through June 2017 are available!') | |
else: | |
voice.send_sms('5105555555', 'Boo. Timed Passes for April through June 2017 are NOT available.') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment