File tree Expand file tree Collapse file tree 2 files changed +8
-27
lines changed Expand file tree Collapse file tree 2 files changed +8
-27
lines changed Original file line number Diff line number Diff line change 33# Skip on weekends
44exit if Time . now . saturday? || Time . now . sunday?
55
6- log_file_name = File . dirname ( __FILE__ ) + '/logs/hangover.txt'
7-
8- # Be sure that logs dir always exists
9- Dir . mkdir ( 'logs' ) unless File . exists? ( log_file_name )
10-
11- LOG_FILE = File . open ( log_file_name , 'a+' )
12-
136# Exit early if sessions with my username are found
147exit if `who -q` . include? ENV [ 'USER' ]
158
2720my_number = '+xxx'
2821number_of_boss = '+xxx'
2922
30- excuses = [
23+ excuse = [
3124 'Locked out' ,
3225 'Pipes broke' ,
3326 'Food poisoning' ,
3427 'Not feeling well'
35- ]
28+ ] . sample
3629
3730# Send a text message
3831@twilio . messages . create (
3932 from : my_number , to : number_of_boss ,
40- body : ' Gonna work from home. ' + excuses . sample
33+ body : " Gonna work from home. #{ excuse } "
4134)
4235
4336# Log this
44- LOG_FILE . puts ( "Message sent at: #{ Time . now } " )
45- LOG_FILE . close
37+ puts "Message sent at: #{ Time . now } | Excuse: #{ excuse } "
Original file line number Diff line number Diff line change 33# Skip on weekends
44exit if Time . now . saturday? || Time . now . sunday?
55
6- log_file_name = File . dirname ( __FILE__ ) + '/logs/smack_my_bitch_up.txt'
7-
8- # Be sure that logs dir always exists
9- Dir . mkdir ( 'logs' ) unless File . exists? ( log_file_name )
10-
11- LOG_FILE = File . open ( log_file_name , 'a+' )
12-
136# Exit early if no sessions with my username are found
147exit if `who -q` . include? ENV [ 'USER' ]
158
2720my_number = '+xxx'
2821her_number = '+xxx'
2922
30- reasons = [
23+ reason = [
3124 'Working hard' ,
3225 'Gotta ship this feature' ,
3326 'Someone fucked the system again'
34- ]
35-
36- sample = reasons . sample
27+ ] . sample
3728
3829# Send a text message
3930@twilio . messages . create (
40- from : my_number , to : her_number , body : ' Late at work. ' + sample
31+ from : my_number , to : her_number , body : " Late at work. #{ reason } "
4132)
4233
4334# Log this
44- LOG_FILE . puts ( "Message sent at: #{ Time . now } " )
45- LOG_FILE . puts ( "Reason: #{ sample } " )
46- LOG_FILE . close
35+ puts "Message sent at: #{ Time . now } | Reason: #{ reason } "
You can’t perform that action at this time.
0 commit comments