Esempio n. 1
0
# Batch SMS
# Christopher J. Su
# Copyright (c) 2015

from batch_sms import BatchSMS
from batch_sms import AssociatedBatchSender
from batch_sms import TwilioSender
from secrets import TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN

sender = TwilioSender(TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN)
batch_sender = AssociatedBatchSender(sender)
client = BatchSMS('test.db', batch_sender, auto_associate=True)

sub_id = client.create_subscription_list('Hackers')

client.add_from_number('+15005550006')

subs = [sub_id]
client.add_to_number('+15005550010', subs=subs)
client.add_to_number('+15005550011', subs=subs)
client.add_to_number('+15005550012', subs=subs)
client.add_to_number('+15005550013', subs=subs)

def callback(payload):
  print payload

client.send_to_subscription(sub_id, 'Hello World', callback=callback)
Esempio n. 2
0
# Batch SMS
# Christopher J. Su
# Copyright (c) 2015

from batch_sms import BatchSMS
from batch_sms import AssociatedBatchSender
from batch_sms import TwilioSender
from secrets import TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN

sender = TwilioSender(TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN)
batch_sender = AssociatedBatchSender(sender)
client = BatchSMS('test.db', batch_sender, auto_associate=True)

sub_id = client.create_subscription_list('Hackers')

client.add_from_number('+15005550006')

subs = [sub_id]
client.add_to_number('+15005550010', subs=subs)
client.add_to_number('+15005550011', subs=subs)
client.add_to_number('+15005550012', subs=subs)
client.add_to_number('+15005550013', subs=subs)


def callback(payload):
    print payload


client.send_to_subscription(sub_id, 'Hello World', callback=callback)
Esempio n. 3
0
# run.py
from batch_sms import BatchSMS
from batch_sms import AssociatedBatchSender
from batch_sms import TwilioSender
from secrets import TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN

sender = TwilioSender(TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN)
batch_sender = AssociatedBatchSender(sender)
client = BatchSMS('test.db', batch_sender, auto_associate=True)

client.add_from_number('+17084983870')
client.add_from_number('+17036216924')
client.add_from_number('+17034571909')
client.add_from_number('+17032935994')

# sub_id = client.create_subscription_list('Hackers')

subs = ['Hackers']
# client.add_to_number('+16096479885', subs=subs)

# f = open('hackers.txt', 'rb')
# numbers = f.readlines()
# numbers = [n.strip() for n in numbers]
#
# for n in numbers:
#     client.add_to_number(n, subs=subs)

def callback(payload):
    print payload

def onfail(payload):