Is there a way to get information about friends added in the last 10 or 30 days on facebook
2 answers
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.
+1
source to share