是否有任何方法可以获取Facebook在过去10或30天内添加的朋友的详细信息

时间:2012-03-14 06:41:06

标签: facebook facebook-graph-api

是否有任何方法可以获取Facebook最近10天或30天内添加的朋友的详细信息?

2 个答案:

答案 0 :(得分:2)

没有;您需要轮询好友列表并比较delta

答案 1 :(得分:1)

finally I got the answer!
$count=0;
$fbid=xxxxx;
$onemonthbefore = strtotime(date("Y-m-d",strtotime("-1 Months")));
$ss=urlencode("SELECT created_time,description_tags,source_id,description FROM stream    WHERE source_id = xxxxxx and (strpos(lower(description),'are now friends') > 0 or strpos(lower(description),'is now friends') > 0) limit 100");
$sql="https://graph.facebook.com/fql?q=$ss&access_token=xxxxxxxxx&format=json&date_format=U";
$new    =file_get_contents($sql);
$new    =json_decode($new);
foreach ($new->data as $data)
{
if($data->created_time > $onemonthbefore)
{
        foreach ($data->description_tags as $tags)
    {

    foreach ($tags as $friend)
    {
       if($friend->id !=$fbid)
       {
        $count++;
       }
    }
    }
}
 }
echo "new friends=".$count;
Try this in your facebook applications.thanks.