2
0
mirror of https://github.com/narkoz/hacker-scripts synced 2025-08-23 10:57:13 +00:00
hacker-scripts/python/smack_my_bitch_up.py

38 lines
839 B
Python
Raw Normal View History

2015-11-23 22:33:30 +03:00
#!/usr/bin/env python
import os
import random
from twilio.rest import TwilioRestClient
import subprocess
import sys
from time import strftime
# exit if no sessions with my username are found
output = subprocess.check_output('who')
if 'my_username' not in output:
sys.exit()
# returns 'None' if the key doesn't exist
TWILIO_ACCOUNT_SID = os.environ.get('TWILIO_ACCOUNT_SID')
TWILIO_AUTH_TOKEN = os.environ.get('TWILIO_AUTH_TOKEN')
# Phone numbers
2015-12-04 15:48:45 +01:00
my_number = '+xxx'
2015-11-23 22:33:30 +03:00
her_number = '+xxx'
reasons = [
'Working hard',
'Gotta ship this feature',
'Someone fucked the system again'
]
client = TwilioRestClient(TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN)
client.messages.create(
to=her_number,
from_=my_number,
2015-11-23 22:33:30 +03:00
body="Late at work. " + random.choice(reasons)
)
2015-11-26 13:23:38 +08:00
print "Message sent at " + strftime("%a, %d %b %Y %H:%M:%S")