Created
April 1, 2015 15:26
-
-
Save 0x27/93d18c582b3fbfd3f54c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python2 | |
# coding: utf-8 | |
# compliments - a lovely SMS sending tool | |
# ~0x27 | |
# TODO: Write a reply handling thread to send | |
# further compliments. markov chains maybe? | |
import random | |
from time import sleep | |
from twilio.rest import TwilioRestClient | |
import sys | |
# global variables. change these... | |
sender = "COMPLIMENTS" # you are gonna want to change this to whatever you reg with twilio | |
account_sid = "ACXXXXXXXXXXXXXXXXX" | |
auth_token = "YYYYYYYYYYYYYYYYYY" | |
# end global variables. | |
def send_sms(phone, message): | |
client = TwilioRestClient(account_sid, auth_token) | |
message = client.messages.create(to=phone, from_=sender, body=message) | |
print "{*} Message sent!" | |
def compliments(recipient): | |
print "{+} Sending compliments to %s" %(recipient) | |
superlatives = ['wonderful', 'beautiful', 'amazing', 'special', 'magnificent'] # expand these later... CBA getting the thesaurus out at the moment | |
while True: # endless loop because reasons | |
print "{+} Sending Message..." | |
try: | |
message = "You are a %s human being!" %(random.choice(superlative) | |
send_sms(phone=recipient, message=message) | |
except Exception, e: | |
print e | |
pass | |
sleep(random.randint(3600, 14400)) # randomly between 1 and 4 hours between messages. change this if needed. | |
def main(args): | |
if len(args) != 2: | |
sys.exit("use: %s <victimphone>" %(args[0])) | |
compliments(recipient=args[1]) | |
if __name__ == "__main__": | |
main(args=sys.argv) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment