开发者

Publishing a post on users' wall by facebook app

I need to generate a picture from facebook user profile picture and post it to some users' walls. For instance, $attch = array( 'media' => array((array('type' => 'image', 'src' => 'https://graph.facebook.com/'.$uid.'/picture',

'href' => 'https://graph.facebook.com/'.$uid.'/picture/')));

'src' => 'https://graph.facebook.com/'.$uid.'/picture' line doesn't show any picture...

How can开发者_Python百科 I resolve this?

Thanks


I answered this in your duplicate question.

It's not showing a picture because there's nothing at https://graph.facebook.com/[user id]/picture. You need to query https://graph.facebook.com/[user id] and parse the JSON to get its URL.


You are going to the right place for the picture:

http://graph.facebook.com/[username or id]/picture/ returns a redirect to the image on Facebook's CDN.

You can try it in a browser.

I don't know what you're doing with that array but the likely problem with your code is that you are not following the redirect to find the actual image.

The image that the picture URL redirects to can change over time so you should always go to it first and follow the redirect.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜