Y!OS Overview and Deep Code Dive
-
Upload
jonathan-leblanc -
Category
Technology
-
view
9.506 -
download
1
description
Transcript of Y!OS Overview and Deep Code Dive
![Page 1: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/1.jpg)
Yahoo! Open Strategy Y!OSDecember 20, 2008
Jonathan LeBlanc – YDN
![Page 2: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/2.jpg)
- 2 -
Y!OS Goals
![Page 3: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/3.jpg)
- 3 -
Establish a Social Dimension – Profileshttp://profiles.yahoo.com
![Page 4: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/4.jpg)
- 4 -
Establish a Social Dimension – Small Viewhttp://my.yahoo.com
![Page 5: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/5.jpg)
- 5 -
Opening Yahoo – Application platform (YAP) http://developer.yahoo.com/dashboard
![Page 6: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/6.jpg)
- 6 -
Opening Yahoo – Application Galleryhttp://apps.yahoo.com/myapps
![Page 7: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/7.jpg)
- 7 -
YAP ComponentsHow does it work?
![Page 8: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/8.jpg)
- 8 -
YAP Components – Open Authentication (OAuth)
• 2-legged & 3-legged OAuth
• Consumer / Shared Secret keys
• Similar to BBAuth, but open standard
![Page 9: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/9.jpg)
- 9 -
YAP Components – Yahoo! Markup Language (YML)http://developer.yahoo.com/yap/yml
• Allows secured access to private data
• Can use ‘me’ and ‘viewer’ keywords
• Small view uses YML lite
• Will begin integrating into OSML
![Page 10: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/10.jpg)
- 10 -
YAP Components – Social APIshttp://developer.yahoo.com/social/
• Social Directory (read)
• Contacts (read)
• User Status (read / write)
• Updates (read / write)
![Page 11: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/11.jpg)
- 11 -
YAP Components – Cajahttp://code.google.com/p/google-caja
• HTML / CSS / JavaScript securer
• Enforces standards
• Includes JSLint
• YAP is the first major platform to fully integrate this technology (and keep it running)
![Page 12: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/12.jpg)
- 12 -
YAP Components – Software Development Kits (SDKs)http://developer.yahoo.com/social/sdk
PHP SDK Currently AvailableOpen and OAuth Applications
ActionScript 3 SDK Currently AvailableOpen Applications
Java SDK in DevelopmentOpen and OAuth Applications
![Page 13: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/13.jpg)
- 13 -
YAP Components – Yahoo! Query Language (YQL) http://developer.yahoo.com/yql
• SQL-like syntax
• Private / Public Data
• Use of certain YDN API’s
• Captures external data feeds
![Page 14: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/14.jpg)
- 14 -
YAP ApplicationsHow do They Work?
![Page 15: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/15.jpg)
- 15 -
YAP Applications – Open Applications
• Runs on platform
• Can use 2 & 3 legged OAuth
• Contain small and large views
• Small view uses YIV & iframe to secure
• Large view uses Caja to secure
• Supports OpenSocial 0.8
![Page 16: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/16.jpg)
- 16 -
YAP Applications – Open ApplicationsCreating an Open Application – Step 1
![Page 17: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/17.jpg)
- 17 -
YAP Applications – Open Applications Creating an Open Application – Step 2
![Page 18: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/18.jpg)
- 18 -
YAP Applications – Open Applications Creating an Open Application – Step 3
![Page 19: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/19.jpg)
- 19 -
YAP Applications – Open ApplicationsCreating an Open Application – Step 4
![Page 20: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/20.jpg)
- 20 -
YAP Applications – Open ApplicationsExternal Access Prohibited
![Page 21: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/21.jpg)
- 21 -
YAP Applications – OAuth Applications
• Runs off platform
• Uses 2 & 3 legged OAuth
• Does not contain views
• Requires Users to Authenticate Session
![Page 22: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/22.jpg)
- 22 -
YAP Applications – OAuth ApplicationsCreating an OAuth Application – Step 1
![Page 23: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/23.jpg)
- 23 -
YAP Applications – OAuth ApplicationsCreating an OAuth Application – Step 2
![Page 24: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/24.jpg)
- 24 -
YAP Applications – OAuth ApplicationsCreating an OAuth Application – Step 3
![Page 25: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/25.jpg)
- 25 -
YAP Applications – OAuth ApplicationsCreating an OAuth Application – Step 4
![Page 26: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/26.jpg)
- 26 -
YAP Applications – OAuth ApplicationsCreating an OAuth Application – Step 5
![Page 27: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/27.jpg)
- 27 -
YAP Applications – OAuth ApplicationsCreating an OAuth Application – Step 6
![Page 28: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/28.jpg)
- 28 -
Y!OS ResourcesHow Do I Get Started?
![Page 29: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/29.jpg)
- 29 -
Y!OS Resources - Documentation
Y!OS Main Overview - http://developer.yahoo.com/yos
YAP Main Overview - http://developer.yahoo.com/yap
YQL Docs - http://developer.yahoo.com/yql
YML Docs - http://developer.yahoo.com/yap/yml
Caja - http://code.google.com/p/google-caja/
Caja Support - http://developer.yahoo.com/yap/guide/caja-support.html
Slide Deck (Overview) - http://www.slideshare.net/jleblanc/yos-presentation-presentation
Slide Deck (Deep Dive) - http://www.slideshare.net/jleblanc/sdk-presentation-presentation/
![Page 30: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/30.jpg)
- 30 -
Y!OS Resources – Tools and Galleries
YAP Dashboard - http://developer.yahoo.com/dashboard
YQL Console - http://developer.yahoo.com/yql/console
JSLint - http://www.jslint.com
Application Gallery - http://apps.yahoo.com/myapps
YDN Forum - http://developer.yahoo.com/forum
PHP SDK - http://developer.yahoo.com/social/sdk/
AS3 SDK - http://developer.yahoo.com/flash/yos/
![Page 31: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/31.jpg)
- 31 -
Y!OS Deep DiveDecember 20, 2008
Jonathan LeBlanc – YDN
![Page 32: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/32.jpg)
- 32 -
Y!OS Code OverviewYahoo! Markup Language (YML)
![Page 33: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/33.jpg)
- 33 -
YML – Available Tags
YML Tags
yml:a yml:audio yml:form yml:friend-selectoryml:if-env yml:image yml:messageyml:name yml:profile-pic yml:pronounyml:share yml:swf yml:user-badgeyml:visible-to-friends yml:visible-to-owneryml:visible-to-user
YML Lite Tags
yml:a yml:audio yml:form yml:if-env yml:image yml:name yml:profile-pic yml:pronoun yml:user-badge
![Page 34: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/34.jpg)
- 34 -
YML – Syntax Rules
• YML tags are namespaced with yml:. However, since YML
documents are not actually XML, no formal namespace
declaration is required.
• All attributes must be enclosed in double quotes. To specify
double quotes within an attribute value, enter the "
character reference.
• If the data type of an attribute is boolean, allowed values are
"true" and "false", which must be enclosed in double quotes.
• Singleton tags (that is, tags with no closing tags) must end
with /> .
• White space and indentations are passed through, but ignored in
the interpretation phase.
• YML tags accept and produce characters in UTF-8 only.
![Page 35: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/35.jpg)
- 35 -
YML – Sample YML UseTab Controller
![Page 36: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/36.jpg)
- 36 -
YML – Sample YML UseTab Construction
![Page 37: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/37.jpg)
- 37 -
YML – Sample YML UseTab Styles
![Page 38: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/38.jpg)
- 38 -
Y!OS Code OverviewPHP SDK
![Page 39: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/39.jpg)
- 39 -
PHP SDK – 2-Legged OAuth Initialization
Used For:
Applications which only require access to public user data and
open APIs
![Page 40: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/40.jpg)
- 40 -
PHP SDK – 3-Legged OAuth Initialization
Used For:
- Applications requiring private data access
![Page 41: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/41.jpg)
- 41 -
PHP SDK – User Data Manipulation
![Page 42: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/42.jpg)
- 42 -
PHP SDK – Create an Update for a User
![Page 43: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/43.jpg)
- 43 -
PHP SDK – Set the Status (Presence) of a User
![Page 44: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/44.jpg)
- 44 -
Y!OS Code OverviewYahoo! Query Language
![Page 45: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/45.jpg)
- 45 -
YQL – Console
Location: http://developer.yahoo.com/yql/console
![Page 46: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/46.jpg)
- 46 -
YQL – Query Structure
Projection- SELECT what FROM table- SELECT * FROM social.connections
Local and Remote Filtering- SELECT what FROM table WHERE filter- SELECT * FROM social.profile WHERE guid = me
Sub-selects - Joining Data- SELECT what FROM table WHERE fieldvalue IN (SELECT ...)- SELECT * FROM social.profile WHERE guid IN (SELECT guid FROM social.connections WHERE owner_guid=me) Local Paging Control- SELECT what FROM table WHERE filter LIMIT 10 OFFSET 50- SELECT * FROM web.search WHERE query="madonna" LIMIT 3 OFFSET 10
Remove Table Size Control- SELECT what FROM table(0,500) WHERE condition- SELECT * FROM web.search(0,10) WHERE query="madonna" AND result.XXX = something
![Page 47: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/47.jpg)
- 47 -
YQL – Available Tables
YQL Command: SHOW tables
![Page 48: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/48.jpg)
- 48 -
YQL – Table Contents
YQL Command: DESC social.connections
![Page 49: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/49.jpg)
- 49 -
YQL – Running a Query
![Page 50: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/50.jpg)
- 50 -
YQL – Output Types
![Page 51: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/51.jpg)
- 51 -
Y!OS Code OverviewCaja
![Page 52: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/52.jpg)
- 52 -
Caja & JavaScript – Before Cajoling
![Page 53: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/53.jpg)
- 53 -
Caja & JavaScript – After Cajoling
![Page 54: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/54.jpg)
- 54 -
Caja & JavaScript – What doesn’t work?
• eval()
• new Function()
• Strings as event handlers (node.onclick = '...';)
• Names ending with double / triple underscores
• with function (with (obj) { ... })
• Implicit global variables (specify var variable)
• Calling a method as a function
• document.write
• window.event
• .onclick
• OpenSocial gadgets.io.makeRequest return JS
![Page 55: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/55.jpg)
- 55 -
Caja & HTML – What doesn’t work?
• name attributes with gadgets.io.makeRequest
• Custom attributes
• Custom tags
• Unclosed tags
• <embed>
• <iframe>
• <link rel=‘…
• javascript:void(0)
• Radio buttons in IE
• Relative url’s
![Page 56: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/56.jpg)
- 56 -
Caja & CSS – What doesn’t work?
• * hacks
• _ hacks
• IE conditionals
• Insert-after clear fix
• expression()
• @import
• Background images in IE
![Page 57: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/57.jpg)
- 57 -
Y!OS Code OverviewCommon Issues
![Page 58: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/58.jpg)
- 58 -
Common platform issues and questions
• I attempt to authenticate my 2-legged / 3-legged session and receive a “null object error”
• How do I authenticate OAuth using JavaScript?
• I have an existing OpenSocial application. How do I get started?
• I have an existing Facebook application. How do I get started?
• None of my styles are displaying, what’s happening?
• Why PHP / AS3 for the first SDK?
• setSmallView is not working? What’s going on?
![Page 59: Y!OS Overview and Deep Code Dive](https://reader034.fdocuments.net/reader034/viewer/2022052505/555690aad8b42acc5e8b49a4/html5/thumbnails/59.jpg)
- 59 -
Questions?
Thank you!