There isn't a common interface for all social networks, some offer API's to check for username availablity, some don't offer it at all and with others you can check if the userpage returns a 200 HTTP header status to find out if it exists.
Your best bet is to list all the social networks you want to check and then look for a PHP script they offer to communicate with their API.
I think each network have its method for security reason, as example facebook will not let you in except with his own api. Facebook authentication.
If it is the second case, can anyone give an example of the function that checks the username (for any social network)?
I don't think this functionality exist because social networks doesn't provide directly instead you can simulate it by sending a request to create an account, if they doesn't accept it that is mean such user exist, better to use curl.
发布评论
评论(2)
所有社交网络都没有通用的接口,有些提供 API 来检查用户名可用性,有些根本不提供,而另一些则可以检查用户页面是否返回 200 HTTP 标头状态以查明它是否存在。
最好的办法是列出您想要检查的所有社交网络,然后查找他们提供的 PHP 脚本来与其 API 进行通信。
例如:您可以使用众多 PHP Twitter 库中的任何一个来查找用户名是否存在: http ://developer.twitter.com/pages/libraries#php
There isn't a common interface for all social networks, some offer API's to check for username availablity, some don't offer it at all and with others you can check if the userpage returns a 200 HTTP header status to find out if it exists.
Your best bet is to list all the social networks you want to check and then look for a PHP script they offer to communicate with their API.
For example: you can use the any of the numerous PHP Twitter libraries to look up if a username exists: http://developer.twitter.com/pages/libraries#php
我认为出于安全原因,每个网络都有自己的方法,例如 facebook 不会让你进入,除非使用他自己的 api。
Facebook 身份验证。
我认为这个功能不存在,因为社交网络不直接提供,而是您可以通过发送创建帐户的请求来模拟它,如果他们不接受它,那就意味着这样的用户存在,最好使用 卷曲。
I think each network have its method for security reason, as example facebook will not let you in except with his own api.
Facebook authentication.
I don't think this functionality exist because social networks doesn't provide directly instead you can simulate it by sending a request to create an account, if they doesn't accept it that is mean such user exist, better to use curl.