您可以使用JSONP检索您的Skype状态? [英] Can you retrieve your Skype status using JSONP?
问题描述
有谁知道网址的使用JSONP让你的Skype状态?
我只找到了一个XML状态URL至今(<$ C C $> http://mystatus.skype.com/username.xml )。
(我试图使用AJAX是的,我可以用一个服务器端代理脚本击败跨域限制Skype的查询,而是直接调用将是真棒。)的
西蒙。
您可能会更改标题为JSONP',而不是JSON。这就是你想要的。
JSONP劫持跨域取这样的工作,无需服务器代理,所搭载的数据存取。这就像我浮现在脑海中,现在最hackish的有用的技术。 :)
我唠叨的Skype这一点 - 最简单的出路将是他们的服务器有一个正式的,记录在案JSONP接口。我希望他们会做到这一点。
在平均时间,这是我得到了解决了这个问题:
-
放在这个PHP脚本我的服务器上,沿着通常的HTML: HTTP:/ /benalman.com/projects/php-simple-proxy/
-
编辑它,像这样的配置:
$ enable_native = TRUE; $ valid_url_regex ='/^http:\/\/mystatus\.skype\.com\/myuserid.*/';
这使得它能够获取(通过卷曲在服务器上运行)的mystatus.skype.com/myuserid.num(或.txt)的信息。
- 从JS的读取与网址:
<$p$p><$c$c>ba-simple-proxy.php?url=http%3A%2F%2Fmystatus.skype.com%2Fmyuserid.num&mode=native&full_status=1
就是这样。 Pheeew ...:)
Does anyone know of a URL to get your Skype status using JSONP?
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 awesome.)
Simon.
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:
Placed this PHP script on my server, alongside the usual HTML: http://benalman.com/projects/php-simple-proxy/
Edited the configuration of it like so:
$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... :)
这篇关于您可以使用JSONP检索您的Skype状态?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!