Skip to content

Instantly share code, notes, and snippets.

View RobSpectre's full-sized avatar

Rob Spectre RobSpectre

View GitHub Profile
@RobSpectre
RobSpectre / voice.php
Created June 24, 2012 19:12
Get SMS notifications when user calls the number on your website
<?php
header('Content-type: text/xml');
// Set your account credentials and numbers you want to call and text.
$ACCOUNT_SID = "ACxxxxxxxxx";
$AUTH_TOKEN = "yyyyyyyyyyyy";
$TWILIO_NUMBER = "+12223334444";
$NUMBER_TO_CALL = "+15556667777";
$NUMBER_TO_TEXT = "+15554443333";
@RobSpectre
RobSpectre / sms.php
Created June 24, 2012 19:39
Let users post ads via SMS and forward to ad network manager
<?php
header('Content-type: text/xml');
// Set your account credentials and numbers you want to call and text.
$ACCOUNT_SID = "ACxxxxxxxxx";
$AUTH_TOKEN = "yyyyyyyyyyyy";
$TWILIO_NUMBER = "+12223334444";
$NUMBER_TO_TEXT = "+15554443333";
// Include Twilio PHP helper library
@RobSpectre
RobSpectre / app.py
Created June 24, 2012 19:44
Get latest quote on the iShares Morningstar Small Value fund (JKL)
import os
import signal
from flask import Flask
from flask import request
import requests
import simplejson as json
from twilio import twiml
@RobSpectre
RobSpectre / dermbids.php
Created June 24, 2012 20:03
Notify list of doctor's offices of inbound patient to bid
<?php
header('Content-type: text/xml');
// Define doctor offices to notify of inbound lead
$offices = array('+15556667777', '+15554443333');
// Set your account credentials and numbers you want to call and text.
$ACCOUNT_SID = "ACxxxxxxxxx";
$AUTH_TOKEN = "yyyyyyyyyyyy";
$TWILIO_NUMBER = "+12223334444";
@RobSpectre
RobSpectre / sem_call_tracking.php
Created June 24, 2012 20:42
Call Tracking Demo for Organic versus Paid Search visitors
<?php
// Define Twilio number you wish to use for call tracking
$ORGANIC = '+18475625924';
$PAID = '+18475625918';
// Set your account credentials and numbers you want to call and text.
$ACCOUNT_SID = "ACxxxxxxxxx";
$AUTH_TOKEN = "yyyyyyyyyyyy";
$TWILIO_NUMBER = "+12223334444";
@RobSpectre
RobSpectre / live_interpreter.py
Created July 20, 2012 13:39
Get the numbers and call them demo
# 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
@RobSpectre
RobSpectre / app.py
Created August 7, 2012 21:20
Karaoke Mic
import flask
from twilio import twiml
app = flask.Flask(__name__)
@app.route('/mic', methods=['POST'])
def karaoke():
response = twiml.Response()
with response.dial() as dial:
dial.conference("Karaoke Party Room")
@RobSpectre
RobSpectre / app.py
Created August 7, 2012 21:53
Karaoke Speakers
import flask
from twilio.util import TwilioCapability
app = flask.Flask(__name__)
ACCOUNT_SID = "ACxxxxxxxxxxxx"
AUTH_TOKEN = "yyyyyyyyyyyyyyy"
APP_SID = "APzzzzzzzzzzzzzzzz"
@app.route('/speakers')
@RobSpectre
RobSpectre / app.py
Created August 7, 2012 21:58
Karaoke Music
import flask
from twilio import twiml
app = flask.Flask(__name__)
@app.route('/tunes', methods=['POST'])
def tunes():
response = twiml.Response()
response.play('http://example.com/tastytunes.mp3')
return str(response)
@RobSpectre
RobSpectre / script.py
Created August 7, 2012 21:59
Karaoke Lyrics
from twilio.rest import TwilioRestClient
ACCOUNT_SID = "ACxxxxxxxxxxxx"
AUTH_TOKEN = "yyyyyyyyyyyyyyy"
APP_SID = "APzzzzzzzzzzzzzzzz"
CALLER_ID = "+15556667777"
KARAOKE_NUMBER = "+15558675309"
client = TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN)