390 likes | 407 Views
Overview deck for the foundations of the Yahoo! Application Platform and a general overview of Open Mail
E N D
Application Platforms on Yahoo! Yahoo! Application Platform and Open Mail Jonathan LeBlanc Technology Evangelist Yahoo! Developer Network Twitter: @jcleblanc
EXAMPLES | TUTORIALS | CODE SAMPLES DEVELOPER.YAHOO.COM
SDKs (Software Development Kits) PHP, Python, Java, ActionScript 3, Objective-C, and OpenSocial REST APIs http://www.github.com/yahoo
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_DET AILS] = [ opensocial.Person.Field.NAME, opensocial.Person.Field.THUMBNAIL_URL ]; req.add(req.newFetchPersonRequest('VIEWER', params), 'viewer_profile'); req.send(response);
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 $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: 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('P opulated!'); 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;
Today ? 31
Contextual plugins Large File Attachment X Your file is over 25MB. Would you like to upload and create a link to your large file? OK 32
Contextual plugins Flickr photo(s) Past files Yahoo! Map 33
Active Mail 35
An evolution, not a revolution 1. We always looked for developers to build features that were a natural fit 3. This semantic shift represents enhancements to the invocation point, not radical changes in the functionality 5. e.g. contextually launch “Share Attachments” 7. e.g. invoke Picnik contextually OnCompose 9. 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