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
Change this: | |
$response->addDial($_GET['PhoneNumber'], | |
array("action"=>$actionUrl, | |
"timeout"=>$_REQUEST['Timeout'] ? $_REQUEST['Timeout'] : 30)); | |
to this: | |
$response->addDial($_GET['PhoneNumber'], | |
array("action"=>$actionUrl, |
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
<?php | |
// This assumes you have the Twilio PHP Helper library | |
require 'Services/Twilio.php'; | |
// This is a file with my Account Sid and AuthToken | |
include 'credentials.php'; | |
$client = new Services_Twilio($accountsid, $authtoken); | |
/* |
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
from datetime import date | |
from twilio.rest import TwilioRestClient | |
account = "ACxxxx" | |
token = "xxxxxx" | |
client = TwilioRestClient(account, token) | |
recordings = client.recordings.list(after=date(2012, 1, 1)) |
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
curl -X DELETE 'https://api.twilio.com/2010-04-01/Accounts/ACxxxx/Recordings/RExxxx.json' -u ACxxxx:{AuthToken} |
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
<?php | |
require 'Services/Twilio.php'; | |
include 'credentials.php'; | |
$toNumber = "{fill this in with your number}"; | |
$client = new Services_Twilio($accountsid, $authtoken); | |
$calls = $client->account->calls->getIterator(0, 50, array("To" => $toNumber, "StartTime<" => "2011-11-10")); |
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
function user_generate_token($username, $phoneNum, $method){ | |
global $accountsid, $authtoken, $fromNumber; | |
/** | |
* Create a store a temporary/one-time password. While session-based is ok for | |
* this proof of concept, to make this more secure we'd want to use a database, | |
* potentially a salt for the password, and some sort of timeout to expire the | |
* password of N minutes/hours. | |
*/ |
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
function user_login($username, $submitted) { | |
/** | |
* Retrieve the temporary/one-time password. While session-based is ok for | |
* this proof of concept, to make this more secure we'd want to use a database | |
* some sort of timeout to expire the password of N minutes/hours. | |
*/ | |
$stored = $_SESSION['password']; | |
// Compare the retrieved vs the stored password | |
if ($stored == $submitted) { |
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
<?php | |
if($_POST['submitButton']=="Submit Order"){ | |
echo "<h1>Order Confirmation Page!</h1><br />"; | |
echo "Name: {$_POST['Name']}<br />"; | |
echo "Address: {$_POST['Address']}<br />"; | |
echo "Cheese Choices: "; | |
foreach($_POST['cheese'] as $value){ | |
echo "$value "; | |
} | |
echo "<br />"; |
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
curl -X OPTIONS 'http://localhost/web2project-slim/' -v | python -m json.tool | |
{ | |
"resource_uri": "/", | |
"root_uri": "/web2project-slim", | |
"self": "/web2project-slim/", | |
"sub_resources": { | |
"admin": { | |
"name": "User Admin", | |
"uri": "/web2project-slim/admin" |
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
curl -X OPTIONS 'http://localhost/web2project-slim/projects' -v | python -m json.tool | |
{ | |
"actions": { | |
"create": { | |
"href": "/web2project-slim/projects", | |
"method": "POST", | |
"optional": [ | |
"project_company", | |
"project_name", |
OlderNewer