tags:

views:

45

answers:

2

Does anyone know of a URL to get your Skype status using JSON?

I've only found an XML status URL so far (http://mystatus.skype.com/username.xml).

(I'm trying to query Skype using AJAX. Yes, I could use a server-side proxy script to beat the cross-domain limits, but a direct call would be preferred.)

Simon.

+2  A: 

Well apparently you can get a text-only version of the status by changing the extension to .txt:

http://mystatus.skype.com/username.txt

It will return "Online" or "Offline". About the Cross-domain AJAX, you can only do it via server and direct call is definitely not allowed.

thephpdeveloper
Interesting....
Thqr
A: 

You might change the headline to 'JSONP' instead of JSON. That's what you want.

JSONP hijacks cross domain fetches like this to work, without server proxies, by carrying the data in fetches. It's like the most hackish useful technology I come to mind, right now. :)

I nagged Skype about this - the easiest way out would be for their servers to have an official, documented JSONP interface. I hope they'll do that.

In the mean time, this is how I got the problem solved:

$enable_native   = true;
$valid_url_regex = '/^http:\/\/mystatus\.skype\.com\/myuserid.*/';

This allows it to fetch (via curl running on the server) the mystatus.skype.com/myuserid.num (or .txt) information.

  • Fetching from JS with URL:
ba-simple-proxy.php?url=http%3A%2F%2Fmystatus.skype.com%2Fmyuserid.num&mode=native&full_status=1

That's it. Pheeew... :)

akauppi