Example:
Here is an example of an OpenlySociable Micro app, which implements the ‘Friend List’ app from the OpenSocial documentation site:
require 'openly_sociable_micro' OpenSocial.make_app :ListFriends module ListFriends::Controllers class Index < R '/' def get @title = "Friend List" render :index end end end module ListFriends::Views def index javascript :friends div(:id => "message") end end OpenSocial.start_mongrel :ListFriends, :port => 3301, :root => "/"
Here the ‘javascript :friends’ refers to a friends.js widget-specific javascript file that lives in the same directory. OpenlySociable Micro uses the Builder XML library to wrap a view action’s results into an XML format served by Mongrel. This format is the Google Gadget format, which OpenSocial containers like Orkut and Ning recognize and display.
Getting Started:
- Install the gem as described below
- Read through the Camping mini-app
- Write your first widget!
Installation:
OpenlySociable Micro can be found here:
http://svn.intridea.com/svn/public/openly_sociable/micro/
You can also install the gem by downloading it and running:
gem install openly_sociable_micro-0.0.1.gem
in your download path.
Plans to integrate OpenlySociable Micro into Rubyforge are underway. What is it?:
‘OpenlySociable Micro’ is a clean, simple and concise way of writing OpenSocial widgets. It uses the Camping microframework and Mongrel to allow developers to write self-contained widgets for OpenSocial-enabled websites with none of the overhead of a full-blown Rails application.