1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

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
    SEMrush
    I believe I need to add an "app token" is anyone able to help?
     
    AdWords-Advice, Jun 10, 2011 IP
    SEMrush
  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