facebook,如何获得有关喜欢的更多信息?

时间:2011-06-16 16:13:51

标签: facebook api facebook-like

我抓住了我朋友的喜欢,但我也想抓住那些喜欢的链接。

当你喜欢墙上的东西时会指出某些东西,无论你喜欢什么。我正在谈论所有这些链接。

编辑: 我现在得到的回应看起来像是:

{
"data": [
  {
     "name": "Seam Legging - Shooting Star",
     "category": "Product/service",
     "id": "114310318626160",
     "created_time": "2011-06-15T22:26:18+0000"
  },
  {
     "name": "Junior's 535\u2122 Legging - Seaport Blue",
     "category": "Product/service",
     "id": "146626898728947",
     "created_time": "2011-06-15T22:26:17+0000"
  },
  {
     "name": "Singer Needed For Pleasure Band CA Music   Vocals Los Angeles, CA auditions Modeling Acting Auditions & Casting Calls ExploreTalent modeling audition america next top model",
     "category": "Website",
     "id": "122740287810745",
     "created_time": "2011-06-15T19:06:13+0000"
  },
  {
     "name": "Looking for singers R/B Britney type K P Music   Vocals Los Angeles, CA auditions Modeling Acting Auditions & Casting Calls ExploreTalent extras acting extra",
     "category": "Website",
     "id": "130850386995940",
     "created_time": "2011-06-15T19:06:12+0000"
  },......

EDIT2:

我一直在尝试使用FQL。但我仍然没有得到内部的链接喜欢:

到目前为止她是我的代码

<?php
$facebook = new Facebook(array(
'appId'  => $client_id,
'secret' => $client_secret,
'cookie' => true,
));

$session = $facebook->getSession();
$likelink = $facebook->api(array( 'method' => 'fql.query', 'query' => 'SELECT likes FROM stream WHERE source_id ='.$myself.'', ));
print_r($likelink);

?>

1 个答案:

答案 0 :(得分:2)

在检索到你喜欢的喜欢列表后,你需要浏览它们,获取ID并打开:

https://graph.facebook.com/ID

这将为您提供有关您喜欢的特定项目的更多详细信息。例如,对于数据中的第一项:

https://graph.facebook.com/114310318626160

{
   "id": "114310318626160",
   "name": "Seam Legging - Shooting Star",
   "picture": "http://profile.ak.fbcdn.net/hprofile-ak-snc4/50281_114310318626160_1881220_s.jpg",
   "link": "http://r.levi.com/product/index.jsp?productId=4068748",
   "likes": 115,
   "category": "Product/service",
   "website": "http://r.levi.com/product/index.jsp?productId=4068748",
   "description": "Buy Seam Legging - Shooting Star - Top-stitched seams at the leg give this super-skinny fit just the right amount of detail - and slims its look, too. Its four pockets keep it comfortable."
}

从那里,你可能会猜到link是喜欢的项目的实际链接。请注意,并非所有喜欢的项目都是某些网站,但它们可以是例如Facebook页面,例如:

https://graph.facebook.com/108905269168364

{
   "id": "108905269168364",
   "name": "Conan O'Brien Presents: Team Coco",
   "picture": "http://profile.ak.fbcdn.net/hprofile-ak-snc4/211060_108905269168364_696236_s.jpg",
   "link": "http://www.facebook.com/teamcoco",
   "likes": 1639441,
   "category": "Tv show",
   "website": "www.teamcoco.com\n",
   "username": "teamcoco",
   "description": "Welcome to the official Team Coco Facebook page!  Yes, imagine for a moment, an alternate reality in which Conan O'Brien and his brethren can finally be experienced as they were always meant to be: shoehorned into the madcap blue and white webpage templates of Mr. Mark Zuckerberg!  This is that reality!  Let us live the adventure together, fearless Socialnauts!\n\nWhile this page is \"official\", it's here to be YOUR playground.  Anyone can post here, so go crazy; we only ask that posts remain on-topic.  If you're a purveyor of spam, smut, or unkindness, kindly die -- as you will be banned from this page.  \n\nBy the way, you can also find Conan & Team Coco on other, similarly awesome corners of the internets:\n\nteamcoco.com\ntwitter.com/teamcoco\nteamcoco.tumbler.com\nyoutube.com/teamcoco\nfoursquare.com/teamcoco\nflickr.com/teamcoco\n\nToodles,\n\n- Your Pals \u0040 Team Coco",
   "genre": "Comedy",
   "network": "TBS",
   "checkins": 3
}

但在这种情况下,link定义了Facebook页面的网址。