Upload
jonathan-leblanc
View
1.192
Download
0
Embed Size (px)
DESCRIPTION
Y!OS overview and deep code dive
Citation preview
Yahoo! Open Strategy (Y!OS)Jonathan LeBlanc – Sr. Software Engineer / Tech Evangelist
Yahoo! Developer Network – Partner Integrations
February 19, 2009
2
Yahoo! Open Strategy (Y!OS)
3
• Underlying social platform
• Unified profile system
• Updates across Yahoo!
• Rich connections
Y!OS Establishes a Social Dimension
4
Y!OS: Social APIs
5
Y!OS: Social APIs
6
Y!OS: Social APIs
7
• Open application system
• Tie in core APIs
• Allow rich services on and
off Yahoo!
Y!OS Enables Open Application Development
8
• Yahoo! Application Platform
• Open applications (run on YAP)
• OAuth applications (run on your site)
• http://developer.yahoo.com/yap
Y!OS Applications
9
Y!OS: Open Applications
10
• Richly social infrastructure/
platform changes
• Developer opportunities
across Yahoo! and the web
• Reaching 500M users using
Yahoo! technologies
Y!OS Rewires Yahoo!
Y!OS Components How does it work?
12
Y!OS Components – Open Authentication (OAuth)
• 2-legged & 3-legged OAuth
• Consumer / Shared Secret keys
• Similar to proprietary BBAuth, but
open standard
• http://developer.yahoo.com/oauth/
13
• Allows secured access to private data
• Can use ‘me’ and ‘viewer’ keywords
• Will begin integrating into OSML
• http://developer.yahoo.com/yap/yml
Y!OS Components – Yahoo Markup Language (YML)
14
• Social Directory (read)
• Contacts (read)
• User Status (read / write)
• Updates (read / write)
• http://developer.yahoo.com/social
Y!OS Components – Social APIs
15
• HTML / CSS / JavaScript securer
• Enforces standards
• Includes JSLint (http://www.jslint.com)
• One of the first to integrate Caja
• http://code.google.com/p/google-caja
• http://developer.yahoo.com/yap/guide/caja-
support.html
Y!OS Components – Caja
16
PHP SDK Currently AvailableOpen and OAuth Applications
ActionScript 3 SDK Currently AvailableOpen Applications
Java SDK in DevelopmentOpen and OAuth Applications
Y!OS Components – SDKs
17
• SQL-like syntax
• Private / Public Data
• Use of many YDN APIs
• Captures external data feeds
• Allows custom tables with the “Open
Data Tables” feature
• http://developer.yahoo.com/yql
Y!OS Components – Yahoo! Query Language (YQL)
18
YAP Applications How do I get started?
19
• Runs on YAP
• Supports 2- & 3- legged OAuth
• Supports OpenSocial 0.8
JavaScript APIs
Open Applications
20
Open Application - Views
Small View
Large View
21
Open Application – Small View
22
Open Application – Large View
23
http://developer.yahoo.com/dashboard
24
http://developer.yahoo.com/dashboard
25
26
27
28
• Runs off platform
• Supports 2- & 3-legged OAuth
• Does not contain views
• Requires users to authenticate
session
OAuth Applications
29
http://developer.yahoo.com/dashboard
30
http://developer.yahoo.com/dashboard
31
32
33
34
35
36
YAP Code Dive What can you do with YAP?
37
YAP Code Dive PHP SDK
38
Used For:
- Public user data and open APIs
PHP SDK – 2-Legged OAuth Initialization
39
Used For:
- Private data access
PHP SDK – 3-Legged OAuth Initialization
40
3-Legged OAuth
getSessionedUser(session)
getOwner (session)getUser (session)query (session)getPresence (user)setPresence (user)listUpdates (user)listConnectionUpdates (user)insertUpdate (user)deleteUpdate (user)loadProfile (user)getConnections (user)getContacts (user)setSmallView (user)
2-Legged OAuth
setSmallView (application)query (application)
PHP SDK – Available Methods
41
PHP SDK – Create a User Update
42
PHP SDK – Set the Status of a User
43
YAP Code Dive Yahoo! Markup Language (YML)
44
YML Tags (Large View)
yml:ayml:adyml:audioyml:formyml:friend-selectoryml:if-envyml:messageyml:nameyml:profile-picyml:pronounyml:shareyml:swfyml:user-badge
YML Lite Tags (Small View)
yml:ayml:audioyml:formyml:if-envyml:nameyml:profile-picyml:pronounyml:user-badge
YML – Available Tags
45
YML:A Tab Sample - Controller
46
YML:A Tab Sample – Tab Construction
47
YML:A Tab Sample - Product
48
YML:A Small View Update Sample
49
YML:A Small View Update Sample
50
YAP Code Dive Yahoo! Query Language (YQL)
51
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
YQL – Query Structure
52
YQL Command: SHOW tables
YQL – Available Tables
53
YQL Command: DESC social.connections
YQL – Table Contents
54
YQL – Running a Query
55
YQL – Output Types
56
YAP Code Dive Caja
57
Caja – JavaScript Before Cajoling
58
Caja – JavaScript After Cajoling
59
Caja – Best Practices
• Use OpenSocial JavaScript standards
• Use W3C standards
• Use YML wherever possible
• Unit test all JavaScript
• Read the documentation
(http://developer.yahoo.com/yos)
• Participate in the forums
(http://developer.yahoo.net/forum/)
60
YAP Code Dive Common Questions
61
• I have an existing OpenSocial application. How do I get started?
• I have an existing Facebook application. How do I get started?
• How do I authenticate OAuth using JavaScript?
• Why PHP / AS3 for the first SDK?
• How do users find my application?
Common Questions – Q & A
62
Thank You Questions?