你有几个API来。我建议你使用最后一个图形API。然后你有几个SDK,我知道PHP和Javascript SDK。
在javascript中,使用jQuery你可以做
<body>
<div>
<button id="login">Login</button>
<button id="logout">Logout</button>
<button id="disconnect">Disconnect</button>
</div>
<div id="user-info"></div>
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script>
// initialize the library with the API key
FB.init({ apiKey: 'YOUR_API_KEY' });
// fetch the status on load
FB.getLoginStatus(handleSessionResponse);
$('#login').bind('click', function() {
FB.login(handleSessionResponse, {
// here you specify the perms your application requires
perms:'publish_stream, offline_access, manage_pages, read_stream'
});
});
$('#logout').bind('click', function() {
FB.logout(handleSessionResponse);
});
$('#disconnect').bind('click', function() {
FB.api({ method: 'Auth.revokeAuthorization' }, function(response) {
clearDisplay();
});
});
// no user, clear display
function clearDisplay() {
$('#user-info').hide('fast');
}
// handle a session response from any of the auth related calls
function handleSessionResponse(response) {
// if we dont have a session, just hide the user info
if (!response.session) {
clearDisplay();
return;
}
// if we have a session, query for the user's profile picture and name
FB.api('/me/accounts', function(response) {
$('#user-info').html(JSON.stringify(response));
});
}
</script>
</body>
这个例子是从的JavaScript SDK的资料为准。您需要从facebook开发者页面获取API_KEY http://www.facebook.com/developers/apps.php
您应该更清楚地了解您尝试的请求。 – 2011-01-06 14:05:44
帐户的自动注册听起来像垃圾邮件发送者会做的 – CodesInChaos 2011-01-06 14:06:50