Simple Facebook API

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?


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:, 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.


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;
    case "unicorns"
        add unicorn video open graph tags;

Then your like buttons would look something like:

<div class="fb-like" data-href="" data-send="true" data-width="450" data-show-faces="true"></div>

<div class="fb-like" data-href="" 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.

This should do the trick! Good luck! link

Need Your Help

Opaque transition using active class

css css3 css-transitions opacity pseudo-element

I need help with CSS. I am trying to make it so a div's opacity is set to 1 when another div is clicked as a transitiion. I can only use CSS so I was trying to find out how I could use the active c...

Strange problem with IsMouseOver on button in ListBoxItem

wpf xaml mouseevent listboxitem

I have a template for my list box item. It includes an image button. The button changes images when you hover. The problem I'm having is it's adding a weird artifact to the button when I hover. Thi...