Is it possible to "like" an OpenGraph Object? - php

I am having problems to link the Facebook Like buttons in my website with the OpenGraph Objects.
Since a couple of days, I have updated the metadata of my website declaring specific sites as different OG Objects. This is working fine, since
- the Facebook Debugger is accepting the URLs and recognizing them as OG Object with no errors
- the insights of my App shows me a very big increment of the Object Lifecycle from the moment these changes became live
At this point, I would have expected that every like button pressed in each of these sites would publish something similar to
"User1 likes a ObjectTitle on App"
but the message generated is still "User1 likes a link" or "User1 likes a page"
Is it really not possible to connect the original Facebook Like Button with an OpenGraph Object?
Do I need to create a "Built-In Like" to publish such a Story in a User's Timeline?
Do I miss something here? or is anyone having the same problem?
Thanks! I appreciate any kind of help.

Is it really not possible to connect the original Facebook Like Button with an OpenGraph Object?
Yes, that is exactly what you are doing. All your URLS that have been debugged and liked are now objects on the Graph.
Do I need to create a "Built-In Like" to publish such a Story in a User's Timeline?
Yes you need to use the built-in like action to achieve this, but Facebook will mostly likely reject your request to submit the action if your reasoning is not strong enough for not using the regular like button.
You need an object that is significantly different from a regular article page (e.g. a recipe)

Related

Facebook Graph: PHP: Display Facebook posts/review on website without any login

My client has a Facebook page which has his latest posts and shows the reviews people have added.
I want to grab these from Facebook, and output them on his website all styled up nicely with my own markup and styles.
I have had this running in JavaScript with the access token pasted in the JS which is obviously not the way to go, and the token will expire. Now im trying to do the same with PHP. I've read & watched more clips than I care to mention, and I cant get my head around one particular part. Every demonstration i've read or watched requires the website user to login to facebook before this data is returned.
I cant expect ever user who goes on the site to do that. Am I missing something? I just want get the data and display it. No Adding, No Deleting, No Updating. Just display the same information on his website.
Sorry if am asking something stupid here, i'm a novice and for all my efforts I am struggling to understand. I kind of need it in laymans terms so to speak.
Thanks in advance.

documentation to create a like button in a facebook app

I'm trying to figure out which facebook documentation is relevant to what I want to do.
I want to create a facebook app which I understand is like a glorified iframe pointing to my web server which will serve just 2 html pages. On one of my pages, I want to create a link or button that looks like a big orange race car. When the user clicks on the race car, it fires the "facebook like event", then redirects the user to the second page on my web server. Right now, I do not know how to create the orange race car like button.
I've already set up the facebook app, and it is correctly reading the web pages on my server. I am using PHP.
So my question is any of the following:
a) which page of facebook documentation should I read to learn how to do this
b) does anyone know of any example code I can work with?
**In the past, I had to use oauth to have the user register my app and login before they can do anything with my web app. But this time, my web app IS A FACEBOOK APP, so I'm hoping i don't have to do any of that oauth process. This is why i feel lost in the facebook documentation...i'm not sure which parts are specifically relevant to my facebook app's orange car like button, and which is not.
But this time, my web app IS A FACEBOOK APP, so I'm hoping i don't have to do any of that oauth process.
There you’re wrong already. You will not get any info about the specific user, unless you have them connect to your app first.
Right now, I do not know how to create the orange race car like button.
Using the normal Like button plugin, you can hardly change anything about its appearance at all. (And you are not allowed to, by Facebook policies.)
So your only viable option to have a button of your own choice that triggers a like, is to use the Open Graph built-in like action.
JOHN SAYS - I followed up this question with another - stackoverflow.com/questions/12607458/like-action-for-facebook which has part of the answer to this question

Facebook api - PHP / Javascript and OpenGraph

I'm very confused so I hope that my question will make sense.
I'm working with the facebook API, and so far I've implemented login and a post to the users wall via php. I know read a bit more about the OpenGraph system, and the meta tags that you're supposed to put in your site, but I'm not quite grasping the concept og how to get my site fully PHP integrated with Facebook.
I have another login system which I've hooked facebook up to, so switching to javascript only will not be an option. Do the meta tags even matter if I use PHP only. I mean, I can't really get my head around how the token and all of that would be interpreted alongside the og: metatags if there is no javascript on the site.
Can I have BOTH php and javascript authentication? What's all that fuzz about opengraph anyway?
These are my thoughts about working with facebook, and if you'd like me to summarize this up in one question I guess it'd be:
How do I benefit from the opengraph meta tag features (tracking the users, in their timeline) when I'm only connected via PHP?
I'm confused about how the tags for specific open graph actions get interpreted like
<meta property="fb:app_id" content="xxxxxxxxxx" />
<meta property="og:type" content="myapp:read" />
and then it's supposed to post "MyName is reading lalala" or "MyName read lalala". How's the post to the server going on (if people have already authenticated via php):) ?
Unless I am misunderstanding your question, I think you are confusing how the Open Graph meta tags work. The meta tags provide external websites with exactly what they say: meta information, to be read by Facebook's "crawler". Facebook has their own web crawler that will grab certain relevant information about a webpage (for example, page title, page description, an image to associate with a webpage) so that Facebook can use that info when people "Like" or "Share" a webpage.
For example, going to https://www.facebook.com/sharer/sharer.php?u=http://example.com should illustrate how the crawler works: when someone tries to share the URL example.com on Facebook, Facebook's crawler goes to the example.com webpage and grabs relevant info, then displays it on their own page to allow you to share it with others.
The open graph tags have little or nothing to do with authenticating a user or application on Facebook's servers. They can be used totally independently of any login system that you have in place, as far as I know. All they do is provide meta information about a web page to Facebook's web crawler.
I understand your frustration with Facebook's API though - they are notoriously bad about keeping detailed, accurate information, and they change the API so frequently it's nearly impossible to keep up.
I can confirm that you're not the only one to be frustrated with the Facebook Documentation.
With that being said, i'll try to help you. As Sean said, the og graph tags have little or nothing to do with your authentication flow.
These are featured as information of what the user is doing at a certain time, like listening to a song, playing to one particular game, etc...
The Facebook's PHP SDK provides you functions to create your own objects and actions. Then you can call a $facebook->api(/...) function to indication to Facebook : My user is ACTIONS an OBJECT. Doing this, you must provide a parameter, which is the URL of the OBJECT on your Website/Application. In fact, Facebook wants you to tell him where he can finds what's this object. On a page where there's the correct meta-tags corresponding to this object ! Here are your og tags.
As you said, this will provide stories found in the timeline, or the ticker. It's those kind of things that Facebook Games use, "X is playing to Y", "Z earned the Grand Master title by playing on A", etc...
You must define those objects on your Facebook Applications Panel, and have the corresponding meta-tags on your website.
Then you just have to make the $facebook->api(/...) (or equivalent) request when this action happens on your website/application !
Everything is almost entirely explained in this tutorial : http://developers.facebook.com/docs/beta/opengraph/
Hope this will help you to find an answer.

Change / Hack style of Facebook 'Like it' button

I want create own "Like it" Facebook button - similar with my website design.
I know that Facebook use special "secure" method to authorize "Like it" clicks.
But I think I know how to hack it and create own styled and working "Like it" Facebook button.
I hear that this it's not allowed by facebook rules and here I asking - is there any side effect from Facebook? Can they block my account?
UPDATE:
I changed my decision.
I will stay with facebook standard button.
There is no sense and not worth it to modify this button :/
Yes, they can do whatever they want if you violate their ToS. Facebook is a stickler for maintaining its brand, and modifying the Like button would definitely not make them happy. Save yourself the trouble and just use what they give you.
Hacking the like function? Assuming there was some way to "hack" this it would definitely be a TOS violation.
If you mean, however, creating custom actions for posts generated by apps, that is within the Graph API. Start out by learning to use the Facebook API by looking at its documentation. Create an app in the Facebook system first.
http://developers.facebook.com/docs/
After you've learned all about requesting permissions and proper usage of the FB dialogs and user content-control system (this includes best practices and rules), you'll find a special parameter submitted with the set for "posts" in the api called "actions." This property accepts a JSON object of the link text and link to forward to. Please note they do not allow your action names to collide with any of the Facebook core actions. Naming your custom action "like" and having it lead elsewhere is DEFINITELY a bad idea and will probably get your appID deleted.
http://developers.facebook.com/docs/reference/api/post/
You can use Facebook's share url to make your own buttons, and connect them to services like sharedcounter.com api (or build your own request to the Facebook api) to have the total "like" count. Example (hover on the heart sign on the left)

How to programmatically "press" a 'Like' button through a Facebook Application?

I'm developing this Facebook Application and I was wondering if it's possible (and how) to programmatically, through the Facebook PHP Graph API, press some 'Like' button on some page?
Of course, this is optional on my application... I'm still not ready to really explain what application I'm doing, but it would be interesting to code such a feature.
Is it possible somehow?
By your description it sounds like you're trying to get a user to like something without the users knowingly clicking a like-button. This sort of interaction is not condoned by Facebook, I think. There are various black-hatty ways to accomplish this though, one fairly elaborate one is descriped here: http://www.liquidrhymes.com/2010/08/25/smoking-hot-bartender-is-some-smoking-hot-facebook-spam/
UPDATE Sorry, I might be wrong. If you get stream_publish extended permissions from the user, you might be able to like posts on their behalf by doing a POST to /POST_ID/likes. See Publishing to Facebook in http://developers.facebook.com/docs/api
You cannot do this. Facebok wont let you do a POST to /POST_ID/likes, you can only do a get request to retrieve their likes. What you are trying to do is a violation of facebook's TOS. I would suggest just adding a like button and "forcing" them to like before they continue with your application. However, in my opinion even that is kind of silly because they can instantly go unlike it after they have used your application.
i was looking for the same thing, but not to force a user into liking something, but actually for their own protection.
here is where i come from: on a web site (maybe on multiple pages) there is an "I Like" button, implemented as described by facebook.
each time a user goes to that page, the browser will make a request to facebook, throught the iframe that contains the button, providing all the info that we are used to from a web server log file.
if the user has in the past logged in facebook and not cleared the cache. the request will also contain the cookie indentifying the facebook user.
so even more then analytics, facebook know all about the user activity on those pages.
so i wanted the user to only give this info when they decide to.
my solution was to have a button (as graphic only) on the page. when the user clicks it a new frame should open and only there the facebook code should be executed.
obviously on the new frame i could not put the normal "i like" code, since that would require a 2nd click for the user. at this point i would need the "programmatically clicking of the i like button".
it is not an opengraph solution, but it works: the frame just does a redirect to
http://www.facebook.com/share.php?u=URL

Categories