OpenSocial - PowerPoint PPT Presentation

1 / 19
About This Presentation
Title:

OpenSocial

Description:

There are many other networking sites like Orkut, MySpace, hi5, linkedin etc. ... Initially supported by Friendster, hi5, MySpace, Ning, orkut and many more. ... – PowerPoint PPT presentation

Number of Views:426
Avg rating:3.0/5.0
Slides: 20
Provided by: pravin
Category:
Tags: opensocial | hi5 | orkut

less

Transcript and Presenter's Notes

Title: OpenSocial


1
OpenSocial
  • Creating Orkut Applications

2
Before We Start
  • If you have any questions, please don't hesitate
    to ask.
  • During presentation we will create a sample
    application and run at Orkut.
  • This session is not about OpenSocial
    container/Shindig.

3
About Me
  • Doing PHP since 2000.
  • Service Delivery Manager
  • _at_ Clarion Technologies Pvt. Ltd.
  • CMMI Level 3 Company
  • My application Cities I visited listed at Orkut
    directory.

4
Something about you
  • How many of you know OpenSocial?
  • How many of you used Facebook Applications?
  • How many of you used Orkut Applications?.

5
Why OpenSocial?
  • Facebook has its own API. It became popular with
    launch of applications.
  • There are many other networking sites like Orkut,
    MySpace, hi5, linkedin etc.
  • What if all creates their own API? Developer will
    have to create different application for each
    platform.

6
What an idea
7
What is OpenSocial?
  • OpenSocial defines a common API for social
    applications across multiple websites. Built from
    standard JavaScript and HTML, developers can
    create apps with OpenSocial that access a
    social network's friends and update
    feeds.

8
Journey of OpenSocial
  • Launched on November 1, 2007 with initial version
    0.5
  • Initially supported by Friendster, hi5, MySpace,
    Ning, orkut and many more.
  • At launch Flixster, FotoFlexer, iLike, Newsgator,
    RockYou, Slide, Theikos, and VirtualTourist
    presented applications.
  • Current version 0.8 released on May 28, 2008.

9
Who all are using it.
10
Basics
  • Simple Hello World Application
    (helloworld.xml)
  • lt?xml version"1.0" encoding"UTF-8" ?gt
  • ltModulegt
  • ltModulePrefs title"Hello World!"gt
  • ltRequire feature"opensocial-0.8" /gt
  • lt/ModulePrefsgt
  • ltContent type"html"gt
  • lt!CDATA Hello, world!gt
  • lt/Contentgt
  • lt/Modulegt

11
Listing Friends 1 - xml
  • lt?xml version"1.0" encoding"UTF-8"?gt
  • ltModulegt
  • ltModulePrefs titlePHPCamp- List Friends"gt
  • ltRequire feature"opensocial-0.7"/gt
  • lt/ModulePrefsgt
  • ltContent type"html"gt
  • lt!CDATA ltscript type"text/javascript"gt /
    ... / lt/scriptgt
  • ltdiv id'main'gt
  • Your friends ltdiv id'friends'gtlt/divgt
  • lt/divgt
  • gt lt/Contentgt lt/Modulegt

12
Listing Friends 2- js
  • ltscript languageJavaScriptgt
  • gadgets.util.registerOnLoadHandler(init)
  • function init()
  • var req opensocial.newDataRequest()
  • var opt_params
  • opt_paramsopensocial.DataRequest.PeopleRequest
    Fields.MAX 20
  • req.add(req.newFetchPeopleRequest('OWNER_FRIEN
    DS',opt_params), 'ownerFriends')
  • req.send(onLoadFriends)
  • lt/scriptgt

13
Listing Friends 3- js
  • function onLoadFriends(data)
  • var viewerFriends data.get('viewerFriends').get
    Data()
  • var html""
  • html'ltulgt'
  • viewerFriends.each(function(person)
  • var friend_thumbnail person.getField(opensocial
    .Person.Field.THUMBNAIL_URL)
  • html 'ltligt' person.getDisplayName()
    'ltimg src"'friend_thumbnail'"gt lt/ligt'
  • )
  • html 'lt/ulgt'
  • document.getElementById('friends').innerHTML
    html

14
Listing Friends 4- output
15
What else you can do
  • Send request to your server and return
    information in text,XML or JSON format.
  • Insert activity in users updates.
  • Use of AJAX.
  • Store information at Orkut server.
  • Fetch owner and his friends information.

16
What you cant do
  • Post scraps through your application.
  • Fetch personal information like phone number,
    birth date etc.
  • Communicate between different OpenSocial sites.
  • Any change at Orkut site. Application runs only
    at the space allocated to it e.g. profile view
    and container view.
  • Run exactly same application on all supported
    sites.

17
References
  • Orkut OpenSocial Blog http//orkut-open-social.blo
    gspot.com/
  • Orkut Developer Forum http//groups.google.com/gro
    up/opensocial-orkut
  • Orkut developer Guide http//code.google.com/apis/
    orkut/docs/orkutdevguide.html
  • OpenSocial Tutorial http//code.google.com/apis/op
    ensocial/articles/tutorial/tutorial-0.8.html

18
Thats it!
  • If you have any questions, don't hesitate to ask.
  • Demonstration scripts and forms can be seen under
  • http//www.myphpdunia.com/phpcamp.html
  • Feel free to contact me at pravin_nirmal_at_yahoo.com

19
Thanks a lot for your interest.
Write a Comment
User Comments (0)
About PowerShow.com