Can't get the html code for the like button on my webpage - facebook

When I enter my webpage into the "get Like button Url to like" on Facebook's Like Button Generator, it tells me that the href entered is not a valid url, when in fact it is.
How can I get the url for my webpage without this application?

Use the like button generator to get the code for a site you know, like www.google.com
Look through the code and replace www.google.com with yoursite.com
Once you have you like button set up, you should set up Open Graph meta information, and you can test that everything is set up properly using the Facebook Debug Console

Related

Facebook LIKE fires error

I am creating application on localhost (XAMPP). When I try to test LIKE button this error pop ups:
**Message Failed: This message contains content that has been blocked by our security systems.**
Either the URL you wanted to like is blocked by Facebook or you are trying to like a Link on localhost - which is not possible, of course. You can only like public URLs.
Put the URL in the Facebook Debugger to check if it´s available: https://developers.facebook.com/tools/debug/
You can also just try to post it on your own Facebook Wall to test if it is blocked.
go to the link given below: https://developers.facebook.com/docs/plugins/like-button
Type your link in URL to Like. for example: https://www.facebook.com/games/rajvirbalapp/
Type width in next input box.
Select your Like button Layout from drop down. For Example: box_count.
Select Action Type from Drop down. For example: Like.
Tick Show Friends' Faces or Include Share Button if you want to show share button.
Click Get Code button and copy the script and paste where you want to show the like button in your website.
If you use localhost then it will display error message other wise it work's.
Best of luck.

facebook like button not showing correct information - tried debugging

We are using a facebook like button on a gallery page. When you click the like button, the parent page information is provided instead of the "item" information - but when the link is shared individually on facebook, it pulls the right information.
I tried using Facebook's debug tool, and it pulls the correct information.. the issue seems to be when its on the page. I've checked the meta info and it all looks right...
Any ideas?
https://developers.facebook.com/docs/reference/plugins/like/
Put in the correct sub-link and generate the like button again > Test it first, directly in the like button generator.
If the data is shown correctly in the debugger, then i am pretty sure the problem is that you don´t use the correct/same link in the like button. It would be important to see your usage of the like button. It´s possible that you have an escape character problem, so only the basic link is used.

When using the "like" social plugin, can I get the like message to display in the same way as the object preview in the Open Graph dashboard?

I have a music app that I developed using HTML5's canvas. As different songs are selected, I have jquery that dynamically updates the URL in the browser to point to the correct song. I also have jquery that updates fb:like element. By using the debugging tool, I'm able to cache the pages (since my server is able to return correct meta-data for each URL provided).
When I do this and like something on my website, I end up with a message saying "Sami liked a page." with some info underneath.
Next, I use the Open Graph curl commands to add a Recommend action (something I've created) to a given URL from my website. Now, when I like the same url, I end up with a message saying "Sami recommends this link" with some info underneath.
What I'd really like to do is have this message display "Sami recommends a song on website", which is what the message looks like when I look at the preview for my Song object in the Open Graph. Is there any way to do this?
Best,Sami
EDIT: probably good to note that I'm also getting some extra meta info from the website (such as og:site_name), but that this stuff is not being saved into the Actions portion of my Open Graph (as in I can't view that info using the Open Graph link to view my current Recommendations), though I can see it using the debugger tool.
The facebook like button "triggers" the most generic action which is the like, you can how ever change the like button to use "recommend" instead of "like".
In the documentation for the like button, in the attributes table you can see the "action" attribute which is:
the verb to display on the button. Options: 'like', 'recommend'
Also when you "Get Like Button Code" thing you can select Verb to display.
If you want to use your own actions you'll need to define them in the app settings page as explained in the Define Actions guide.

The title, link and description don't work

I've been reading guides and examples for a long time (hours) but I can't manage. I tried to use all html meta tag like title, description, and og:property. Also tried to use the link sharer and also to create a new blank page with just the info I want to share to facebook in order to test. Also I tried to generate an random url in php so to have always a different url variable (the url to share and also the url of the main page containing the script). I also grabbed (url linter) a lot of time the url to clean the cache of facebook. It always give me the title of the site domain as title or the url itself as the shared title and description. I don't know what to do.
The main web site is from joomla. In the code of index of joomla I put a php include if the url has the variable "articolo" id. This incuded php page has regulat head body etc. So maybe I facebook check the main meta of joomla first? So now I tried to open a popup with just the page for sharing. Look here: link
It's possible that the title is locked in, meaning that after X number of likes Facebook doesn't allow you to change it anymore. Can you give us an example URL you're having issues with?
EDIT
Ok, now the link you provided shows some very interesting output. http://modernolatina.it/wjs/index.php?option=com_content&view=article&id=96&Itemid=258&autore=6&articolo=6
First, you webserver, instead of sending back a 200 code, is sending back a 500 code.
Secondly the HTML your webserver is sending back has two HTML tags (Do a view source on the content returned)
Fix up those two issues and I think the linter will be happier with your page.
Test your page here:
http://developers.facebook.com/tools/debug

handle subpages inside facebook app (with one single tab)

My goal is that have a fb page app (only in one tab) and use it with linkable subpages inside it.
For example:
If I click on subpage link there would be a http or ajax request inside the iframe. Thats fine, i can do that.
BUT
in the solution I also want to implement these two features:
1.:
I want that page to be accessible directly from an url like:
http://facebook.com/pagename/app..blabla/subpage1
or
http://facebook.com/pagename/app..blabla&sk=535&subpage=1
or
http://facebook.com/pagename/app..blabla#subpage1
2.:
On subpage link click inside iframe I want the browser url to turn into something like mentioned in the 1. point. (even when using ajax - probably with a hash tag)
Is it possible?
If you look at the page tab tutorial http://developers.facebook.com/docs/appsonfacebook/pagetabs/ at the bottom of the page they describe how you can create the 'subpage' idea using the app_data parameter. So your links will look like http://www.facebook.com/YourPage?v=app_1234567890&app_data=any_string_here
For your second question, in the links on the page you would specify target="_top" in any links you have with the href being: http://www.facebook.com/YourPage?v=app_1234567890&app_data=subpage1. This will cause the entire page tab to load through Facebook and you'll get the signed_request and your app_data parameters.
You probably don't want your ajax to load through facebook, because you'll get the Facebook page back instead of json or whatever you are trying to load. Instead you'll just make ajax calls to your server and pass the parameters you need to, like app_data or whatever you want.