From d33d1f55bd91af45dab869310d0af514f9738029 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 10 Dec 2015 08:31:16 -0500 Subject: [PATCH] Created "smack_my_bitch_up" in php --- php/smack_my_bitch_up.php | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 php/smack_my_bitch_up.php diff --git a/php/smack_my_bitch_up.php b/php/smack_my_bitch_up.php new file mode 100644 index 0000000..f1fc68f --- /dev/null +++ b/php/smack_my_bitch_up.php @@ -0,0 +1,32 @@ +#!/usr/bin/env php +load(); + +(strpos(exec('who'), getenv('USER')) !== false) or exit('no session'); + +// Phone numbers +$my_number = '+xxx'; +$her_number = '+xxx'; + +$reasons = [ + 'Working hard', + 'Gotta ship this feature', + 'Someone fucked up the system again' +]; + +$rand = rand(0,count($reasons)-1); +$random_reason = $reasons[$rand]; + +$message = 'Late at work. '.$random_reason; + +// Send a text message +$twilio = new Services_Twilio(getenv('TWILIO_ACCOUNT_SID'), getenv('TWILIO_AUTH_TOKEN')); +$twilio->account->messages->sendMessage( + $my_number, + $her_number, + $message +); + +echo 'Message sent at: #'.date('Y-m-d').' | Reason: '.$random_reason;