Skip to content

Instantly share code, notes, and snippets.

View RobSpectre's full-sized avatar

Rob Spectre RobSpectre

View GitHub Profile
from twilio.rest import TwilioRestClient
TWILIO_ACCOUNT_SID = 'ACxxxxxxxxxxxxxxxx'
TWILIO_AUTH_TOKEN = 'yyyyyyyyyyyyyyyyyyy'
TWILIO_NUMBER = '+1555667777'
MY_NUMBER = '+15558889999'
client = TwilioRestClient(TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN)
client.messages.create(from_=TWILIO_NUMBER, to=MY_NUMBER,
from twilio.rest import TwilioRestClient
TWILIO_ACCOUNT_SID = 'ACxxxxxxxxxxxxxxxx'
TWILIO_AUTH_TOKEN = 'yyyyyyyyyyyyyyyyyyy'
client = TwilioRestClient(TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN)
@RobSpectre
RobSpectre / gist:8ecd8465fac60e534d74
Created September 17, 2014 20:49
Import Twilio Rest Client
from twilio.rest import TwilioRestClient
@RobSpectre
RobSpectre / gist:7b9429521aaa91f1ae43
Created September 17, 2014 20:45
Fire up Python REPL
python
@RobSpectre
RobSpectre / gist:40132f81f067042ce27c
Created September 17, 2014 20:31
Install Flask and Twilio
pip install twilio flask
@RobSpectre
RobSpectre / sms.php
Created June 3, 2014 21:59
Outbound sms with an email address.
<?php
require_once('Services/Twilio.php');
$ACCOUNT_SID = "ACxxxxxxxxxxxxxxxxxxxxx";
$AUTH_TOKEN = "yyyyyyyyyyyyyyyyyyyyyyyy";
$client = new Services_Twilio($ACCOUNT_SID, $AUTH_TOKEN);
$message = $client->account->messages->sendMessage(
'+15556667777', // From a Twilio number in your account
'+15558675309', // Text any number
"Email me at rob@example.com"
@RobSpectre
RobSpectre / app.py
Created May 22, 2014 14:41
Quick demo of phone trees in Python
from flask import Flask
from flask import request
from twilio import twiml
import requests
app = Flask(__name__)
@app.route('/voice', methods=['POST'])
def voice():
var http = require('http'),
twilio = require('twilio');
http.createServer(function (req, res) {
//Create TwiML response
var twiml = new twilio.TwimlResponse();
twiml.record();
res.writeHead(200, {'Content-Type': 'text/xml'});
res.end(twiml.toString());
@RobSpectre
RobSpectre / app.py
Created February 16, 2014 12:29
Example of receiving an SMS.
from flask import Flask
from flask import request
from twilio import twiml
# Declare and configure application
app = Flask(__name__)
@app.route('/sms', methods=['POST'])
@RobSpectre
RobSpectre / app.py
Created February 15, 2014 22:56
Example serial script with Flask and Twilio
from flask import Flask
from flask import request
from twilio import twiml
import serial
# Declare and configure application
app = Flask(__name__, static_url_path='/static')