Presentation is loading. Please wait.

Presentation is loading. Please wait.

VOICEMAIL ROB – GONZEE.TV. HI IM ROB! (yet again)

Similar presentations


Presentation on theme: "VOICEMAIL ROB – GONZEE.TV. HI IM ROB! (yet again)"— Presentation transcript:

1 VOICEMAIL ROB – GONZEE.TV

2 HI

3 IM ROB! (yet again)

4 FIRST APP ON BOXEE

5 LAUGH-O-TRON

6 SCOPE THIS MY NINJA (totally demoing Laugh-o-Tron)

7 WHERE O WHERE

8 TELEVISION

9 BOXEE FTW! (totally demoing voicemail app)

10 LAUGHOTRON VOICEMAIL Resources Intro to Boxee GUI Intro to Twilio REST API CODE oh snap!

11 GET MACGUYVER ON IT List Container http://developer.boxee.tv/List_Container http://developer.boxee.tv/List_Container Twilio Python module http://www.twilio.com/docs/libraries/ http://www.twilio.com/docs/libraries/ ElementTree (or your XML parser of choice) http://effbot.org/zone/element-index.htm http://effbot.org/zone/element-index.htm

12 HOW IT WORKS REST XML

13 THE CAKE IS A LIE

14 BOXEE GUI XML Driven Controls Python Events 111 yes

15 LIST CONTAINER - 160 60 960 570 vertical

16 ONLOAD EVENT 111 yes

17 CODE! import twilio import elementtree.ElementTree as ET # Twilio REST API version API_VERSION = '2008-08-01' # Twilio AccountSid and AuthToken ACCOUNT_SID = INSERTACCOUNTSID' ACCOUNT_TOKEN = INSERTSECRETTOKEN' # Create a Twilio REST account object using your Twilio account ID and token account = twilio.Account(ACCOUNT_SID, ACCOUNT_TOKEN)

18 MORE CODE! # Use the Recording resource to get all the recordings from our account try: response = account.request('/%s/Accounts/%s/Recordings' % (API_VERSION, ACCOUNT_SID), 'GET') except Exception, e: print e print e.read() # Parse result response = ET.fromstring(response)

19 WAIT – THATS NOT MUCH CODE? container = mc.ListItems() for recording in response.findall("*/Recording"): newitem = mc.ListItem(mc.ListItem.MEDIA_AUDIO_SPEECH) newitem.SetLabel(recording.findtext('DateCreated')) newitem.SetDuration( int(recording.findtext('Duration')) ) newitem.SetThumbnail("http://apps.gonzee.tv/laughotronvoicemail/images/ thumb.png") newitem.SetProperty("Sid", recording.findtext('Sid')) newitem.SetProperty("AccountSid", recording.findtext('AccountSid')) newitem.SetProperty("CallSid", recording.findtext('CallSid')) newitem.SetProperty("DateUpdated", recording.findtext('DateUpdated')) newitem.SetPath('https://api.twilio.com/%s/Accounts/%s/Recordings/' % (API_VERSION, ACCOUNT_SID) + recording.findtext('Sid') + ".mp3") container.append(newitem) list = mc.GetWindow(14000).GetList(111).SetItems(container)

20 DONE

21 QUESTIONS?

22 10001110111 Download http://dir.gonzee.tv/download/tv.gonzee.laughotronvoicemail.zip http://dir.gonzee.tv/download/tv.gonzee.laughotronvoicemail.zip Checkout svn checkout http://twilio-boxee- hackathon.googlecode.com/svn/trunk/voicemail/ twilio-boxee-hackathon-read-onlyhttp://twilio-boxee- hackathon.googlecode.com/svn/trunk/voicemail/

23 KTHX


Download ppt "VOICEMAIL ROB – GONZEE.TV. HI IM ROB! (yet again)"

Similar presentations


Ads by Google