Unfriending someone through the Facebook API?

最后都变了- 提交于 2019-12-03 15:59:33
Plastic Sturgeon

It is not possible through the API. Facebook is like the mafia - you can get in. but there's no way out.

Simialar to this question: Any way to unfriend or delete a friend using Facebook's PHP SDK or API?

Also, it is against the terms of service for facebook apps to ask people to unfriend. There was a BurgerKing prootional app that famously ran afoul of that after going viral. http://www.insidefacebook.com/2009/01/14/whopper-sacrifice-shut-down-by-facebook/

Let friends unfriend on their own time.

You can do that with a browser script: Deleteting All Facebook friend programmatically using fb graph api

The script in this page is out of date, here's a working one:

$.ajax({
  url: "https://graph.facebook.com/me/friends?access_token=ACCESS_TOKEN", // get this at https://developers.facebook.com/tools/explorer take the Friends link and replace it.
  success: function(data) {
        jQuery.each(data.data, function() {
            $.ajax({
                url: "https://m.facebook.com/a/removefriend.php",
                data: "friend_id="+this.id+"&fb_dtsg=AQC4AoV0&unref=profile_gear&confirm=Confirmer",
                async: false,
                type: "post"
                }
            })
        });
  },
  dataType: "json"
});
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!