forked from NARKOZ/hacker-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsmack_my_bitch_up.go
executable file
·38 lines (31 loc) · 1.09 KB
/
smack_my_bitch_up.go
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
package main
import (
"fmt"
"math/rand"
"os"
"os/exec"
"strings"
"time"
)
func main() {
output1, err := exec.Command("who").Output()
output2 := os.Getenv("USER")
users := string(output1[:])
current_user := string(output2[:])
if !strings.Contains(users, current_user) {
return
}
reasons := []string{"Working hard", "Gotta ship this feature", "Someone fucked the system again"}
rand.Seed(time.Now().UTC().UnixNano())
message := "Late at work. " + reasons[rand.Intn(len(reasons))]
TWILIO_ACCOUNT_SID := string(os.Getenv("TWILIO_ACCOUNT_SID"))
TWILIO_AUTH_TOKEN := string(os.Getenv("TWILIO_AUTH_TOKEN"))
MY_NUMBER := string(os.Getenv("MY_NUMBER"))
HER_NUMBER := string(os.Getenv("HER_NUMBER"))
response, err := exec.Command("curl", "-fSs", "-u", TWILIO_ACCOUNT_SID+":"+TWILIO_AUTH_TOKEN, "-d", "From="+MY_NUMBER, "-d", "To="+HER_NUMBER, "-d", "Body="+message, "https://api.twilio.com/2010-04-01/Accounts/"+TWILIO_ACCOUNT_SID+"/Messages").Output()
if err != nil {
fmt.Printf("Failed to send SMS: %s", err)
return
}
fmt.Printf("Message Sent Successfully with response: %s ", response)
}