2013-01-13 25 views
7

当通过Open Graph API制作墙帖时,需要Facebook在墙壁上呈现图像的方式。当通过Open Graph API发布时,Facebook wallpost图像不会呈现

当我复制并粘贴此链接到Facebook的UI在facebook.com,并张贴这样的说法,墙后最终看起来像这样:

Successful rendered image in FB wall post

但是,当我尝试访问编程使用Facebook Python库,使用下面的代码我的墙,图像不渲染:

graph = GraphAPI(valid_access_token) 
graph.put_wall_post(message='https://s3.amazonaws.com/dotellapptest/review_photos/enlarged/811..OJUzXI76Rw6J2Zj_vZyWNw.png') 

此息率:

unsuccessful Facebook wall post with image

如何使用Facebook API将图像嵌入墙贴中?

回答

4

经由安装

def put_wall_post(self, message, attachment={}, profile_id="me"): 
    """Writes a wall post to the given profile's wall. 

    We default to writing to the authenticated user's wall if no 
    profile_id is specified. 

    attachment adds a structured attachment to the status message 
    being posted to the Wall. It should be a dictionary of the form: 

     {"name": "Link name" 
     "link": "http://www.example.com/", 
     "caption": "{*actor*} posted a new review", 
     "description": "This is a longer description of the attachment", 
     "picture": "http://www.example.com/thumbnail.jpg"} 

    """ 
    return self.put_object(profile_id, "feed", message=message, 
          **attachment) 

https://github.com/pythonforfacebook/facebook-sdk/blob/master/facebook.py#L142

http://developers.facebook.com/docs/reference/api/user/#links

+0

真棒,谢谢使用link场不message场! –

相关问题