Need help with displaying my latest Facebook status on my website

Discussion in 'Facebook API' started by AdWords-Advice, Jun 10, 2011.

  1. #1
    This was working for over a year however recent changes to the Facebook API now provides a error rather than my status

    I believe I need to add an "app token" is anyone able to help?
     
    AdWords-Advice, Jun 10, 2011 IP
  2. The Webby

    The Webby Peon

    Messages:
    1,852
    Likes Received:
    30
    Best Answers:
    1
    Trophy Points:
    0
    #2
    Facebook API
    https://api.facebook.com/method/status.get?uid=userid_here&access_token=access_token_here
    Code (markup):
    OR
    Graph API
    https://graph.facebook.com/userid_here?access_token=access_token_here
    Code (markup):
    How to get Access_token.
    
    <?php 
    require('facebook.php');
    
    $app_id = 'XXXXXXXXXXXXX';
    $secret = 'XXXXXXXXXXXXXX';
    $canvas_page = 'http://www.whatever.com';
    
    $auth_url = "https://www.facebook.com/dialog/oauth?client_id=" 
    . $app_id . "&scope=email,offline_access&redirect_uri=" . urlencode($canvas_page);
    
    $code = $_REQUEST["code"];
    if(empty($code)){
    	echo("<script> top.location.href='" . $auth_url . "'</script>");
    }
    $token_url = "https://graph.facebook.com/oauth/access_token?client_id=". $app_id . "&redirect_uri=" . urlencode($canvas_page) . "&client_secret=". $secret . "&code=" . $code;
    $access_token = file_get_contents($token_url);
    
    PHP:
    OR if
     
    The Webby, Jun 12, 2011 IP