Skip to content

Instantly share code, notes, and snippets.

@rchacon
Created November 23, 2016 05:26
Show Gist options
  • Save rchacon/6ee01bfbf5e3c1f86dfee2a20cba2c06 to your computer and use it in GitHub Desktop.
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
"""
$ 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