62
Yahoo! Open Strategy (Y!OS) Jonathan LeBlanc – Sr. Software Engineer / Tech Evangelist Yahoo! Developer Network – Partner Integrations February 19, 2009

UWash Hack U - Y!OS

Embed Size (px)

DESCRIPTION

Y!OS overview and deep code dive

Citation preview

Page 1: UWash Hack U - Y!OS

Yahoo! Open Strategy (Y!OS)Jonathan LeBlanc – Sr. Software Engineer / Tech Evangelist

Yahoo! Developer Network – Partner Integrations

February 19, 2009

Page 2: UWash Hack U - Y!OS

2

Yahoo! Open Strategy (Y!OS)

Page 3: UWash Hack U - Y!OS

3

• Underlying social platform

• Unified profile system

• Updates across Yahoo!

• Rich connections

Y!OS Establishes a Social Dimension

Page 4: UWash Hack U - Y!OS

4

Y!OS: Social APIs

Page 5: UWash Hack U - Y!OS

5

Y!OS: Social APIs

Page 6: UWash Hack U - Y!OS

6

Y!OS: Social APIs

Page 7: UWash Hack U - Y!OS

7

• Open application system

• Tie in core APIs

• Allow rich services on and

off Yahoo!

Y!OS Enables Open Application Development

Page 8: UWash Hack U - Y!OS

8

• Yahoo! Application Platform

• Open applications (run on YAP)

• OAuth applications (run on your site)

• http://developer.yahoo.com/yap

Y!OS Applications

Page 9: UWash Hack U - Y!OS

9

Y!OS: Open Applications

Page 10: UWash Hack U - Y!OS

10

• Richly social infrastructure/

platform changes

• Developer opportunities

across Yahoo! and the web

• Reaching 500M users using

Yahoo! technologies

Y!OS Rewires Yahoo!

Page 11: UWash Hack U - Y!OS

Y!OS Components How does it work?

Page 12: UWash Hack U - Y!OS

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/

Page 13: UWash Hack U - Y!OS

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)

Page 14: UWash Hack U - Y!OS

14

• Social Directory (read)

• Contacts (read)

• User Status (read / write)

• Updates (read / write)

• http://developer.yahoo.com/social

Y!OS Components – Social APIs

Page 15: UWash Hack U - Y!OS

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

Page 16: UWash Hack U - Y!OS

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

Page 17: UWash Hack U - Y!OS

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)

Page 18: UWash Hack U - Y!OS

18

YAP Applications How do I get started?

Page 19: UWash Hack U - Y!OS

19

• Runs on YAP

• Supports 2- & 3- legged OAuth

• Supports OpenSocial 0.8

JavaScript APIs

Open Applications

Page 20: UWash Hack U - Y!OS

20

Open Application - Views

Small View

Large View

Page 21: UWash Hack U - Y!OS

21

Open Application – Small View

Page 22: UWash Hack U - Y!OS

22

Open Application – Large View

Page 23: UWash Hack U - Y!OS

23

http://developer.yahoo.com/dashboard

Page 24: UWash Hack U - Y!OS

24

http://developer.yahoo.com/dashboard

Page 25: UWash Hack U - Y!OS

25

Page 26: UWash Hack U - Y!OS

26

Page 27: UWash Hack U - Y!OS

27

Page 28: UWash Hack U - Y!OS

28

• Runs off platform

• Supports 2- & 3-legged OAuth

• Does not contain views

• Requires users to authenticate

session

OAuth Applications

Page 29: UWash Hack U - Y!OS

29

http://developer.yahoo.com/dashboard

Page 30: UWash Hack U - Y!OS

30

http://developer.yahoo.com/dashboard

Page 31: UWash Hack U - Y!OS

31

Page 32: UWash Hack U - Y!OS

32

Page 33: UWash Hack U - Y!OS

33

Page 34: UWash Hack U - Y!OS

34

Page 35: UWash Hack U - Y!OS

35

Page 36: UWash Hack U - Y!OS

36

YAP Code Dive What can you do with YAP?

Page 37: UWash Hack U - Y!OS

37

YAP Code Dive PHP SDK

Page 38: UWash Hack U - Y!OS

38

Used For:

- Public user data and open APIs

PHP SDK – 2-Legged OAuth Initialization

Page 39: UWash Hack U - Y!OS

39

Used For:

- Private data access

PHP SDK – 3-Legged OAuth Initialization

Page 40: UWash Hack U - Y!OS

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

Page 41: UWash Hack U - Y!OS

41

PHP SDK – Create a User Update

Page 42: UWash Hack U - Y!OS

42

PHP SDK – Set the Status of a User

Page 43: UWash Hack U - Y!OS

43

YAP Code Dive Yahoo! Markup Language (YML)

Page 44: UWash Hack U - Y!OS

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

Page 45: UWash Hack U - Y!OS

45

YML:A Tab Sample - Controller

Page 46: UWash Hack U - Y!OS

46

YML:A Tab Sample – Tab Construction

Page 47: UWash Hack U - Y!OS

47

YML:A Tab Sample - Product

Page 48: UWash Hack U - Y!OS

48

YML:A Small View Update Sample

Page 49: UWash Hack U - Y!OS

49

YML:A Small View Update Sample

Page 50: UWash Hack U - Y!OS

50

YAP Code Dive Yahoo! Query Language (YQL)

Page 51: UWash Hack U - Y!OS

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

Page 52: UWash Hack U - Y!OS

52

YQL Command: SHOW tables

YQL – Available Tables

Page 53: UWash Hack U - Y!OS

53

YQL Command: DESC social.connections

YQL – Table Contents

Page 54: UWash Hack U - Y!OS

54

YQL – Running a Query

Page 55: UWash Hack U - Y!OS

55

YQL – Output Types

Page 56: UWash Hack U - Y!OS

56

YAP Code Dive Caja

Page 57: UWash Hack U - Y!OS

57

Caja – JavaScript Before Cajoling

Page 58: UWash Hack U - Y!OS

58

Caja – JavaScript After Cajoling

Page 59: UWash Hack U - Y!OS

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/)

Page 60: UWash Hack U - Y!OS

60

YAP Code Dive Common Questions

Page 61: UWash Hack U - Y!OS

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

Page 62: UWash Hack U - Y!OS

62

Thank You Questions?