开发者

Facebook wall posts

I need some help please. I've been lost in the graph facebook documentation for the last 2 hours. Please send an advice about how could I get my facebook wall posts/info, etc . . . ? I need an access token. I've tried in many ways to get开发者_开发问答 it, but is useless. I don't understand how to build that url . . . Please, just tell me from where should I start? Thank you!


It's not very clear what you are trying to do or what language you are trying to do this in. But the graph api isn't very difficult to tackle if you follow their documentation. You need to first prompt the user to authenticate with your application and any extended permissions. Then you can make calls to the graph api (or FQL queries if needed).

Here is a full example of getting Facebook wall posts like you asked. Reading wall posts will require the read_stream extended permission.

<!DOCTYPE html>
<html>
<body>
<div id="fb-root"></div>
<a href="#" onclick="getFeed();return false;">Get Feed</a>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script>
  FB.init({ appId  : 'yourFacebookAppId', status : true, cookie : true, xfbml  : true });

  function getFeed() {  
    FB.login(function(response) {
      if (response.session && response.perms) {
        FB.api('/me/home',
          function(response) {
            alert(response.data.length);
            for (var i = 0; i < response.data.length; i++) { 
              alert("message from " + response.data[i].from.name + ": " + response.data[i].message);
            }
          }
        );
      }
    } , {perms:'read_stream'}); 
}
</script>
</body>
</html>

This can also be done in server code like PHP but for generic questions like this and first getting started the javascript api is probably the easiest until you know more of what you are trying to do.


https://developers.facebook.com/docs/authentication/

Facebook Platform uses the OAuth 2.0 protocol for authentication and authorization. We support a number of different OAuth flows that you can use within your Website, mobile and desktop apps.

This document outlines that different mechanisms Facebook Platform uses to support each of these flows. The examples in this document use PHP for server-side programming and HTML/JavaScript for client-side code. These examples are very straightforward and easily translatable to other languages.

This is where you need to start.


try this one https://graph.facebook.com/USER_ID/feed?access_token=TOEKN Just replace the USER_ID and TOKEN with the users id and access_token and you'll get a list of all the wall posts in a json format and also you can navigate the result page using the Previous and Next link at the bottom .

Hope that will solve your problem .

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜