Im trying to implemet Facebook Like with OpenGraph and Im getting weird error:
You must specify an URL as part of this widget or API.
I added Open Graph protocol to meta tags, added < fb:like> tag with URL to that page, added JavaScript SDK init.
Like appears, I click, and that error is shown. Does anyone knows what to do
Thanks
EDIT:
I found error...
I'm using FB connect with script: http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php
There is FB.Init and if you want to include some plugin then you can't use FB.Init again, which every plugin request. So if you have few plugins on the same page, then you will have error.
But, with this FeatureLoader.js I cant get FBML to work, only fb:fan works, and for Activity and Like I must use iframe :(
Does anyone know how to get it work with FBML?
Thanks again
I also faced the same URL error and after long hours of mind boggling and hit and trial, i was able to make it work.
Infact my facebook fan box was showing the currently logged in user's facebook home page instead of fan list.
The actual problem was same as mentioned in above comments of the featureloader library.
I have written about my problem and the solution here:
http://am22tech.com/s/22/Blogs/post/2010/06/01/Facebook-like-box-shows-users-facebook-home-page-instead-of-like-box-content.aspx
Hope it helps others.
This error is the result of the href parameter not being specified or being specified incorrectly when calling Facebook's code.
It should look something like this if you're putting this on a standard web page:
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fstackoverflow.com%2F&layout=standard&show_faces=true&width=450&action=like&colorscheme=light"
scrolling="no" frameborder="0"
allowTransparency="true"
style="border:none; overflow:hidden; width:450px; height:80px"></iframe>
See the format of src parameter? The parameters called: href, layout, show_faces, width, action, colorscheme have rules for how they are called. Check Like Button for more information. Facebook's Developer Docs are invaluable for doing this kind of thing.
We had that error of "You must specify an URL as part of this widget or API."
and found we had been using an out of date facecbook JS include file of
http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php
so if you are trying to get FB like to work and have the above, remove and or update it.
Related
I'm trying to get the Facebook like to work. It kind of works but it gives the wrong title. While I was messing around with the Facebook like button, I noticed that it didn't complete the url so it would give me
www.mysite.com/product#
instead of
www.mysite.com/product#item1
if I go to
https://developers.facebook.com/tools/debug/og/object/
and I enter the correct url it shows up in the debugger, but it doesn't seem to work on my site.
Here is the Facebook code
<iframe src="https://www.facebook.com/plugins/like.php?href=http://mysite/product#item1"></iframe>
That´s just an anchor on a Page, Facebook does not read that one. Meaning, it will not be a separate URL for Facebook. If you want different Metatags with the same Link, you have to use GET parameters instead.
We are having an issue with the Facebook like button not showing/displaying, on this page:
http://powertextblog.esvelte.net/
It appears that the span and iframe that are generated have an inline style of width:0px and height:0px , I have tried overriding this to no avail.
The button is not showing in any browser.
This is the code we're using on the page (from AddThis) to generate the button.
<a class="addthis_button_facebook_like" fb:like:layout="button_count" addthis:url="http://www.facebook.com/PowerText"></a>
I also tried inserting the Facebook like button using Facebook's own button generator, but the same problem occurs (which would indicate its not an AddThis issue)
Any help would be appreciated.
I had the same problem, tried everything until I figured out that was something really stupid.
If your facebook page has any restriction, like Country restrictions or Age restrictions, facebook does not show the like button if you are not logged in.
I think it is a Facebook bug causing the issue.
Removing the defined URL addthis:url="http://www.facebook.com/PowerText" and using the site domain instead, fixed the issue.
So I think there is some sort of FB bug where defining the URL as a Facebook page causes it to not display, as it works fine without it.
Try this facebook like code it should be work.
<a class="addthis_button_facebook_like" fb:like:layout="button_count" fb:like:action="recommend" fb:like:width="135"></a>
Had the same problem yesterday. I then played around with the widget on https://developers.facebook.com/docs/plugins/like-button a while. Turned out this only happened with Facebook Page URLs (the URL to like). Even https://facebook.com/facebook itself didn't work correctly anymore. Simply rendered with 0px. All other URL worked as expected. Tried to reach FB on Twitter and they sent this link to the filed issue. Which says bug is known and fixed now.
So we simply had to wait. After one night the next morning all Like buttons with Facebook Page URLs rendered correctly again.
I'm currently working with Facebook Like Box.
I used the the official like box generator.
For the required input page, I use:
https://www.facebook.com/pages/Cinta-Buku/265954863527629
and the generator generates this code:
<iframe src="//www.facebook.com/plugins/likebox.php?href=https%3A%2F%2Fwww.facebook.com%2Fpages%2FCinta-Buku%2F265954863527629&width=292&height=590&colorscheme=light&show_faces=true&border_color&stream=true&header=true" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:292px; height:590px;" allowTransparency="true"></iframe>
and it works.
However, the problem is: every time I try to like the page using the box, I have to confirm it. After I clicked the link to the confirm page, it says "The page you requested was not found." But I am sure I inserted the right page to the generator.
Here is the screenshot for the confirmation page:
And here is the complete URL for the confirmation page:
https://www.facebook.com/plugins/like_confirm.php?href=https%3A%2F%2Fwww.facebook.com%2Fpages%2FCinta-Buku%2F265954863527629&node_type=page&edge_type=like&widget_id=connect_widget_50a60922e85357a20242337
I've tried using the debugger to check the facebook page. But the result is weird, I mean, how can a facebook-generated page does not pass the debugger? Maybe this debugger is not for Facebook page.
The closest question I found here in Stack Overflow is 'Facebook Like Button Confirmation Page Says “The Page You Requested Was Not Found”', but this one is for Like Widget, not Like Box, and the solution does not work for me.
You can try the problematic box here: http://www.cintabuku.co.id/
It's in the lower right sidebar.
So yeah, I'm kinda stumped here.
Can anybody help me here?
I've had the problem as well. Let me guess... in the beginning the like box worked fine?
This happens because Facebook tries to scrape the url you want to like (in your case http://www.facebook.com/pages/Cinta-Buku/265954863527629), but if you put it into the debugger it gives an error that it can't be parsed. So after a while Facebook will mark the page as "spam" and then you have to confirm (what often doesn't work as well).
The reason why Facebook doesn't scrape the page correctly is because if the numbers in the url I think. Because if you try to scrape http://www.facebook.com/ with the debugger it works.
I don't really see a real solution for you here, we always have to like external pages and not a Facebook page itself, but still I hope you understand the problem a bit better now.
I´ve inserted a FACEBOOK like button succesfully, except that the meta tag 'og:site_name' is not working...:
On my facebook page, it shows the name of the main domain (http://www.domain.com) and not the content of the meta tag 'og:site_name' (FAN CLUB)
I've research everything there is to research without success... Something so simple(?) Am i missing something?
Thanks!
Feeding your URL through the Facebook Debugger should clear Facebook's caching of your URL and refresh any changes you have made. Try passing your URL to the debugger and it should be refreshed to the correct value.
The debugger will also direct you to any other problems you may have with regard to integrating your URL into the Open Graph Protocol...
I cannot get the Like button to work on one site. http://www.room13canada.ca/test.html
When the button is clicked it fires off to facebook but the callback then undoes the call? I have stripped all code to make sure there is no js or css or whatever breaking the button.
please look at the pagesource - it makes no sense why it doesn't work.
if I change
<fb:like href="www.room13canada.ca"
to
<fb:like href="www.cnn.com"
it works like a charm??
any help would be great
Have you considered trying with the iframe method?
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.room13canada.ca%2Ftest.html&layout=standard&show_faces=true&width=450&action=like&colorscheme=light&height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>
Well, I was also having problems with the facebook like plugins and also heard from people that it is a facebook bug. After searching a lot on gOOgle .... I found a good result and don't think that this is a fb bug.
You will have to add this file into the header of your website:
<meta property="og:image" content="http://ia.media-imdb.com/images/rock.jpg" />
Property of Meta Tags (facebook likes Meta Tags) ==> og:image - An image URL which should represent your object within the graph.
Replace "http://ia.media-imdb.com/images/rock.jpg" with real path to image.
For Wordpress Users:
Add the following code in the head of your header file ==>
<?php $img= get_post_meta($post->ID, 'image', true); if ($img): ?>
<meta property="og:image" content="<?=$img ?>"/>
<? endif; ?>
That's all... Hope this will work for you all !! Share your experience ...
First, I'll give my hypothesis: If the Facebook URL Scraper has tried to scrape your page, and was unable to access it (e.g., if it was pending moderation and the Facebook Scraper bot got redirected to a "login" page), Social Plugins like the Like button and Comments won't work because Facebook thinks the URL is "inaccessible." It takes 24 hours for Facebook to try scraping the page again--until then, Facebook will assume it's still inaccessible.
Here's what Facebook says about how often pages are scraped and how to force a scrape:
Facebook scrapes your page every 24 hours to ensure the properties are up to date. The page is also scraped when an admin for the Open Graph page clicks the Like button and when the URL is entered into the Facebook URL Linter. Facebook observes cache headers on your URLs - it will look at "Expires" and "Cache-Control" in order of preference. However, even if you specify a longer time, Facebook will scrape your page every 24 hours.
Note that the Facebook URL Linter has been renamed the Facebook Object Debugger.
I could be wrong about the underlying issue. I'll give you my experiences, and you can decide.
Our site is a collection of blogs, and all blog posts have a "like" button, generated with identical code (except for the URL being liked). By default, all blog posts are saved to a "draft" state, and not available unless you are logged in. If an anonymous user attempts to visit a "draft" blog post, he will be redirected to the login page.
Months ago, we experienced a "Like" button problem, although the error manifested slightly differently: we got "URL inaccessible" when clicking the Like button. This only happened on posts that had "Like" buttons and also were not immediately published (e.g., they were saved to a "Draft" state). I thought this was fixed when I changed the "Draft" view to not display Facebook social plugins.
However, I've noticed that, from time to time, if you click the "Like" button on a particular post, the "Like" flyout flashes on the screen for a moment and then disappears, with no "like" action taking place. Different behavior, same problem: "Like" button doesn't work.
At the same time, the "Like" buttons on every other post worked just fine! I tested this, and then came back to the one post I couldn't "Like". Same behavior: flyout appears and disappears, no "Like" happens.
I used Chrome's developer tools to see what HTTP requests were being made, comparing the request/response for a working "like" to the "like" that wasn't working. The "Like" button JavaScript makes an HTTP POST request to http://www.facebook.com/plugins/like/connect and gets some JavaScript back. As best I could tell, the HTTP POST request was identical between the working and non-working like buttons, but the response was different. Below is the JavaScript response for a working like, followed by the JavaScript response for a like that wasn’t working:
for (;;);{"__ar":1,"payload":null,"jsmods":{"require":[["Plugin","connect",[],["http:\/\/www.hslda.org\/cms\/?q=blog\u00252Fpeeking-through-fence","10151028997762924"]]]}}
for (;;);{"__ar":1,"payload":null,"jsmods":{"require":[["Plugin","disconnect",[],["http:\/\/www.hslda.org\/cms\/?q=blog\u00252Fpoem-just-you"]]]}}
I note two distinctions: the working version “connect” whereas the non-working version has “disconnect”, and the working version has an additional parameter that looks like an ID. I’m guessing it’s the ID of this particular “like” event.
I did some Googling and couldn’t find a definitive answer. Trying to debug this, I used the Facebook Object Debugger. It found some “Like Button Warnings” and “Open Graph Warnings” that are worth fixing, but I don’t think they are the problem—because they were the same for URLs with working like buttons and for the URL with the like button that wasn’t working.
So then I decided to go to the Facebook Social Plugin page for the Like Button. I dropped in the URL of the non-likeable blog post, and tried liking it. It worked. I wondered, “is the like button on the page still broken?” I couldn’t like it because I’d already liked it. So I asked a coworker try and like the post, and it worked for him. I then had my coworker unlike the post, I unliked it (so we were back to no likes), and then I tried liking it again, using the like button on the blog post. It worked.
So, it seems like once I "forced" the page to be scraped again, it started working. But it's also possible that "forcing" a like through the Like button page broke something loose as well... not sure.