forked from NARKOZ/hacker-scripts
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhangover.js
More file actions
executable file
·57 lines (45 loc) · 1.5 KB
/
hangover.js
File metadata and controls
executable file
·57 lines (45 loc) · 1.5 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env node
/* Before running:
npm install twilio
*/
var exec = require('child_process').exec;
var me = 'my_username';
exec("who -q", function(error, stdout, stderr) {
// Exit if sessions with my username are found
if(stdout.indexOf(me) > -1)
process.exit(1);
var TWILIO_ACCOUNT_SID = process.env['TWILIO_ACCOUNT_SID'];
var TWILIO_AUTH_TOKEN = process.env['TWILIO_AUTH_TOKEN'];
// Phone numbers
var MY_NUMBER = '+xxx';
var BOSS_NUMBER = '+xxx';
// Excuses
var excuses = [
'Locked out',
'Pipes broke',
'Food poisoning',
'Not feeling well'
];
// Generate BS message
var excuse = excuses[Math.floor(Math.random() * excuses.length)];
var textMessage = 'Gonna work from home. ' + excuse;
var client = require('twilio')(TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN);
// Shoot text
client.messages.create({
body: textMessage,
to: BOSS_NUMBER,
from: MY_NUMBER
}, function(error, message) {
if(error)
console.log('Failed to send SMS: ' + error.message);
else {
var currentdate = new Date();
console.log('Message sent at: '+ (currentdate.getMonth() + 1) + '/'
+ currentdate.getDate() + '/'
+ currentdate.getFullYear() + ' '
+ currentdate.getHours() + ':'
+ currentdate.getMinutes() + ':'
+ currentdate.getSeconds() + '| Excuse: ' + excuse);
}
});
});