2
0
mirror of https://github.com/narkoz/hacker-scripts synced 2025-08-22 02:17:30 +00:00
hacker-scripts/smack_my_bitch_up.rb
Nihad Abbasov 136636071a Merge pull request #50 from Goldenson/patch-2
Update smack_my_bitch_up.rb
2015-11-27 16:07:15 +04:00

33 lines
685 B
Ruby
Executable File

#!/usr/bin/env ruby
# Exit early if no sessions with my username are found
exit unless `who -q`.include? ENV['USER']
require 'dotenv'
require 'twilio-ruby'
Dotenv.load
TWILIO_ACCOUNT_SID = ENV['TWILIO_ACCOUNT_SID']
TWILIO_AUTH_TOKEN = ENV['TWILIO_AUTH_TOKEN']
@twilio = Twilio::REST::Client.new TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN
# Phone numbers
my_number = '+xxx'
her_number = '+xxx'
reason = [
'Working hard',
'Gotta ship this feature',
'Someone fucked the system again'
].sample
# Send a text message
@twilio.messages.create(
from: my_number, to: her_number, body: "Late at work. #{reason}"
)
# Log this
puts "Message sent at: #{Time.now} | Reason: #{reason}"