Presentation is loading. Please wait.

Presentation is loading. Please wait.

MySpace Developer Platform Dive Into OpenSocial Maxwell Newbould Development Manager OpenSocial Container Team, MySpace Seattle.

Similar presentations


Presentation on theme: "MySpace Developer Platform Dive Into OpenSocial Maxwell Newbould Development Manager OpenSocial Container Team, MySpace Seattle."— Presentation transcript:

1 MySpace Developer Platform Dive Into OpenSocial Maxwell Newbould Development Manager OpenSocial Container Team, MySpace Seattle

2 Overview

3 First Steps… Apply for developer account on http://developer.myspace.com http://developer.myspace.com Demo Code and Editor http://myspace.com/OpenSocialEditor http://myspace.com/OpenSocialEditor OpenSocial on MySpace Developer Platform(MDP) – Container – Owner – Viewer – Profile View – Home View – Canvas View

4 MySpace Developer Platform OpenSocial – MySpace applications written in JavaScript and/or Flash REST API provides functionality for desktop, mobile, offline, and server to server. Secured using oAuth (http://www.oauth.net)

5 How does OpenSocial fit into MDP? OpenSocial is implemented using a container, entirely client-side. The container is a JavaScript wrapper, which allows applications to communicate with the MDP REST API and MySpace.Com. Applications run inside a jail domain so they are isolated from MySpace.Com.

6 OpenSocial 0.7/0.8 Basics Javascript container adheres to OpenSocial standard and wraps our RESTful API All extensions live in MyOpenSpace All reference types, property names and defined values are Enums gadgets namespace provides generic support for apps Obtain reference to current container via singleton - opensocial.Container.get()

7 MyOpenSpace – our Container Exposes extension types and methods Balances XmlHttpRequest connections for you Wraps extended entities and their fields Full docs on developer.myspace.com

8 DataRequests – Basics Obtain a reference to the Container Create a new DataRequest object Add multiple types of requests to your DataRequest, with optional unique keys Call send() Receive data in your callback

9 DataResponse – Basics DataResponse.get(keyname).getData() getField(FIELD enum) for individual fields

10 DataRequests – FetchPerson newFetchPersonRequest(idSpec, param) param[opensocial.DataRequest.PeopleRequestFields.PROFILE_DETAILS] = [opensocial.Person.Field.ID, MyOpenSpace.Person.Field.ABOUT, MyOpenSpace.Person.Field.BOOKS];

11 DataRequests – FetchPeople newFetchPeopleRequest(idSpec, param) opensocial.DataRequest.Group.VIEWER_FRIENDS opensocial.DataRequest.Group.OWNER_FRIENDS param[MyOpenSpace.DetailType.GET_ONLINE] = true; param[MyOpenSpace.DetailType.GET_STATUS] = true; param[MyOpenSpace.DetailType.GET_MOOD] = true; param[opensocial.DataRequest.PeopleRequestFields.SORT_ORDER] = opensocial.DataRequest.SortOrder.TOP_FRIENDS;

12 DataRequests – FetchPersonAppData newFetchPersonAppDataRequest(idSpec, keys) VIEWER / OWNER / VIEWER_FRIENDS / OWNER_FRIENDS Keys can be *, or a key name. Values should be JSON strings

13 DataRequests – UpdatePersonAppData newUpdatePersonAppDataRequest(idSpec, key, value) ONLY VIEWER is supported Key is single key name Value is JSON-encoded data

14 DataRequests – DeletePersonAppData newFetchDeleteAppDataRequest(idSpec, keys) Only VIEWER is supported Keys can be a single or array of key names. No data in callback

15 MySpace Extensions newFetchPhoto(s)Request newFetchAlbum(s)Request newFetchVideo(s)Request newFetchPersonStatusRequest newFetchPersonMoodRequest newFetchPersonIndicatorsRequest newFetchPersonFriendshipRequest newFetchPeopleFriendshipRequest What do you want to see come next?

16 MySpace Extensions PostTo – Profiles – Bulletins – Comments – SendMessage – Blog See PostTo Sample – OpenSocial Extensions app on apps.myspace.com

17 3 rd Party Content – makeRequest() gadgets.io.makeRequest(url, callback, opt_params) – gadgets.io.RequestParameters – gadgets.io.MethodType GET / POST / PUT / DELETE / HEAD – gadgets.io.ContentType TEXT / DOM / JSON / FEED – gadgets.io.AuthorizationType NONE / SIGNED / AUTHENTICATED

18 Viral Methods NO INCENTIVIZATION ALLOWED! requestSendMesage – Only message friends – Requires user action – Only send one message per user action requestShareApp – Coming soon – Sends invite to install application to specified recipient

19 View Navigation – requestNavigateTo Views are found in opensocial.getEnvironment().getSupportedSur faces() Home, Profile, and Canvas views gadgets.view.requestNavigateTo(supported_vi ew, params); params is an object to pass around views – retrieve using gadgets.view.getParams()

20 Prefs – Localization Support gadgets.Prefs() getLang() – en for English getCountry() - US for USA Full Localization support – resources using en-US

21 Window – adjustHeight/getViewportDimensions gadget.window.adjustHeight(height) – If no height passed, app will resize to fit content – If height is between 0.0(0%) and 1.0(100%), app will resize based on browser height – If height is greater than 1, resize to that height (pixels) – Upper limits are defined per view gadgets.window.getViewportDimensions – Returns { width: 0, height : 0}

22 Environment – getDomain/supportsField opensocial.Environment.getDomain() – Returns myspace.com opensocial.Environment.supportsField(objectT ype, fieldName) – objectType is opensocial.Environment.ObjectType – fieldName is string for field name

23 For more help http://Developer.MySpace.Com Irc.freenode.net #myspacedev http://twitter.com/myspacedevteam http://Myspace.com/OpenSocialEditor http://code.google.com/apis/opensocial http://www.aptana.com/studio – Provides JS auto-completion for OpenSocial

24 Q & A Design Questions? Policy Questions? Architectural / Scaling Questions?


Download ppt "MySpace Developer Platform Dive Into OpenSocial Maxwell Newbould Development Manager OpenSocial Container Team, MySpace Seattle."

Similar presentations


Ads by Google