Skip to content

Instantly share code, notes, and snippets.

View jaboutboul's full-sized avatar

Jack Aboutboul jaboutboul

  • ex-Red Hat, ex-Twilio
  • NYC
View GitHub Profile
@jaboutboul
jaboutboul / hellomonkey1.0.php
Created November 17, 2011 21:16
Hello Monkey 1.0 - (718) 701-8633
<?php
header("Content-type: text/xml");
?>
<Response>
<Say>Hello Monkey</Say>
</Response>
@jaboutboul
jaboutboul / hellomonkey1.1.php
Created November 18, 2011 18:08
Hello Monkey 1.1 - (718) 701-8566
<?php
$people = array(
"+17182493243"=>"Jack",
"+14158952614"=>"Rob");
if(!$name = $people[$_REQUEST['From']])
$name = "Owl";
header("content-type: text/xml");
@jaboutboul
jaboutboul / hellomonkey1.2.php
Created November 18, 2011 18:36
Hello Monkey 1.2 - (718) 701-8614
<?php
$people = array(
"+17182493243"=>"Jack",
"+14158952614"=>"Rob");
if(!$name = $people[$_REQUEST['From']])
$name = "Owl";
header("content-type: text/xml");
?>
@jaboutboul
jaboutboul / hello-monkey-handle-key.php
Created November 18, 2011 19:23
Hello Monkey 1.3 - (718) 701-8572
<?php
if($_REQUEST['Digits'] != '1'){
header("Location: hellomonkey1.3.php");
die;
}
header("content-type: text/xml");
?>
@jaboutboul
jaboutboul / hello-monkey-1.4-handle-key.php
Created November 21, 2011 18:11
Hello Monkey 1.4 - (718) 701-8722
<?php
if($_REQUEST['Digits'] != '1' and $_REQUEST['Digits'] != '2')
{
header("Location: hello-monkey-1.4.php");
die;
}
header("content-type: text/xml");
@jaboutboul
jaboutboul / rest-call-request.php
Created November 21, 2011 23:28
Initiating a Call - (718) 701-8658
<?php
require 'Services/Twilio.php';
require 'credentials.php';
$version = "2010-04-01";
$phonenumber = "+17187018658";
@jaboutboul
jaboutboul / rest-call-log.php
Created November 22, 2011 22:17
Viewing Call Records
<?php
include 'Services/Twilio.php';
include 'credentials.php';
$version = "2010-04-01";
$client = new Services_Twilio($ACCOUNT_SID, $AUTH_TOKEN, $version);
try {
@jaboutboul
jaboutboul / caller-location.php
Created December 5, 2011 18:01
Getting Caller's City and State - (718) 701-8814
<?php
header("Content-type: text/xml");
$city = $_REQUEST['FromCity'];
$state = $_REQUEST['FromState'];
?>
<Response>
<Say><?php echo "Hello caller from $city , $state";?>.</Say>
@jaboutboul
jaboutboul / filter.php
Created February 17, 2012 21:01
filter sms
<?php
include 'Services/Twilio.php';
include 'credentials.php';
$client = new Services_Twilio($ACCOUNT_SID, $AUTH_TOKEN);
$filter = $client->account->sms_messages->getIterator(0, 500, array("To" => "+14042208109"));
print_r($filter);
@jaboutboul
jaboutboul / credentials.php
Created April 2, 2012 19:07
Twilio SMS Distribution JS Modal
<?php
$ACCOUNT_SID = '';
$AUTH_TOKEN = '';
?>