Like an Open Graph action - facebook

I have created an application with their associated Open Graph actions, already approved by Facebook.
When a user publishes an activity/action in their feed, it's possible to "like" it from there. But is it possible to like it from another page, ie. with the "Like" plugin? by somebody who is not an user of the application?
Thanks

To like an action you need to have the user access_token or use the FB api for that
as described here: https://developers.facebook.com/docs/opengraph/actions/#like_action
This is how we do it:
FB.api("[action id]/likes", "post", function(response){...});

The like button works with a url, which is how facebook indexes pages.
Graph objects have urls which define them, and so you can of course put the url of a graph object as the url for a like button.
The graph actions don't have a url and so I don't think that you can attach a like button to an action.
I'm pretty sure that there's no way to like an action outside of facebook.

Related

Facebook like a different domain

OK, I have the standard Facebook Like code.
But we are ajaxing in Tumblr posts from the Tumblr feed and putting the FB Like button in.
So we are LIKING the Tumblr post URL.
However the page is not on a Tumbler URL, so FB momentarilly shows the comments box, then replaces it with a Confirm button, which triggers a popup. Like in the popup, then it allows you to use the normal JS comment that should appear on the button.
QA and UI have flagged this up as unacceptable, so is this a massive UI failing by FB? Whatever it is, and how can I get around it?
If we LIKE a unique URL on our site/domain this works as intended;
BUT THEN we would have to write a backend to receive that URL and present OG tags for FB to scrape, probably grabbing from the tumblr post.
Yes, by default the Like plugin it will search the page for og:metadata,
to go forward you can use the new build in, Open Graph Like Action
http://developers.facebook.com/docs/opengraph/actions/builtin/likes/
So, now you can associate each Open Graph object with a like.

Like an object on Facebook outside Facebook

I've been trying to use the Like button generator to get a Like button for some content on my fan page: http://www.facebook.com/photo.php?fbid=363385833679921&set=a.314588171893021.85085.305618229456682&type=1
What I want to do is show the likes this photo got on Facebook in the like button on my site and vice versa.
This seems to work for the actual fan page url but doesn't work for individual photos (haven't tested other objects).
You are able to see the likes the object on Facebook got through the graph API call: http://graph.facebook.com/363385833679921. So shouldn't that be available on non-Facebook sites as well?
Anyone know a solution to this without having to make a custom handler to show and post likes on site?
Why don't you just use the API to read the comments and likes on the object? Any user's access token will work if that user can see the object

How to auto like facebook page from other site?

On the facebook page,we can click the like button to like the page.
How can we use any api or plugin to realize from other site?
You can not automatically like an object for a user nor can you present like via the APIs. This prevents anyone "secretly" having users like pages / objects.
The solution is to embed a like button to your page and give users a clear reason to use it [sell the benefit of liking your page]. You can run a separate version for individual pages, objects or just an aggregate button for all of your site via the data-href element.
http://developers.facebook.com/docs/reference/plugins/like/
You can check if a user has liked your page using:
FB.api('/me/likes', function(response) {
console.log(response);
});
Loop through the response and look for your page ID.
The open-graph api has now been updated to support creating (and deleting) likes.
See here:
https://developers.facebook.com/docs/opengraph/actions/builtin/likes/

Create a Facebook "Like" programmatically?

I'd like to replicate the "Like" button functionality in an iPhone application using a native widget. The URL associated with the Like would be a product page with details on the manufacturer's website. Unfortunately, Facebook's Like Button [1] only supports the iframe version. Is there any way to have a user "Like" a URL without using the Like Button?
[1] http://developers.facebook.com/docs/reference/plugins/like/
There's no API to actually create a Like connection.
Looking at the Facebook Developer info, it appears it is possible to Like an Open Graph Object if it already exists in the Open Graph database. Look for the "/OBJECT_ID/likes" method under the "Publishing" section of the API Reference. It says you can "Like the given object (if it has a /likes connection)".
But I do not believe Facebook provides the ability to create NEW Open Graph objects (for, say, a webpage) programmatically. If anyone knows how to do this, I would be interested to hear about it.
There looks to be an assigned bug about not bing able to create new Graph Objects via the API: http://bugs.developers.facebook.net/show_bug.cgi?id=10714
We want to have our own "Like" system with an additional "Dislike" option, and if the user "Likes" something with our system we want to create a Facebook Like in the background. It seems we will need to pre-Like all of the objects (thousands of pages!) so this won't work for us. :(

Liking a Specific Facebook Post

I'm trying to embed the Facebook Like button on a web site. The URL of the item I am trying to allow the user to "like" is an individual Facebook post on a Page's wall.
I'm using a simple FBML implementation of the Like button like so:
<fb:like href="http://www.facebook.com/[PAGENAME]?v=wall&story_fbid=[ID OF THE POST]" layout="button_count"></fb:like>
The like button works, but when it is clicked, the user is actually liking the PAGE, not the individual post.
Any help would be much appreciated. I've tried various formats for the URL, but so far have not been able to make it work.
Thanks!
What you are trying to do is not possible. You can only 'like' things that have a unique page to display them. The url you have ?v=wall&story_fbid=[ID OF THE POST] is just a 'helper' url for facebook. It takes you to the http://www.facebook.com/[PAGENAME] url and Facebook will treat this url the same as the page.
It is a bit confusing because you could do something like you are talking about off of facebook, but the like inside of Facebook isn't really the same as what the like button's are doing. The like buttons are using the Open Graph protocol. Content on facebook.com doesn't play by the same rules.
In short, likes for "facebook generated" content inside of facebook can only be liked inside of facebook.
Check out this article for more information on some of the things you can do with the like button inside facebook: http://developers.facebook.com/blog/post/407
Very late answer, but the Graph API might help. You might be able to grab a post and like it - https://developers.facebook.com/docs/reference/api/post/