How to "like" the contents of facebook from the outside

So, I played with the facebook button, but I had a problem. I have a facebook page about some charity work I'm doing here:

http://www.facebook.com/Adam.Holmes.Climbs.Kilimanjaro .

I also have a webpage that has almost the same information. Inside this webpage I have a facebook button, so users may like the page as shown here:

http://developers.facebook.com/docs/reference/plugins/like/ .

Now my problem is with a separate button. On the facebook page, I added images that some users “liked” and commented on, etc. Now I have posted the same images on my web page, where I would like to add the facebook button as a button for each image and, therefore, display whatever I like that the image has on facebook. I have included many different links in the button, but none of them seem to work. I tried a) the URL of the page. b) the URL of the image. c) random bits and bats manipulating different URLs.

I tried to view the javascript source code, but for my understanding it is too complicated. I know that the fc_click () function is called from a button, which then calls another function, and soon after that I get lost and did not find which url is used.

So, I think my question is, should the URL be put in an “how to” script so that I can use a similar button externally on facebook?

If you need more information, say so.

Many thanks:)


UPDATE: I am trying to use any combination or url and I still have no luck. The object for one of the “Like” buttons is an object on the chart, i.e. Here is an object that I like. but none of these links work. Facebook may be limiting this, as it is easy to use the URL of the page and it works fine, not individual elements.

Can I add again that I need a link that should be placed in the tag, and not just in order to get the number of likes and comments, etc. I also started the topic on facebook developer forums here , but no one answered with a solution.

Thanks again.


UPDATE 2: As noted by “Myles Gray,” the code does indeed display in HTML as:

<label onclick="this.form.like.click();">

I'm not sure if there is a way to access the form from an external page, because it will not have the correct this link. Can anyone shed some light on whether this can be done, and if so, how? Of course, if this can be done, a proper reference to this will allow me to somehow use the content outside.

+8
javascript facebook facebook-like
source share
5 answers

I am afraid you do not want. Quick "proof":

 <script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script> <fb:like href="http://www.facebook.com/platform" show_faces="true" width="450"></fb:like> 

This will work fine, but using its interpretation of the Graph API:

 <script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script> <fb:like href="https://graph.facebook.com/19292868552" show_faces="true" width="450"></fb:like> 

This will not work!

I don’t think you should look for a “workaround / hack” or try to check and debug the photos page on facebook, because EVEN , if you find a way to use their functionality from the outside, I’m sure that you will encounter legal problems with Facebook!

Now, what would I do, keep track of when the user “loves” the photo on your website and has a popup or DIV under the LIKE button to encourage him to go to the photos page on Facebook to support it (for example, this too)!

This can be done using the edge.create event:

 FB.Event.subscribe('edge.create', function(response) { // Encourage the user to support your cause in Facebook too! $("div_with_a_link_to_the_photo_page_on_facebook").show(); // or using a dialog or whatever effect you like $("#facebook_support").dialog(); }); 

PS: I use jQuery here

Also, in order to actually like the “objects” of facebook, you need an application and something like my answer here , but I think you do not want to do this.

+1
source share

I don’t think you click the Facebook button on the piece of content, and the <fb:like> page is not possible. To test this, I tried a couple of things in the photo that I posted on my wall. As you understand, none of the URLs work.

However, you can create your own button. Using the Graph API, you can pull objects from your own feed using /me/feed . The simplest thing is likely to use images from the feed; if you placed the image, you will need a mapping table for the objects in your channel. Each item in your feed will have a Like counter.

Update

Reread the message, and it looks like you do not want the user to log in. The Graph API can be called from the server side. When you get access to your own channel, you just need to provide the offline permissions of your application to your own channel, and the current user will not need to log in.

Update 2

It seems that /POST_ID/likes only works on messages - I get "the application should be whitelisted" for something else.

+2
source share

I would like to point out that this is a very messy mess of ideas to solve this problem, not a complete solution. I would advise you to sit down and open your head on Facebook Docs for a while.

Take a look here . As you can see, every facebook object is part of the Graph API. Thus, it has its own unique property identifier. According to the photos, you can look here and see that each photo has its own unique identifier.

So what you need to do is call this special photo from this particular album on this page every time your web page loads, and so you can pull out all the comments and enjoy this photo taken on Facebook.

I would say that the best way to do this is to initialize the JavaScript SDK , execute the FQL query in the specific drawing that you want, and get the data.

Now, as shown on the display: since facebook does not have a special plug-in for showing photos on external web pages, part of the display is complicated. All information is received in the JSON object, which you can display in any way. I would suggest to make the experience more social by creating the same button for each photo with the identifier of this photo in the Graph API. The docs are here .

+1
source share

AFAIK Facebook uses an internal stat counter, which is somehow related to photo.php with the photo id and album id ...

If you look at the source code, you can see (like it):

 <label onclick="this.form.like.click();"><i class="img sp_29yryj sx_182771" title="Like this item"></i></label> 

And further (To view the people you like):

 <a href="/browse/?type=likes&amp;id=1516817795900" rel="dialog" ajaxify="/ajax/browser/dialog/?type=likes&amp;id=1516817795900" title="See people who like this item">16 people</a> 

If you can somehow determine which URL is based on the image id, you should be sorted, TMK seems like FB is using some kind of special library as an image id.

+1
source share

Using a similar plugin:

  <div class="fb-like" data-href="**http://graph.facebook.com/[object_id]**" data-send="false" data-width="270" data-show-faces="false" data-colorscheme="dark" data-font="arial"></div> 

(just enter your own object identifier). My problem is that I cannot figure out how to determine if the user liked the object without being registered in the application (and not just logged into fb as a whole).

To do this, your application requires extended permissions, for example, in this case, it requires read_stream permission. After that, you can query a similar table using fql.

0
source share

All Articles