Created
July 20, 2012 13:39
-
-
Save RobSpectre/3150763 to your computer and use it in GitHub Desktop.
Get the numbers and call them demo
This file contains hidden or 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
# Pull your account settings from a local file | |
from local_settings import * | |
# Get the TwilioRestClient class to access Twilio via REST | |
from twilio.rest import TwilioRestClient | |
# Authenticate to Twilio using the local_settings you imported | |
client = TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN) | |
# List all the SMS messages you've received to a number | |
client.sms.messages.list(to="+15558675309") | |
# Iterate through all the numbers and call them! | |
for msg in _: | |
client.calls.create(from_="+15558675309", to=msg.from_, url="http://www.twimlbin.com/whatever") |
This file contains hidden or 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
ACCOUNT_SID = 'ACxxxxxx' | |
AUTH_TOKEN = 'yyyyyyyyy' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment