Question

I'm trying to make a wall post using the Facebook API that has a playable video thumbnail and a link field. (I am using the Facebook Python wrapper).

When you make a wall post using the API, you specify your extra content with an attachment field:

graph = GraphAPI(valid_access_token)
graph.put_wall_post(message="Hey Everyone", attachment={
  "name" : "My Cool Link",
  "description" : "It's very cool",
  "link" : "http://www.my_app_url.com"
 }

I want to add a playable video thumbnail to this. One way to do it is to put the video url in the link field of the attachment:

graph.put_wall_post(message="Hey Everyone", attachment={
  "name" : "My Cool Video",
  "description" : "It's very cool",
  "link" : "http://www.youtube.com/watch?v=some_yt_id"
 }

This renders a video thumbnail and is playable in Facebook, which is what I want, but it uses up the "link" field, so I can't use that field to link them to www.my_app_url.com. I want to be able to do both.

Anyone know how I can put a playable video thumbnail and a link to my app in a Facebook wall post through the Open Graph API?

Additional background info: There is a way to do this sort of thing with the a "picture" field in the attachment object -- this allows you to add a picture url which is separate from the main link of the attachment. The facebook docs say you can put video links in a field called "source" in the attachment, but when I tried it, the attachment didn't render the thumbnail, and it wouldn't play.

Était-ce utile?

La solution

I ended up putting the link to my app in the message of the post, and using the 'link' field in the post attachment for the video. Not what I was hoping for but I guess it does work.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top