0

我有一个能够

  1. 在用户的墙上发帖

  2. Publish_stramread_friendlists权限

  3. 能够获取用户的好友列表

并获得类似的列表

{
     "name": "example1",
     "id": "100003373457"
  },
  {
     "name": "example2",
     "id": "100003377"
  },

如何使用 循环在用户的所有 Facebook 朋友的墙上发帖sleep()

4

2 回答 2

1

像这样的东西会起作用:

foreach(friends_list as $x)
{
$ch = curl_init("https://graph.facebook.com/".$x[id]."/feed");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible;)");
curl_setopt($ch, CURLOPT_POST, true);



$post = array(
    "access_token"=>"..."
    "message"=>"SPAM",
);


curl_setopt($ch, CURLOPT_POSTFIELDS, $post); 
$response = curl_exec($ch);
print_r($response);
sleep();
}
于 2012-05-07T10:55:11.743 回答
1

不要那样做。您的应用程序将被视为垃圾邮件机器人并被 Facebook 禁止。

于 2012-05-07T10:58:45.933 回答