How can 开发者_JS百科I update my facebook tatus messages through the API?
There are a lot of examples around the net but all of they seem to be deprecated with the New Facebook API.
Regards!
A status message is now just a post. So you using the Graph API to publish a post to the user. You basically just need to do an HTTP POST to http://graph.facebook.com/PROFILE_ID/feed. The POST body should contain the value for the message. If you want the status to change you must only set the message. Here is how you would do it with curl.
curl -F 'access_token=...' \
-F 'message=Check out this funny article' \
https://graph.facebook.com/me/feed
You can find more information about this here: http://developers.facebook.com/docs/reference/api/post
Using javascript graph api sdk also it is possible
FB.api('/me/feed', 'post', { message: body }, function(response) {
if (!response || response.error) {
alert("error");
} else {
alert("Status posted");
}
//Get the access token and secret.and check if true than write below code in your condition
url = "https://graph.facebook.com/me/feed?access_token=" + oAuth.Token;
json = oAuth.WebRequest(oAuthFacebook.Method.POST, url, "message=" + msg);
精彩评论