OpenSocial on Orkut Tutorial – Part 1 (Basic Setup)
May I request you to checkout the radio on the sidebar while you read this article. Its powered by my startup Muziboo.com. Some amazing music by independent musicians. Am sure you would love the music while reading this long post.
So you want to leverage the social graph :)
I will be finally writing (atleast a basic) Muziboo app on opensocial over the next week or so. I thought of actually documenting the whole process here. I find very little tutorials or documentation other than the official one at google code. Hopefully if I come up with a working app, other people can read this and may be it will help some poor souls. I am assuming I am finding opensocial complicated because I am not a javascript or web architecture guru. I certainly find it more complicated than the facebook api. Anyway lets see how to get started with development here. Lot of what I write may be ruby on rails specifc (atleast in the later posts)
Resources
Ok so lets talk of the resource you need to checkout before you dive into making an opensocial app for orkut. Remember that as of today (March 18th) the orkut container runs opensocial 0.7 so don’t waste your time trying to run examples built on older versions of opensocial.
Orkut Sandbox: To test the app .. ofcourse
Developer Guide: You will find many more links here to reference, specs etc.
Code Runner (lets you make javascript calls without modifying your source xml file. Great for debugging)
OpenSocial Official Blog : To make sure you know whats coming up. When is the api changing and other critical stuff
Opensocial Forums : Opensocial and other container (such as orkut, ning) container
Setting up a proxy
You will be most likely developing on your local machine. However opensocial needs to access a public url to fetch the gadget xml file. You can find lots of hosting options here. However if you don’t want to checkin and checkout your code everytime you make a change, you need to run a ssh tunnel to let orkut access your local machine and a webserver running on some port there. The process is explained in detail for facebook here but the basics remain the same. The command that finally works for me is
$ ssh -nNT -g -R *:REMOTE_PORT:0.0.0.0:LOCAL_PORT REMOTE_USER@REMOTE_SERVER.COM
Bypassing the orkut cache
Orkut caches your gadget file and refreshes it probably every hour or so but since you are coding away so fast :) you need to make sure your changes are immediately reflected. No problem just append &bpc=1 at the end of the canvas url. This will make sure the cache is bypassed.
Basic app to check the whole setup
Once you have read so far, try a basic app by following the tutorial
Hopefully everything will work fine and you will see a greeting. The gold old hello world!
See ya around! The next topic will cover some basic integration stuff with your existing website (if I am able to figure it out till then)
Tags: opensocial, rubyonrails, tutorial, orkut sandbox
Popularity: 9% [?]





