Is there a simple URL string that Facebook will accept to \"like\" a site... or more accurately (as a commenter points out below), share a site? As a comparison, Twitte
There is a way how to do it, but not very comfortable for users, because they must click on 'like' button twice.
https://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fexample.com%2F
http%3A%2F%2Fexample.com%2F
is url encoded version of http://example.com/
.
Or you can place this link into iframe
and then only one click is needed for liking of url
Not exactly an answer, but close enough for me:
http://www.facebook.com/sharer.php?u=http://mysite.com/
That'll do it.
No, Facebook only permits Liking a page via a Like button.
There is a non-depreciated equivalent to the twitter or sharer.php functionality, though it is way more annoying. This doesn't exactly answer the question about "liking" a page but does accomplish the exact analogy to the twitter share, which seems to be what the question is asking.
Now make your url like this:
http://www.facebook.com/dialog/feed?app_id=000000000000000&link=http://example.com/whatever&redirect_uri=http://example.com/backtothesite
You would think the redirect_uri would default to the user's facebook home or to the link parameter, but it's a required field.
More parameters here: http://developers.facebook.com/docs/reference/dialogs/feed/
It's a little more verbose with Facebook to do the same thing.
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId={YOUR_APP_ID}";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-like"
data-href="http://mysite.com"
data-send="true"
data-width="450"
data-show-faces="true">
</div>
At the bottom of this page:
http://developers.facebook.com/docs/share/
Feel free to create your own implementation based on this.