#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2007
    Posts
    5
    Rep Power
    0

    Question FaceBook Graph API with "Link Share" Help


    Hi all,

    I am using a php and real new on programming.

    Now I look the FaceBook Social, it Plug-In pre-build is not suit my need.

    Since I hope make a sidebar on my WordPress that list all the link share (Maybe limit just list 20 of 100 by date).

    So someone tell me can do by Graph API, then I go to FaceBook official web site and apply the APP ID with serect etc already.

    And Graph API Explorer also give me a js or something coding like that...

    Code:
    {
      "data": [
        {
          "id": "335940369797131", 
          "from": {
            "name": "miracle-mart", 
            "category": "Games/toys", 
            "id": "172120544761"
          }, 
          "message": "http://www.miracle-mart.com/store/in...ain_page=index", 
          "picture": "http://external.ak.fbcdn.net/safe_image.php?d=AQC0gJirzN6cpDr_&w=90&h=90&url=http\u00253A\u00252F\u00252Fwww.miracle-mart.com\u00252Fstore\u00252Fimages\u00252Fcharger\u00252FSK-100011.jpg", 
          "link": "http://www.miracle-mart.com/store/in...ain_page=index", 
          "name": "IMax New Chargers in stock now", 
          "icon": "http://static.ak.fbcdn.net/rsrc.php/...S8ecmYRys0.gif", 
          "created_time": "2012-04-11T19:47:58+0000"
        }, 
        {
          "id": "179082288879480", 
          "from": {
            "name": "miracle-mart", 
            "category": "Games/toys", 
            "id": "172120544761"
          }, 
          "message": "http://www.miracle-mart.com/store/in...oducts_id=8563", 
          "picture": "http://external.ak.fbcdn.net/safe_image.php?d=AQADaZIrR0Sxjzia&w=90&h=90&url=http\u00253A\u00252F\u00252Fwww.miracle-mart.com\u00252Fstore\u00252Fimages\u00252Fmedium\u00252Fairbase\u00252FAIRWGCP10A_MED.jpg", 
          "link": "http://www.miracle-mart.com/store/in...oducts_id=8563", 
          "name": "Brushless converter with 10A ESC for Genius CP", 
          "description": "   Brushless converter with 10A ESC for Genius CP [AIRWGCP10A] - Program  Setting Download Plug and Play, No soldering work is required Built in  Brushed-To-Brushless Signal Converter Built in Speed Controller︰10.0A  rating (3.7v) Light weight-- 2.5 gram", 
          "icon": "http://static.ak.fbcdn.net/rsrc.php/...S8ecmYRys0.gif", 
          "created_time": "2012-04-11T19:46:20+0000"
        },

    It is what the "Link Share", but the questions for me, how to integration to PHP or HTML Output/CSS, above coding is useless for human use....

    I need a real example coding to integration it. Can anyone experience can give me a simply example and tips where I can find the real example using above inform to make a HTML base output?

    Thank you of your time and help.
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2007
    Posts
    5
    Rep Power
    0
    http://explorerhome.dyndns.org/photo...LinksShare.jpg




    I hope can list all the "Links Share" in a "Page" like above image.

    I am downloaded the PHP SDK, but don't know need enter what in the something like that?
    Code:
    $naitik = $facebook->api('/me/links');
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2007
    Posts
    5
    Rep Power
    0

    Question


    Hi all,

    I final refer other events programming and change some coding, it look work on the most parts for me.
    But the image it just show are array, how to fix this?

    The web site run result there
    http://www.miracle-mart.com/FB2

    coding there.

    PHP Code:
    $fql    =   "SELECT link_id, owner, owner_comment, created_time, title, summary, url, image_urls              FROM link WHERE owner = 172120544761              ORDER BY created_time desc";              $param  =   array( 'method'    => 'fql.query''query'     => $fql'callback'  => '' );  $fqlResult   =   $facebook->api($param);  //looping through retrieved data foreach( $fqlResult as $keys => $values ){     //printing the data     echo "<div class='event'>";     echo "<div style='float: left; margin: 0 8px 0 0;'>";         echo "<img src={$values[0]['image_urls']} />";     echo "</div>";     echo "<div style='float: left;'>";         echo "<div style='font-size: 26px'>" . $values['title'] . "</div>";         echo "<div>Time: " . $values['created_time'] . "</div>";         echo "<div>URL Location: " . $values['url'] . "</div>";         echo "<div>More Info: " . $values['summary'] . "</div>";         echo "<div>Image Path Info: " . print_r($values['image_urls']) . "</div>";     echo "</div>";     echo "<div style='clear: both'></div>";     echo "</div>";     } ?> </div> 

IMN logo majestic logo threadwatch logo seochat tools logo