forked from NARKOZ/hacker-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsmack_my_bitch_up.py
More file actions
executable file
·37 lines (29 loc) · 839 Bytes
/
smack_my_bitch_up.py
File metadata and controls
executable file
·37 lines (29 loc) · 839 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/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
my_number = '+xxx'
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,
body="Late at work. " + random.choice(reasons)
)
print "Message sent at " + strftime("%a, %d %b %Y %H:%M:%S")