yap / open mail overview
DESCRIPTION
Overview deck for the foundations of the Yahoo! Application Platform and a general overview of Open MailTRANSCRIPT
Jonathan LeBlancTechnology Evangelist
Yahoo! Developer NetworkTwitter: @jcleblanc
Application Platforms on Yahoo!Yahoo! Application Platform and Open Mail
DEVELOPER.YAHOO.COMEXAMPLES | TUTORIALS | CODE SAMPLES
The Yahoo! Application Platform (YAP)
Open ID – Single Account Sign-in
OAuth - Open Authentication
SDKs (Software Development Kits)
PHP, Python, Java, ActionScript 3,Objective-C, and OpenSocial REST APIs
http://www.github.com/yahoo
OAuth – What Does the End-User See?
OAuth – What Does the End-User See?
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
Fetching User Data & Making Requests
• Examples for OpenSocial & PHP• Fetching Profiles• Fetching and Inserting Updates• Fetching Connections• Making AJAX Requests
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);
Fetching Updates With PHP & OpenSocial 0.8
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);
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);
Fetching Connections With PHP & OpenSocial 0.8
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);
Making YQL Requests With PHP & OpenSocial 0.8
$application = new YahooApplication($key, $secret);
$results = $application->query( ‘select * from delicious.feeds.popular’);
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);
Front-end Security
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
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>
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;
Open Mail
Apps are self contained
29
“Plug-ins” implicitly enhance experience
30
Today
31
?
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
Contextual plugins
33
Flickr photo(s)
Past files
Yahoo! Map
And the ideas get crazier….
34
Active Mail
35
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
Flexible API for Mail feature development
– Flickr– Groups– MyPhotos (formerly Xoopit)– Wretch– Third-party companies, as appropriate
37
What we are NOT doing
38
Questions?