tags:

views:

71

answers:

4

How do you post a "like" with the Facebook Graph API?

+1  A: 

http://developers.facebook.com/docs/reference/plugins/like see here :)

Oyeme
So the only options are XFBML or Iframe? No Curl?
Christoffer
Yes, you're right,no curl,its easy to use it.
Oyeme
+1  A: 

You can use an iframe or the javascript SD. The code for an iframe like button is as follows:

<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fexample.com%2Fpage%2Fto%2Flike&amp;amp;layout=standard&amp;amp;show_faces=true&amp;amp;width=450&amp;amp;action=like&amp;amp;colorscheme=light&amp;amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>
Edd Turtle
A: 

With the Graph API itself, you can't.

Peter Bailey
A: 

You can like a wall post:

You can comment on or like a post by posting to https://graph.facebook.com/POST_ID/comments and https://graph.facebook.com/POST_ID/likes, respectively:

curl -F 'access_token=...' \
     https://graph.facebook.com/313449204401/likes

see Publishing to Facebook. If you need to like a webpage - probably not.

serg

related questions