Can you restore Skype status using JSONP?

Does anyone know the url to get Skype status via JSONP?

So far, I have found the XML status URL ( http://mystatus.skype.com/username.xml ).

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

Simon.

+4
source share
3 answers

You can change the title to "JSONP" instead of JSON. Is this what you want.

JSONP captures cross-domains, how it works, without proxy servers, transferring data to samples. This is similar to the most hacky useful technology that I come to mind right now. :)

I tricked Skype about this - the easiest way would be for their servers to have an official, documented JSONP interface. I hope they do it.

At the same time, this is how I solved the problem:

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

This allows him (through curl running on the server) to receive information mystatus.skype.com/myuserid.num(or .txt).

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

What is it. Pheeew ... :)

+4
source

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

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

It will return "Online" or "Offline". About Cross-Domain AJAX, you can only do this through the server, and direct calling is definitely not allowed.

+6
source

You can also get it using PHP

 function getSkypeStatus($username) { $data = file_get_contents('http://mystatus.skype.com/' . urlencode($username) . '.xml'); return strpos($data, '<presence xml:lang="en">Offline</presence>') ? 'Offline' : 'Online'; } 

OR

 function getSkypeStatus($username) { $data = file_get_contents('http://mystatus.skype.com/' . urlencode($username) . '.xml'); preg_match('@<presence xml:lang="en">(.*?)</presence>@i', $data, $match); return isset($match[1]) ? $match[1] : 'Error retrieving status'; } 

Hurrah!

Thanks to Bradgrafelman from - http://www.phpbuilder.com/board/showthread.php?t=10361050

+3
source

Source: https://habr.com/ru/post/1315866/


All Articles