Friday, December 28, 2007

From OpenSocial's sandbox

I've been playing out with OpenSocial's API from within Orkut's sandbox for a while. This API intends to integrate social sites like Orkut, MySpace, Hi5 and others through a javascript API.
In order to test, I've signed up for a sandbox account and started reading the documentation api .
After creating the Hello Worlds gadgets - by the way, in order to use Orkut's sandbox, Google gadgets need to be created - I've came across the output on the right.
I'm still wondering why so few friends are retrieved... maybe it's a sandbox limitation... I don't know... I've just posted this to find it out.
Ooops... they've just answered that... only friends who are also in the sandbox are listed... that's why it only retrieves a couple friends :)

Small ruby script to remotely run a program

In case one needs to remotely run a program from some ruby application, an easy way to do that is using Net-ssh. It remotely runs commands through ssh.
After installing the gem through a simple
gem install net-ssh

the following script can be run in order to call the 'ls' application, used to list directory's contents:

require 'rubygems'
require 'net/ssh'

session = Net::SSH.start('your-host','your-user', 'your-password')"ls") do | ls |
ls.on_stdout do | p, data |
puts "#{data}"