简体   繁体   English

Facebook API个人资料图片

[英]Facebook API profile picture

I created a website for my Students Organization. 我为学生组织创建了一个网站。 On that website there is a page where I list all the people who helped organize our Activities. 在该网站上,有一个页面列出了所有帮助组织我们活动的人员。 Theres a picture of every member there. 那里有每个成员的照片。 To get the images, I used their facebook profile pictures. 为了获得图像,我使用了他们的facebook个人资料图片。 I used http://graph.facebook.com/USERNAME/picture?height=250&width=250 我使用了http://graph.facebook.com/USERNAME/picture?height=250&width=250

This code did work a few days ago, but now the images dont seem to load. 这段代码在几天前确实有效,但是现在图像似乎无法加载。 I followed the url and got a JSON object: 我跟随该URL,并得到一个JSON对象:

{
   "error": {
      "message": "(#803) Cannot query users by their username (user.name)",
      "type": "OAuthException",
      "code": 803
   }
}

So it seems to me that facebook might have changed their security... (after googling I found out about some changes in their API 2.0 but I didnt fully understand that..) This link does still seem to work if you have the userID, but I'm unable to get that userID because of the same error message through graph.facebook.com... 因此,在我看来,facebook可能已更改了其安全性...(在谷歌搜索后,我发现其API 2.0进行了一些更改,但我对此并不完全理解..)如果您拥有userID,此链接似乎仍然有效,但是由于graph.facebook.com出现相同的错误消息,我无法获得该用户ID。

Is there still a way to get facebook profile pictures of people on your website or did facebook totally block this off?? 还有没有办法在您的网站上获取人的Facebook个人资料图片,或者Facebook完全阻止了此行为?

Any help is appreciated! 任何帮助表示赞赏!

If you want to use the data, you'll need to implement Facebook Login for your website, where the users can give their permissions to your app to use their data. 如果要使用数据,则需要为您的网站实现Facebook登录,用户可以在其中将其权限授予您的应用程序以使用其数据。

The username field is no longer accessible with the Graph API v2.0. Graph API v2.0不再可以访问username名字段。 There are at least 5-10 questions on this on StackOverflow today. 今天在StackOverflow上至少有5-10个问题。

Look at the docs: 看一下文档:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM