1 / 50

SEA Open Hack - YAP

Yahoo! Application Platform (YAP) presentation for the South East Asia (SEA) Open Hack Day in Jakarta, Indonesia (November 2009)

jcleblanc
Download Presentation

SEA Open Hack - YAP

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. Jonathan LeBlanc - Technology Evangelist Yahoo! Developer Network Twitter: @jcleblanc Y!OS and the Yahoo! Application Platform

  2. Presentation Topics – What We’ll Cover (Part 1) • The Yahoo! Open Strategy (Y!OS) • The Yahoo! Application Platform (YAP) • What are Applications on YAP? • Creating YAP Applications • OAuth • OpenID • The Yahoo! Markup Language

  3. Presentation Topics – What We’ll Cover (Part 2) • OpenSocial Support -Code Samples for using the SDK and OpenSocial • The YAP Social APIs • Frontend Security using Caja • Beta Support for the Yahoo! User Interface Library (YUI)

  4. EXAMPLES | TUTORIALS | CODE SAMPLES DEVELOPER.YAHOO.COM

  5. The Yahoo! Open Strategy (Y!OS)

  6. The Yahoo! Application Platform (YAP)

  7. Creating Applications Create a Profile for Your Account http://profiles.yahoo.com Create an Application Using the Dashboard System http://developer.yahoo.com/dashboard Get Documentation and Resources http://developer.yahoo.com/yos

  8. Open ID – Single Account Sign-in

  9. OAuth - Open Authentication

  10. SDKs (Software Development Kits) PHP, Python, Java, ActionScript 3, Objective-C, and OpenSocial REST APIs http://www.github.com/yahoo

  11. OAuth – What Does the End-User See?

  12. OAuth – What Does the End-User See?

  13. Yahoo! Markup Language (YML)

  14. Using the Yahoo! Markup language (YML) YML Documentation http://developer.yahoo.com/yap/guide/yapdev-yml.html YML Samples http://developer.yahoo.com/yap/guide/yml-code-exs.html

  15. Questions?

  16. Jonathan LeBlanc - Technology Evangelist Yahoo! Developer Network Twitter: @jcleblanc Y!OS and the Yahoo! Application Platform

  17. Presentation Topics – What We’ll Cover (Part 2) • OpenSocial Support -Code Samples for using the SDK and OpenSocial • The YAP Social APIs • Frontend Security using Caja • Beta Support for the Yahoo! User Interface Library (YUI)

  18. OpenSocial 0.8 Support

  19. What is OpenSocial? • For developing applications on social networks • Accessing social data (profiles, connections) • Fetching and inserting activities Implemented by many containers • Develop once, distribute broadly •

  20. Fetching User Data & Making Requests • Examples for OpenSocial & PHP • Fetching Profiles • Fetching and Inserting Updates • Fetching Connections • Making YQL Requests

  21. 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);

  22. Fetching Updates With PHP & OpenSocial 0.8

  23. 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);

  24. 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);

  25. Fetching Connections With PHP & OpenSocial 0.8

  26. Fetching Connections With PHP & OpenSocial 0.8 $session = YahooSession::requireSession($key, $secret, $app_id) $user = $session->getSessionedUser(); $connections = $user->getConnections(); ------------------------------------------------------------------------- var req = opensocial.newDataRequest(); var idspec = opensocial.newIdSpec({ 'userId' : 'OWNER', 'groupId' : 'FRIENDS' }); req.add(req.newFetchPersonRequest('OWNER'), 'get_owner'); req.add(req.newFetchPeopleRequest(idspec), 'get_friends'); req.send(responseFriends);

  27. Making YQL Requests With PHP & OpenSocial 0.8 $session = YahooSession::requireSession($key, $secret, $app_id) $query = $session->query(‘select * from maps.map where zip="94085" ’); ------------------------------------------------------------------------- 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);

  28. Important URLs OpenSocial Site Links http://wiki.opensocial.org/index.php?title=Opensocial_(v0.8) http://wiki.opensocial.org/index.php?title=Opensocial.Person_%28v0.8%29 Developer Network Links http://developer.yahoo.com/yap/guide/os-supp-features.html http://developer.yahoo.com/yap/guide/opensocial-examples.html

  29. The Yahoo! Social APIs

  30. What are the Social APIs? Social Directory API Reference http://developer.yahoo.com/social/rest_api_guide/social_dir_api.html Status API Reference http://developer.yahoo.com/social/rest_api_guide/status_api.html Contacts API Reference http://developer.yahoo.com/social/rest_api_guide/contact_api.html Updates API Reference http://developer.yahoo.com/social/rest_api_guide/updates_api.html

  31. Calling the Social APIs with the SDK Functions Given: $ysession = YahooSession::requireSession(API_KEY, API_SECRET, APP_ID); $yuser = $ysession->getSessionedUser(); Social Directory API (Profile & Connections) $yuser->loadProfile(); $yuser->getConnections($start, $count, $total); Status API $yuser->getStatus();

  32. Calling the Social APIs with the SDK Functions Given: $ysession = YahooSession::requireSession(API_KEY, API_SECRET, APP_ID); $yuser = $ysession->getSessionedUser(); Contacts API $yuser->getContacts($start, $count); Updates API $yuser->getUpdates($start, $count);

  33. Front-End Security JavaScript / HTML / CSS

  34. Front-end Security

  35. Front-end Security: Caja Caja Security • Very secure model (whitelist methodology) • Aims to protect end-users • Full content control IFrame Concerns • Drive-by downloads • No content restrictions • Other known exploits

  36. 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>

  37. 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;

  38. What isn’t supported in YAP? Blacklisted HTML tags http://developer.yahoo.com/yap/guide/caja-blacklist.html Caja Limitations http://developer.yahoo.com/yap/guide/what-are-cajas-limitations.html

  39. What isn’t supported in YAP? • AJAX functionality (use YML / OpenSocial) Most JavaScript libraries • Script Source Includes (except YUI) •

  40. BETA YUI Support

  41. How to Implement YUI Implementing as includes <script type="text/javascript" src="http://yui.yahooapis.com/2.8.0/build/ya hoo-dom-event/yahoo-dom- event.js"></script> Insert content into a script block

  42. Available Libraries http://developer.yahoo.com/yap/guide/yui-support.html#libs-available

  43. Important URLs YUI Support in YAP http://developer.yahoo.com/yap/guide/yui-support.html Dependancy Configurator http://developer.yahoo.com/yui/articles/hosting/

  44. Questions?

  45. Resources Slides Available At: http://www.slideshare.net/jcleblanc/yap-open-mail-overview YAP Documentation and Tutorials: http://developer.yahoo.com/yos OpenSocial Documentation: http://wiki.opensocial.org/index.php?title=JavaScript_API_Reference

More Related