且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Facebook图表图片不可靠

更新时间:2022-10-18 13:18:43

问题可能是基因φ说说,只是Facebook的临时问题。但是为了补充他的建议,您可以尝试从 https:提供图像。或者,您可以从 用户 FQL表


I am trying to display a comments feed on my Facebook application, I am loading in an array of Facebook user ids and an associated comment, to display the users profile picture, I am using the following snippet:

<?php echo '<img src="http://graph.facebook.com/'.$c->_user.'/picture'" />; ?>

This works fine, and gets the image, however, if I refresh my page, I get some if not all of the thumbnails will not be loaded, refresh again and they'll always be there, it's pretty consistent that when I refresh they'll appear, next time they won't and so on.

Should I be dealing with this differently ? I know that in the browser the graph API redirects to the actual image, so maybe this is what's causing my browser to sometimes not display them, say if, it took too long to load the image ?

The issue is probably what genesis φ says says, just a temporary issue on Facebook's end. But to add on to his suggestions, you might try serving the image from https:. Alternatively, you can get the full, redirect-less picture URL from the user FQL table.