views:

302

answers:

2

I have a rails application in which user provides his skype address.I want to able to determine the skype status of the user(online or offline) when some one sees his profile. How can i do that in my application? Does any know of a ready to use gem/plugin?

+1  A: 

First off - user must allow you to see his/her online skype status. After that - it's easy if you read skype api. Or just google for any gem/plugin

Eimantas
Thank you guys !!!
Ishu
+2  A: 

Only showing the status to the visitor doesn't really require you to do fetch the status yourself.

The easiest way to do it is to let the visitors browser contact Skype itself to query the status. However, as Eimantas pointed out. The user must be allowing the status to be shown from the web.

After that, it's just a simple javascript and html:

<script type="text/javascript" 
      src="http://download.skype.com/share/skypebuttons/js/skypeCheck.js"&gt;&lt;/script&gt;
<a href="skype:<fill in username here>?call">
   <img src="http://mystatus.skype.com/bigclassic/&lt;fill in username here>" 
       style="border: none;" width="182" height="44" alt="<fill in username here> status" />
</a>

This script also lets you call the person through skype, if you don't want that functionality it should be enough to include only the image and skip the link and the javascript.

Have a look at http://www.skype.com/share/buttons/ if you want more alternatives.

Jimmy Stenke
I like offloading this functionality to the user.
James A. Rosen
You might not need the script. I didn't. But the button selection they offer is limited and they don't use transparent backgrounds at least on all buttons, which made the ones I needed look way ugly.There's another way by just getting the status number (0..8) for your account. Fetch http://mystatus.skype.com/<username>.num . Problem is cross domain Ajax fetches (I did this from JS). They should make a JSONP interface to get those 0..8 numbers, imho.
akauppi