1 / 23

VOICEMAIL

VOICEMAIL. ROB – GONZEE.TV. HI. I’M ROB ! (yet again). FIRST APP ON BOXEE. LAUGH-O-TRON. SCOPE THIS MY NINJA. (totally demoing Laugh-o- Tron ). WHERE O’ WHERE. TELEVISION. BOXEE FTW!. (totally demoing voicemail app). LAUGHOTRON VOICEMAIL. Resources Intro to Boxee GUI

dyan
Download Presentation

VOICEMAIL

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. VOICEMAIL ROB – GONZEE.TV

  2. HI

  3. I’M 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 Containerhttp://developer.boxee.tv/List_Container • Twilio Python modulehttp://www.twilio.com/docs/libraries/ • ElementTree (or your XML parser of choice)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 <?xml version="1.0"?> <window type="window" id="14000"> <defaultcontrol always="true">111</defaultcontrol> <allowoverlay>yes</allowoverlay> <controls> <control type="group"> </control> </controls> </window>

  15. LIST CONTAINER <control type="list" id="111“> <onright>-</onright> <posx>160</posx> <posy>60</posy> <width>960</width> <height>570</height> <orientation>vertical</orientation> <itemlayout> </itemlayout> <focusedlayout width="960" height="80"> </focusedlayout> <content type="action"> </content> </control>

  16. ONLOAD EVENT <?xml version="1.0"?> <window type="window" id="14000"> <onloadlang="python"><![CDATA[ #TOTALLY PUT YOUR CODE HERE ]]></onload> <defaultcontrol always="true">111</defaultcontrol> <allowoverlay>yes</allowoverlay> <controls> <control type="group"> </control> </controls> </window>

  17. CODE! import twilio import elementtree.ElementTree as ET # Twilio REST API version API_VERSION = '2008-08-01' # TwilioAccountSid 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 – THAT’S 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 • Downloadhttp://dir.gonzee.tv/download/tv.gonzee.laughotronvoicemail.zip • Checkoutsvn checkout http://twilio-boxee-hackathon.googlecode.com/svn/trunk/voicemail/twilio-boxee-hackathon-read-only

  23. KTHX

More Related