2
0
mirror of https://github.com/narkoz/hacker-scripts synced 2025-08-23 02:47:14 +00:00
Sam Adams 166cae8079 Clojure implementation (#174)
* clojure implementation

* gf --> boss

* newlines
2019-04-23 13:16:28 +04:00

29 lines
749 B
Clojure

(ns hacker-scripts.smack
(:import
(com.twilio Twilio)
(com.twilio.rest.api.v2010.account Message)
(com.twilio.type PhoneNumber)))
(def acc-sid "my twilio account SID")
(def acc-tkn "my twilio secret token")
(def my-num (PhoneNumber. "+10001112222"))
(def her-num (PhoneNumber. "+19998887777"))
(def reasons ["Working hard"
"Gotta ship this feature"
"Someone fucked the system again"])
(defn twilio-init []
(Twilio/init acc-sid acc-tkn))
(defn send-sms [to-num from-num message]
(.. Message (creator to-num from-num message) create))
(def send-sms-girlfriend (partial send-sms her-num my-num))
(defn smack []
(twilio-init)
(let [message (rand-nth reasons)]
(send-sms-girlfriend message)))