Reputation: 13
Lets say I have simple landingpage on my fan page with 3 "post" with a headline, some text and a video.
I want to get a share and a like button for every of the posts, so the users can like and share the unique post.
The like button must have a counter on.
Could nayone answer my question or give me a link to a tutorial?
Thanks!
EDIT: Thanks for the answer, but lets say: One of my friends go to my fan page and the landingpage "Welcome". He will see this: i41.tinypic.com/157zmh.jpg, and decides to like one of the "posts". When He clicks like, it will be shown on his wall with the headline, some text and ect. a picture. The link goes to the landingpage on the fan page. One of the "post" will know have 1 like, meanwhile the other two will still have zero.
Upvotes: 0
Views: 388
Reputation: 5380
It sounds like you are looking for the Facebook Social Plugins. They are the easiest "Facebook elements" to implement.
If they don't satisfy your requirements you can take a look at the Javascript SDK, probably second easiest.
As an update to your edit:
The like button works like this: It scapes your page for information about what you just liked, if you want to control it's behaviour you can add open graph tags to do so.
In your sample you have one page with three different videos on it, in order to differ the open graph tags you make the like go on different query string values.
Here is some lousy pseudo code sample that tries to explain what I mean:
//Pseudo server side code
variable video = get_query_string_value("video");
switch (video) {
case "wolf-shirt":
add wolf shirt open graph tags;
break;
case "unicorns"
add unicorn video open graph tags;
break;
}
Then your like buttons would look something like:
<div class="fb-like" data-href="www.example.com/mypage.php?video=wolf-shirt" data-send="true" data-width="450" data-show-faces="true"></div>
<div class="fb-like" data-href="www.example.com/mypage.php?video=unicorns" data-send="true" data-width="450" data-show-faces="true"></div>
It will result in if someone clicks the like button at the wolf shirt video, you will present the wolf shirt open graph tags to Facebook when its scraper look for data.
Upvotes: 1
Reputation: 38135
You cannot use the Facebook Like plugin to like a Facebook post. You'll have to use the Graph API. But this would mean that every friend should allow your app.
You have to issue a POST
HTTP request to (with publish_stream
permission):
POST_ID/likes
More info is available in the documentation.
Upvotes: 0