SlideShare a Scribd company logo
1 of 23
ORDER PIZZA
ROB – GONZEE.TV
I’M ROB! (yet again)
USEFULNESS OF SOFTWARE
PIZZA POWER
/pizza
>
WEB STANDARDS FTW!
>
I H8 ATT
>
:(
ORDER PIZZA
(totally demoing theapp)
ORDER PIZZA
Resources
Onclick events
Intro to TwiML
CODE
easy buddy
GET MACGUYVER ON IT
 Onclick events -
http://developer.boxee.tv/Python_API#Examples
 Twilio PHP library -
http://www.twilio.com/docs/libraries/
 Yelp Python module -
http://code.google.com/p/yelp-python-
client/
HOW IT WORKS
SUPER SMASH!
YELP CODE
results = yelp.ReviewSearchApi(client_key="e482aAygGs2SeCGxlwQg3w",
output="json").by_location(zipcode, term="pizza", radius="1")
rows = results["businesses"]
container = mc.ListItems()
for row in rows:
newitem = mc.ListItem(mc.ListItem.MEDIA_UNKNOWN)
newitem.SetLabel( str(row["name"]) )
newitem.SetThumbnail( str(row["rating_img_url"]) )
newitem.SetProperty("address1", str(row["address1"]) )
newitem.SetProperty("city", str(row["city"]) )
newitem.SetProperty("state", str(row["state"]) )
newitem.SetProperty("avg_rating", str(row["avg_rating"]))
business_phone = "(" + str(row["phone"][0:3]) + ")" + str(row["phone"][3:6]) + "-" +
str(row["phone"][6:10])
newitem.SetProperty("phone", business_phone)
newitem.SetProperty("int_phone", str(row["phone"]))
newitem.SetPath(str(row["name"]))
if row["is_closed"] == True:
newitem.SetProperty("closed", "No")
else:
newitem.SetProperty("closed", "Yes")
container.append(newitem)
EVENT
n = mc.GetWindow(14000).GetList(111).GetFocusedItem()
listitem = mc.GetWindow(14000).GetList(111).GetItem(n)
pizza_number = listitem.GetProperty("int_phone")
url = "http://apps.gonzee.tv/orderpizza/makecall.php"
values = {'called' : telephone,
'outgoing' : pizza_number}
data = urllib.urlencode(values)
req = urllib2.Request(url, data)
response = urllib2.urlopen(req)
mc.ShowDialogOk("Calling...", "We are calling this pizza place on your behalf.
Expect a call shortly.")
SERVER-SIDE – TWILIO
LIBRARY
require "twilio.php";
/* Twilio REST API version */
$ApiVersion = "2008-08-01";
/* Set our AccountSid and AuthToken */
$AccountSid = “INSERTACCOUNTSID";
$AuthToken = “INSERTAUTHTOKEN";
/* Outgoing Caller ID you have previously validated with Twilio */
$number = ‘INSERTPHONENUMBER';
/* Outgoing Number you wish to call */
if (!isset($_REQUEST['outgoing'])) {
$err = urlencode("Must specify outgoing phone number.");
header("Location: index.php?msg=$err");
die;
}
/* Instantiate a new Twilio Rest Client */
$client = new TwilioRestClient($AccountSid, $AuthToken);
MAKING THE CALL
/* make Twilio REST request to initiate outgoing call
*/
$response = $client-
>request("/$ApiVersion/Accounts/$AccountSid/Cal
ls",
"POST", array(
"Caller" => $number,
"Called" => $_REQUEST['called'],
"Url" => $url . 'callback.php?number=' .
$_REQUEST['outgoing']
));
CONNECTING TO PIZZA
<?php
header("content-type: text/xml");
echo "<?xml version="1.0" encoding="UTF-
8"?>n";
?>
<Response>
<Say>Connecting you to pizza - please
hold.</Say>
<Dial><?php echo
$_REQUEST['number']?></Dial>
</Response>
QUESTIONS?
10001110111
 Download
http://dir.gonzee.tv/download/tv.gonzee.orderpizza.zip
 Checkout
svn checkout http://twilio-boxee-
hackathon.googlecode.com/svn/trunk/orderpiz
za/ twilio-boxee-hackathon-read-only
KTHX

More Related Content

Similar to Order pizza from Boxee

Debugging Effectively in the Cloud - Felipe Fidelix - Presentation at eZ Con...
Debugging Effectively in the Cloud - Felipe Fidelix - Presentation at  eZ Con...Debugging Effectively in the Cloud - Felipe Fidelix - Presentation at  eZ Con...
Debugging Effectively in the Cloud - Felipe Fidelix - Presentation at eZ Con...eZ Systems
 
PyCon AU 2012 - Debugging Live Python Web Applications
PyCon AU 2012 - Debugging Live Python Web ApplicationsPyCon AU 2012 - Debugging Live Python Web Applications
PyCon AU 2012 - Debugging Live Python Web ApplicationsGraham Dumpleton
 
How to measure everything - a million metrics per second with minimal develop...
How to measure everything - a million metrics per second with minimal develop...How to measure everything - a million metrics per second with minimal develop...
How to measure everything - a million metrics per second with minimal develop...Jos Boumans
 
Python Flask app deployed to OPenShift using Wercker CI
Python Flask app deployed to OPenShift using Wercker CIPython Flask app deployed to OPenShift using Wercker CI
Python Flask app deployed to OPenShift using Wercker CIBruno Rocha
 
Budapest Spark Meetup - Apache Spark @enbrite.ly
Budapest Spark Meetup - Apache Spark @enbrite.lyBudapest Spark Meetup - Apache Spark @enbrite.ly
Budapest Spark Meetup - Apache Spark @enbrite.lyMészáros József
 
Flask With Server-Sent Event
Flask With Server-Sent EventFlask With Server-Sent Event
Flask With Server-Sent EventTencent
 
Python from zero to hero (Twitter Explorer)
Python from zero to hero (Twitter Explorer)Python from zero to hero (Twitter Explorer)
Python from zero to hero (Twitter Explorer)Yuriy Senko
 
Asynchronous Programming at Netflix
Asynchronous Programming at NetflixAsynchronous Programming at Netflix
Asynchronous Programming at NetflixC4Media
 
From Code to Cloud - PHP on Red Hat's OpenShift
From Code to Cloud - PHP on Red Hat's OpenShiftFrom Code to Cloud - PHP on Red Hat's OpenShift
From Code to Cloud - PHP on Red Hat's OpenShiftEric D. Schabell
 
Web Apps on Linux (Paas)
Web Apps on Linux (Paas)Web Apps on Linux (Paas)
Web Apps on Linux (Paas)Lucas A. Romão
 
Øredev2013 - FirefoxOS - the platform HTML5 deserves
Øredev2013 - FirefoxOS - the platform HTML5 deservesØredev2013 - FirefoxOS - the platform HTML5 deserves
Øredev2013 - FirefoxOS - the platform HTML5 deservesChristian Heilmann
 
InspiringCon14: ElePHPants on speed: Running TYPO3 Flow on HipHop VM
InspiringCon14: ElePHPants on speed: Running TYPO3 Flow on HipHop VMInspiringCon14: ElePHPants on speed: Running TYPO3 Flow on HipHop VM
InspiringCon14: ElePHPants on speed: Running TYPO3 Flow on HipHop VMmhelmich
 
HTML pour le web mobile, Firefox OS - Devfest Nantes - 2014-11-07
HTML pour le web mobile, Firefox OS - Devfest Nantes - 2014-11-07HTML pour le web mobile, Firefox OS - Devfest Nantes - 2014-11-07
HTML pour le web mobile, Firefox OS - Devfest Nantes - 2014-11-07Frédéric Harper
 
Creando microservicios con Java, Microprofile y TomEE - Baranquilla JUG
Creando microservicios con Java, Microprofile y TomEE - Baranquilla JUGCreando microservicios con Java, Microprofile y TomEE - Baranquilla JUG
Creando microservicios con Java, Microprofile y TomEE - Baranquilla JUGCésar Hernández
 
Enhance system transparency and truthfulness with request tracing
Enhance system transparency and truthfulness with request tracingEnhance system transparency and truthfulness with request tracing
Enhance system transparency and truthfulness with request tracingSam Keen
 
Firefox OS: HTML5 sur les stéroïdes - HTML5mtl - 2014-04-22
Firefox OS: HTML5 sur les stéroïdes - HTML5mtl - 2014-04-22Firefox OS: HTML5 sur les stéroïdes - HTML5mtl - 2014-04-22
Firefox OS: HTML5 sur les stéroïdes - HTML5mtl - 2014-04-22Frédéric Harper
 
Supporting Enterprise System Rollouts with Splunk
Supporting Enterprise System Rollouts with SplunkSupporting Enterprise System Rollouts with Splunk
Supporting Enterprise System Rollouts with SplunkErin Sweeney
 
How to switch stack without downtime
How to switch stack without downtimeHow to switch stack without downtime
How to switch stack without downtimeFabien Penso
 
Plack perl superglue for web frameworks and servers
Plack perl superglue for web frameworks and serversPlack perl superglue for web frameworks and servers
Plack perl superglue for web frameworks and serversTatsuhiko Miyagawa
 
(Micro?)services architecture in practice
(Micro?)services architecture in practice(Micro?)services architecture in practice
(Micro?)services architecture in practiceThe Software House
 

Similar to Order pizza from Boxee (20)

Debugging Effectively in the Cloud - Felipe Fidelix - Presentation at eZ Con...
Debugging Effectively in the Cloud - Felipe Fidelix - Presentation at  eZ Con...Debugging Effectively in the Cloud - Felipe Fidelix - Presentation at  eZ Con...
Debugging Effectively in the Cloud - Felipe Fidelix - Presentation at eZ Con...
 
PyCon AU 2012 - Debugging Live Python Web Applications
PyCon AU 2012 - Debugging Live Python Web ApplicationsPyCon AU 2012 - Debugging Live Python Web Applications
PyCon AU 2012 - Debugging Live Python Web Applications
 
How to measure everything - a million metrics per second with minimal develop...
How to measure everything - a million metrics per second with minimal develop...How to measure everything - a million metrics per second with minimal develop...
How to measure everything - a million metrics per second with minimal develop...
 
Python Flask app deployed to OPenShift using Wercker CI
Python Flask app deployed to OPenShift using Wercker CIPython Flask app deployed to OPenShift using Wercker CI
Python Flask app deployed to OPenShift using Wercker CI
 
Budapest Spark Meetup - Apache Spark @enbrite.ly
Budapest Spark Meetup - Apache Spark @enbrite.lyBudapest Spark Meetup - Apache Spark @enbrite.ly
Budapest Spark Meetup - Apache Spark @enbrite.ly
 
Flask With Server-Sent Event
Flask With Server-Sent EventFlask With Server-Sent Event
Flask With Server-Sent Event
 
Python from zero to hero (Twitter Explorer)
Python from zero to hero (Twitter Explorer)Python from zero to hero (Twitter Explorer)
Python from zero to hero (Twitter Explorer)
 
Asynchronous Programming at Netflix
Asynchronous Programming at NetflixAsynchronous Programming at Netflix
Asynchronous Programming at Netflix
 
From Code to Cloud - PHP on Red Hat's OpenShift
From Code to Cloud - PHP on Red Hat's OpenShiftFrom Code to Cloud - PHP on Red Hat's OpenShift
From Code to Cloud - PHP on Red Hat's OpenShift
 
Web Apps on Linux (Paas)
Web Apps on Linux (Paas)Web Apps on Linux (Paas)
Web Apps on Linux (Paas)
 
Øredev2013 - FirefoxOS - the platform HTML5 deserves
Øredev2013 - FirefoxOS - the platform HTML5 deservesØredev2013 - FirefoxOS - the platform HTML5 deserves
Øredev2013 - FirefoxOS - the platform HTML5 deserves
 
InspiringCon14: ElePHPants on speed: Running TYPO3 Flow on HipHop VM
InspiringCon14: ElePHPants on speed: Running TYPO3 Flow on HipHop VMInspiringCon14: ElePHPants on speed: Running TYPO3 Flow on HipHop VM
InspiringCon14: ElePHPants on speed: Running TYPO3 Flow on HipHop VM
 
HTML pour le web mobile, Firefox OS - Devfest Nantes - 2014-11-07
HTML pour le web mobile, Firefox OS - Devfest Nantes - 2014-11-07HTML pour le web mobile, Firefox OS - Devfest Nantes - 2014-11-07
HTML pour le web mobile, Firefox OS - Devfest Nantes - 2014-11-07
 
Creando microservicios con Java, Microprofile y TomEE - Baranquilla JUG
Creando microservicios con Java, Microprofile y TomEE - Baranquilla JUGCreando microservicios con Java, Microprofile y TomEE - Baranquilla JUG
Creando microservicios con Java, Microprofile y TomEE - Baranquilla JUG
 
Enhance system transparency and truthfulness with request tracing
Enhance system transparency and truthfulness with request tracingEnhance system transparency and truthfulness with request tracing
Enhance system transparency and truthfulness with request tracing
 
Firefox OS: HTML5 sur les stéroïdes - HTML5mtl - 2014-04-22
Firefox OS: HTML5 sur les stéroïdes - HTML5mtl - 2014-04-22Firefox OS: HTML5 sur les stéroïdes - HTML5mtl - 2014-04-22
Firefox OS: HTML5 sur les stéroïdes - HTML5mtl - 2014-04-22
 
Supporting Enterprise System Rollouts with Splunk
Supporting Enterprise System Rollouts with SplunkSupporting Enterprise System Rollouts with Splunk
Supporting Enterprise System Rollouts with Splunk
 
How to switch stack without downtime
How to switch stack without downtimeHow to switch stack without downtime
How to switch stack without downtime
 
Plack perl superglue for web frameworks and servers
Plack perl superglue for web frameworks and serversPlack perl superglue for web frameworks and servers
Plack perl superglue for web frameworks and servers
 
(Micro?)services architecture in practice
(Micro?)services architecture in practice(Micro?)services architecture in practice
(Micro?)services architecture in practice
 

Recently uploaded

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 

Recently uploaded (20)

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 

Order pizza from Boxee

  • 2.
  • 9. :(
  • 12. GET MACGUYVER ON IT  Onclick events - http://developer.boxee.tv/Python_API#Examples  Twilio PHP library - http://www.twilio.com/docs/libraries/  Yelp Python module - http://code.google.com/p/yelp-python- client/
  • 15. YELP CODE results = yelp.ReviewSearchApi(client_key="e482aAygGs2SeCGxlwQg3w", output="json").by_location(zipcode, term="pizza", radius="1") rows = results["businesses"] container = mc.ListItems() for row in rows: newitem = mc.ListItem(mc.ListItem.MEDIA_UNKNOWN) newitem.SetLabel( str(row["name"]) ) newitem.SetThumbnail( str(row["rating_img_url"]) ) newitem.SetProperty("address1", str(row["address1"]) ) newitem.SetProperty("city", str(row["city"]) ) newitem.SetProperty("state", str(row["state"]) ) newitem.SetProperty("avg_rating", str(row["avg_rating"])) business_phone = "(" + str(row["phone"][0:3]) + ")" + str(row["phone"][3:6]) + "-" + str(row["phone"][6:10]) newitem.SetProperty("phone", business_phone) newitem.SetProperty("int_phone", str(row["phone"])) newitem.SetPath(str(row["name"])) if row["is_closed"] == True: newitem.SetProperty("closed", "No") else: newitem.SetProperty("closed", "Yes") container.append(newitem)
  • 16. EVENT n = mc.GetWindow(14000).GetList(111).GetFocusedItem() listitem = mc.GetWindow(14000).GetList(111).GetItem(n) pizza_number = listitem.GetProperty("int_phone") url = "http://apps.gonzee.tv/orderpizza/makecall.php" values = {'called' : telephone, 'outgoing' : pizza_number} data = urllib.urlencode(values) req = urllib2.Request(url, data) response = urllib2.urlopen(req) mc.ShowDialogOk("Calling...", "We are calling this pizza place on your behalf. Expect a call shortly.")
  • 17. SERVER-SIDE – TWILIO LIBRARY require "twilio.php"; /* Twilio REST API version */ $ApiVersion = "2008-08-01"; /* Set our AccountSid and AuthToken */ $AccountSid = “INSERTACCOUNTSID"; $AuthToken = “INSERTAUTHTOKEN"; /* Outgoing Caller ID you have previously validated with Twilio */ $number = ‘INSERTPHONENUMBER'; /* Outgoing Number you wish to call */ if (!isset($_REQUEST['outgoing'])) { $err = urlencode("Must specify outgoing phone number."); header("Location: index.php?msg=$err"); die; } /* Instantiate a new Twilio Rest Client */ $client = new TwilioRestClient($AccountSid, $AuthToken);
  • 18. MAKING THE CALL /* make Twilio REST request to initiate outgoing call */ $response = $client- >request("/$ApiVersion/Accounts/$AccountSid/Cal ls", "POST", array( "Caller" => $number, "Called" => $_REQUEST['called'], "Url" => $url . 'callback.php?number=' . $_REQUEST['outgoing'] ));
  • 19. CONNECTING TO PIZZA <?php header("content-type: text/xml"); echo "<?xml version="1.0" encoding="UTF- 8"?>n"; ?> <Response> <Say>Connecting you to pizza - please hold.</Say> <Dial><?php echo $_REQUEST['number']?></Dial> </Response>
  • 20.
  • 22. 10001110111  Download http://dir.gonzee.tv/download/tv.gonzee.orderpizza.zip  Checkout svn checkout http://twilio-boxee- hackathon.googlecode.com/svn/trunk/orderpiz za/ twilio-boxee-hackathon-read-only
  • 23. KTHX