39
Jonathan LeBlanc Technology Evangelist Yahoo! Developer Network Twitter: @jcleblanc Application Platforms on Yahoo! Yahoo! Application Platform and Open Mail

YAP / Open Mail Overview

Embed Size (px)

DESCRIPTION

Overview deck for the foundations of the Yahoo! Application Platform and a general overview of Open Mail

Citation preview

Page 1: YAP / Open Mail Overview

Jonathan LeBlancTechnology Evangelist

Yahoo! Developer NetworkTwitter: @jcleblanc

Application Platforms on Yahoo!Yahoo! Application Platform and Open Mail

Page 2: YAP / Open Mail Overview

DEVELOPER.YAHOO.COMEXAMPLES | TUTORIALS | CODE SAMPLES

Page 3: YAP / Open Mail Overview

The Yahoo! Application Platform (YAP)

Page 4: YAP / Open Mail Overview
Page 5: YAP / Open Mail Overview
Page 6: YAP / Open Mail Overview
Page 7: YAP / Open Mail Overview

Open ID – Single Account Sign-in

Page 8: YAP / Open Mail Overview

OAuth - Open Authentication

Page 9: YAP / Open Mail Overview
Page 10: YAP / Open Mail Overview

SDKs (Software Development Kits)

PHP, Python, Java, ActionScript 3,Objective-C, and OpenSocial REST APIs

http://www.github.com/yahoo

Page 11: YAP / Open Mail Overview

OAuth – What Does the End-User See?

Page 12: YAP / Open Mail Overview

OAuth – What Does the End-User See?

Page 13: YAP / Open Mail Overview

What is OpenSocial?

• OpenSocial API• For developing applications on social networks

• Accessing social data (profiles, connections)• Fetching and inserting activities

• Implemented by many containers• Develop once, distribute broadly

Page 14: YAP / Open Mail Overview

Fetching User Data & Making Requests

• Examples for OpenSocial & PHP• Fetching Profiles• Fetching and Inserting Updates• Fetching Connections• Making AJAX Requests

Page 15: YAP / Open Mail Overview
Page 16: YAP / Open Mail Overview

Collecting User Data With PHP & OpenSocial 0.8

$session = YahooSession::requireSession($key, $secret, $app_id)$user = $session->getSessionedUser();$profile = $user->getProfile();

-----------------------------------------------------------------------------------------------

var req = opensocial.newDataRequest(); var params = {};params[opensocial.DataRequest.PeopleRequestFields.PROFILE_DETAILS] = [ opensocial.Person.Field.NAME, opensocial.Person.Field.THUMBNAIL_URL];

req.add(req.newFetchPersonRequest('VIEWER', params), 'viewer_profile');req.send(response);

Page 17: YAP / Open Mail Overview

Fetching Updates With PHP & OpenSocial 0.8

Page 18: YAP / Open Mail Overview

Getting Updates With PHP & OpenSocial 0.8

$session = YahooSession::requireSession($key, $secret, $app_id)$user = $session->getSessionedUser();$updates = $user->getUpdates();

-------------------------------------------------------------------------------

var req = opensocial.newDataRequest();var spec = new opensocial.IdSpec();

spec.setField(opensocial.IdSpec.Field.USER_ID, opensocial.IdSpec.PersonId.OWNER);

req.add(req.newFetchActivitiesRequest(spec), 'ownerActivities');req.send(handleActivities);

Page 19: YAP / Open Mail Overview

Inserting Updates With PHP & OpenSocial 0.8

$session = YahooSession::requireSession($key, $secret, $app_id)$user = $session->getSessionedUser();$update = $user->insertUpdate($suid, $title, $link, $description);

---------------------------------------------------------------------------------

var params = {}, activity;params[opensocial.Activity.Field.TITLE] = title;params[opensocial.Activity.Field.BODY] = body;activity = opensocial.newActivity(params);

opensocial.requestCreateActivity(activity,opensocial.CreateActivityPriority.LOW,callback);

Page 20: YAP / Open Mail Overview

Fetching Connections With PHP & OpenSocial 0.8

Page 21: YAP / Open Mail Overview

Fetching Connections With PHP & OpenSocial 0.8

$session = YahooSession::requireSession($key, $secret, $app_id)$user = $session->getSessionedUser();$connections = $user->getConnections();

----------------------------------------------------------------------------

var idspec = opensocial.newIdSpec({ 'userId' : 'OWNER', 'groupId' : 'FRIENDS' });

var req = opensocial.newDataRequest();req.add(req.newFetchPersonRequest('OWNER'), 'get_owner');req.add(req.newFetchPeopleRequest(idspec), 'get_friends');req.send(responseFriends);

Page 22: YAP / Open Mail Overview

Making YQL Requests With PHP & OpenSocial 0.8

$application = new YahooApplication($key, $secret);

$results = $application->query( ‘select * from delicious.feeds.popular’);

Page 23: YAP / Open Mail Overview

Making YQL Requests With PHP & OpenSocial 0.8

var params = {};var url = 'http://developer.yahoo.com/yql/console/?

q=select%20*%20from%20flickr.photos.search%20where%20text%3D%22Times%20Square%22'

var callback = callbackFunc;

params[gadgets.io.RequestParameters.CONTENT_TYPE] = gadgets.io.ContentType.TEXT;

params[gadgets.io.RequestParameters.METHOD] = gadgets.io.MethodType.GET;

gadgets.io.makeRequest(url, callback, params);

Page 24: YAP / Open Mail Overview

Front-end Security

Page 25: YAP / Open Mail Overview

Front-end Security: Caja

Caja Security• Very secure model (blacklist all)• Aims to protect end-users• Full content control

IFrame Concerns• Drive-by downloads• No content restrictions• Other known exploits

Page 26: YAP / Open Mail Overview

Front-end Security: Caja Cajoling Process

<script type="text/javascript">function response(obj) { if (obj.text){

document.getElementById('interact').setInnerHTML('Populated!');

document.getElementById('population').setInnerHTML(obj.errors);

}}</script>

Page 27: YAP / Open Mail Overview

Front-end Security: Caja Cajoling Process

var $dis = $v.getOuters(); $v.initOuter('onerror'); $v.so('response', ___.markFuncFreeze(function () { function response$_caller($dis, obj) { if ($v.r(obj, 'text')) { $v.cm($v.cm($v.ro('document'), 'getElementById',

[ 'interact' ]), 'setInnerHTML', [ 'Populated!' ]); $v.cm($v.cm($v.ro('document'), 'getElementById',

[ 'population' ]), 'setInnerHTML', [ $v.r(obj, 'errors') ]); } } response$_caller.FUNC___ = 'response$_caller'; var response;; response = $v.dis(___.primFreeze(response$_caller), 'response'); return response;

Page 28: YAP / Open Mail Overview

Open Mail

Page 29: YAP / Open Mail Overview

Apps are self contained

29

Page 30: YAP / Open Mail Overview

“Plug-ins” implicitly enhance experience

30

Page 31: YAP / Open Mail Overview

Today

31

?

Page 32: YAP / Open Mail Overview

Contextual plugins

32

XXLarge File Attachment

Your file is over 25MB.

Would you like to upload and create a link to your large file?

OK

Page 33: YAP / Open Mail Overview

Contextual plugins

33

Flickr photo(s)

Past files

Yahoo! Map

Page 34: YAP / Open Mail Overview

And the ideas get crazier….

34

Page 35: YAP / Open Mail Overview

Active Mail

35

Page 36: YAP / Open Mail Overview

An evolution, not a revolution

1. We always looked for developers to build features that were a natural fit

2. This semantic shift represents enhancements to the invocation point, not radical changes in the functionality

3. e.g. contextually launch “Share Attachments”

4. e.g. invoke Picnik contextually OnCompose

5. e.g. detect an invitation and gently suggest upgrade to Evite

36

Page 37: YAP / Open Mail Overview

Flexible API for Mail feature development

– Flickr– Groups– MyPhotos (formerly Xoopit)– Wretch– Third-party companies, as appropriate

37

Page 38: YAP / Open Mail Overview

What we are NOT doing

38

Page 39: YAP / Open Mail Overview

Questions?