File tree 2 files changed +8
-27
lines changed
2 files changed +8
-27
lines changed Original file line number Diff line number Diff line change 3
3
# Skip on weekends
4
4
exit if Time . now . saturday? || Time . now . sunday?
5
5
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
-
13
6
# Exit early if sessions with my username are found
14
7
exit if `who -q` . include? ENV [ 'USER' ]
15
8
27
20
my_number = '+xxx'
28
21
number_of_boss = '+xxx'
29
22
30
- excuses = [
23
+ excuse = [
31
24
'Locked out' ,
32
25
'Pipes broke' ,
33
26
'Food poisoning' ,
34
27
'Not feeling well'
35
- ]
28
+ ] . sample
36
29
37
30
# Send a text message
38
31
@twilio . messages . create (
39
32
from : my_number , to : number_of_boss ,
40
- body : ' Gonna work from home. ' + excuses . sample
33
+ body : " Gonna work from home. #{ excuse } "
41
34
)
42
35
43
36
# 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 3
3
# Skip on weekends
4
4
exit if Time . now . saturday? || Time . now . sunday?
5
5
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
-
13
6
# Exit early if no sessions with my username are found
14
7
exit if `who -q` . include? ENV [ 'USER' ]
15
8
27
20
my_number = '+xxx'
28
21
her_number = '+xxx'
29
22
30
- reasons = [
23
+ reason = [
31
24
'Working hard' ,
32
25
'Gotta ship this feature' ,
33
26
'Someone fucked the system again'
34
- ]
35
-
36
- sample = reasons . sample
27
+ ] . sample
37
28
38
29
# Send a text message
39
30
@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 } "
41
32
)
42
33
43
34
# 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