Created
January 24, 2019 19:46
-
-
Save ihack4falafel/11387e6ec4e6381802c50cbf0dc58449 to your computer and use it in GitHub Desktop.
Simple python script that sends a text message as soon as BH19 training page goes live!
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 | |
#Python script that send your phone number a text as soon as Black Hat 2019 training goes live using Twilio | |
#The script can be coupled with cronjob that runs every hour or whatever you may see fit | |
from twilio.rest import Client | |
import requests | |
account_sid = '<your Twilio account SID>' | |
auth_token = '<your Twilio authentication token>' | |
client = Client(account_sid, auth_token) | |
def Send(Message): | |
client.messages.create( | |
to='<your phone number>', | |
from_='<Twilio virtual phone number>', | |
body=Message, | |
) | |
def main(): | |
message = 'Blackhat 2019 training page is live! Go register now!!' | |
# test case | |
#r = requests.get('https://www.blackhat.com/us-18/training/') | |
r = requests.get('https://www.blackhat.com/us-19/training/') | |
print r.status_code | |
if r.status_code != 404: | |
Send(message) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment