Adding a Like button to a dynamically generated web page - facebook-like

We have an application that creates web pages dynamically. The user enters a title, some descriptions, some images, etc. and clicks the CREATE button, and Presto! the page is created within our domain and is accessible from any browser by entering
www.ourdomain.com/thenewpagename
This all works fine but now we'd like to add a Like button to the page we create.
I know that the normal way to add Like buttons to a page is to go the Facebook developer's page, enter some information about the page-to-like, like it's URL, and then copy and paste the code that Facebook generates onto the page. But clearly we can't do that for every page that gets generated by our engine. So my thought was to add the Like code from another page and then dynamically change the URL in the code the the URL for the page being generated. But this doesn't work. It puts a Like button on the page, ok, and when you try to Like the page the "Add Comment" field comes up momentarily, but then the Add Comment field disappears and the like count goes back to 0. It acts like Facebook shuts down the button as soon as they saw something fishy.
I'm wondering if anyone sees a way to do what I'm trying to do. Is there maybe a way to generate a new button on the fly for each page we generate by communicating with Facebook with something like cURL?
Thanks for any ideas.

Check if this could be of any help to you : http://www.hostelmanagement.com/facebook_like_button_tutorial.php

Related

Facebook API "Like" discrepancy

This is my app page: https://www.facebook.com/pages/When-Biebs-Attack/402350233140999
As you can see, it's an actual "App Page", created from my app control panel. So you would assume it would be linked with the app.
Now here is the (only) site that uses the App ID for a like button: http://cosmati.net/biebsattack/
Not only is the discrepancy weird, but as soon as I added the like button to the page it had 22 likes. I have double checked my App ID in my code. It does line up with my app control panel. I tried both the HTML5 and the XFBML methods.
okay, I don't know why it's doing what it's doing, but I figured out you can link them directly by adding an href tag to the like button and pointing it to the url of your facebook page. For instance, my like button now looks like this:
<fb:like href="https://www.facebook.com/pages/When-Biebs-Attack/402350233140999" send="false" width="450" show_faces="true" font="arial"></fb:like>
And now when I visit my site (http://cosmati.net/biebsattack/), not only do I only see 1 like (mine), but I see links to administer my page and view insights. Kind of neat. Not sure why it doesn't do this by default when I use the App ID, but whatever.

Facebook like button are not diplaying when anyone are liking the page and never are not showing for others

I want to add facebook like button to every pages.
But the problem is that the like button are showing first time when page are loading then if anyone are like the button then the like button are invisble.
I was test url into https://developers.facebook.com/docs/reference/plugins/like/
here and getting the same problem. I am not getting any problem when i am testing with http://fridaymedia.in/
But when I am testing with
http://fridaymedia.in/TP_ECom/
http://fridaymedia.in/TP_ECom/retail/
http://fridaymedia.in/TP_ECom/retail/details/
http://fridaymedia.in/TP_ECom/retail/details/men-clothing-t-shirts/
They are getting the problem.
Please anyone solve this problem?
Are your site's pages protected with an .htaccess password? If so, that could be the issue. I ran into this problem myself, and after going down the wrong path for a bit, I went back to my initial suspicion - htaccess password.
I didn't really look into the code, but I assume the button is set to have FB scrape the page after a user clicks like. With the password blocking things, FB can't scrape the page. Rather than displaying the button as if it hadn't been clicked, it just displays nothing - which is where my, and I assume your, confusion came in.
After changing htaccess, you'll have to wait 24 hours for the page(s) to be scraped by FB when they're loaded. However, you can use the FB debugger (http://developers.facebook.com/tools/debug) to manually scrape individual pages.

Facebook Like Button for Facebook Page for Blog

I just created a Facebook page for my blog and am working on adding the like button. I suppose my first question is, is there already a like button added to a Facebook fan page itself and the code for the like button is so you can create a like button on a whole different page, like my Blogspot blog page? Since I'm the admin I'm not sure if I'm seeing whatever else is. If not, I'd like to add a like button to my Facebook page for people to like, but for the life of my cannot figure out where to paste the code. I know it says behind the tag, but that doesn't mean anything to me. Please help.
http://developers.facebook.com/docs/plugins/
On the Facebook page is a like button of course already integrated, on that page you can get code for your Blog or website.
Specifically, you're looking for this plugin:
https://developers.facebook.com/docs/reference/plugins/like/
Specify the URL you want the like button to like, whether that be your blog post or your facebook page.
You are looking for the facebook Like Box.
https://developers.facebook.com/docs/reference/plugins/like-box/

Facebook Like button og:image needs to be scraped to be displayed

I've got a Drupal website with articles on them which have Facebook like buttons.
Now I've got all the OpenGraph metatags added on the pages and it's all working perfectly except for one thing.
Site visitors can share a page URL or like a page URL.
When a new article is added and the first person who presses the like button will not see the image added in the og:image tag.
If another person afterwards presses the like button, the og:image however is visible so it seems to me Facebook needs to scrape the page first before the og:image is added in the 'Facebook Like window'.
The Facebook share doesn't seem to suffer from this problem and does it right from the first time.
Now whenever somebody adds a new article, I'd need the URL of the article to be scraped automatically by Facebook using some PHP code or some other fix...
Anyone who knows if autoscraping a URL is possible or does anyone have an idea for a workaround?
You can use the graph API with scrape=true to force Facebook to scrape you right when you create your contents
https://developers.facebook.com/docs/beta/opengraph/objects/

How do I merge my old like button with my new Facebook page?

I've had a like button on my site for a long time, and right now it has ~500 likes. However, this button only likes the actual link to the website and not a page on Facebook.
Today I have created a new page for my service, and even though I've found a way to make a like button for the page, I'd like to know if there was a way to transfer the likes I had on the old button (link only) to the new button (fb page) and also maybe make it so that the old "link-only" button actually links to the new page (right now the link button and page button act as if they're completely unrelated).
Unfortunately, there is no way to transfer likes from one graph object to another.
But there is something you can do:
Every like button in fact creating edge in opengraph which have a page on Facebook, so you can inform people who already likes your "old page" about existence of new one.
You can publish stream updates to the users who have liked your page just like you can with Facebook Pages. There are two ways to get to the publishing interface:
From https://developers.facebook.com/docs/opengraph/#publishing
From your Web page, click Admin Page next to the Like button. From
Facebook, click Manage Pages under the Account tab, then click Go To
Page next to your page name You can publish stories to your users the
same way you write a Facebook post from your own wall: by typing in
the Publisher, the field at the top of the screen that says "What's on
your mind?" The stories appear in the News Feed of anyone who has
clicked the Like button on your webpage.
For samples how to do same thing from code look at http://developers.facebook.com/blog/post/465