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 VOIC 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 voic app)

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

11 GET MACGUYVER ON IT List Container Twilio Python module ElementTree (or your XML parser of choice)

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 vertical

16 ONLOAD EVENT 111 yes

17 CODE! import twilio import elementtree.ElementTree as ET # Twilio REST API version API_VERSION = ' ' # 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/laughotronvoic /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 Download Checkout svn checkout hackathon.googlecode.com/svn/trunk/voic / twilio-boxee-hackathon-read-onlyhttp://twilio-boxee- hackathon.googlecode.com/svn/trunk/voic /

23 KTHX


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

Similar presentations


Ads by Google