Facebook comments on my website - php

I had a movie related forum in my website. There is a commenting system for each movie and artist. Simply users can add comments.
Now I would likes to implement facebook commenting system to my application . My little worry is how to implement all these two ( fb and my own system )?
Also I had a doubt ..
If I put / share the link on this site on the facebook and assumes that users commented inside facebook .. Then there is any option to print that comments in my web site in that page?

Facebook comments is a social plugin that could be embedded in your web page. Specifically it's implemented inside an iframe. Since that iframe is implemented on facebook so you don't need to worry about how to generate the content. Although it looks like appear in your web page.
However if you do need to access the comments data (programmatically), you could retrieve the comments via facebook graph api: https://graph.facebook.com/comments/?ids={YOUR_URL}. You can also subscribe facebook events to get aware when someone has commented on your movie.
Ref:
facebook comments plugin: https://developers.facebook.com/docs/reference/plugins/comments/
facebook event subscription: http://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/

Related

Use facebook sharer.php to share on a page wall

I want to link a user to make a share post on my fb company page without having to authenticate. Currently I can get them to share on their own wall with:
But I'm not sure how I can get this to share to a page's wall rather than their timeline.
I got somewhat close by using the dialog feature:
https://www.facebook.com/dialog/feed?app_id=xxx&link=xxx&picture=xxx&name=xxx&caption=xxx&description=xxx&redirect_uri=xxx
But that just showed it as a normal share but done "via appName", unless there is a step I'm missing to link my app to my facebook page?
Thank you!
Unfortunately, the sharer.php method is used only to share only on the user's timeline.
If you want to ask the user to post on a page's timeline, you have to create an app, ask the user to authenticate it and then use the Facebook APIs to post on their behalf. I guess that will be cumbersome in your case, so I would just suggest you redirect to the particular Facebook page.
You can't !
To publish on YOUR page timeline, users need to have the rights to do it (be admin, writer, ...) : it's a manual requirement on the Facebook interface.

Facebook like button and OAuth Access

I am connecting to the Facebook API using HybridAuth on the server side (backend is written in PHP). This is for a SaaS publishing application that is hosted on our servers. I understand the mechanics of OAuth and that once I accquire the appropriate permissions from the user, I can write and read from the Open Graph API, which in theory will allow me to do almost anything.
The problem is that I would like to use some of Facebook's social plugins. In particular, I would like to implement the like button so that it automatically appears for each blog post, article and page.
The problem is that the like button and the various Facebook plugins require an app_id. I would prefer not requiring users to add the developer app to their account and creating an app to get an app_id as it can be a confusing process for non-developers.
Is there anyway we can create or retrieve an app_id from open graph (which we can store and use to generate the like buttons and other facebook widgets)?
With the migrations, I understand that each liked URL will not have it's own page. Once the user clicks a like button on your site, he automatically likes your page. However, let's say I have a page called http://www.mystore.com/products/some-awesome-product and there are other similiar pages, all with a like button. Is it possible that when clicking like, the user automatically likes our Facebook page, but when an item is published in their news feed for the like, the URL links to that specific product? Effectively, is there a way for users to like multiple pages from my site?
Update: It looks like we can generate app_ids programmatically with the create application API in the legacy REST API. However, this does not seem to be an option with the graph API.
Seems like we cannot programatically create an app_id for an account. This is not an issue, as we will just create a small guide to guide our users through creating an app and submitting the app_id to us using a form. Not perfect, but should be easy to implement.
As for URLs, liking something will not automatically like your Facebook page. If href is blank, the current page will be liked. If you set your facebook page in the href parameter, then your facebook page will be liked.

Facebook social features on iframe app

We are developing a facebook iframe application that pulls some images (via an API) to the current user album (creates a new one).
The user views his newly uploaded album photos using a facebook lightbox clone. In this clone he must be able to comment and like the current viewed photo.
Is there a way to provide facebook comments & like to these pictures without the use of the Graph API (which would require us to replicate a lot of visuals).
Another try was the social plug-ins with the facebook photo url given but no success.
Any ideas?
I would recommend using the social plugins that facebook provide.
For the likes and comments you can specify a URL in the plugin code, that URL should be the URL of the photo relative to your app e.g. http://myapp.com/photo/123 and not the http://app.facebook.com address.
Facebook will need to be able to crawl that URL so if you are checking if the user is logged in via PHP then you should either disable this if the user agent contains facebookexternalhit or show a different page for that user agent. It doesn't matter about the content, just set a couple of og: meta tags and that should be fine.

How to make the facebook comments on my website and on page's wall post binded?

everybody.
I am developing the facebook tab application. The functionality is pretty simple and is close to the blog.
Page Admin writes articles in the app, and the link to each article is posted on the page's wall via Graph API.
The wall post from step 1 contains a link to the application tab of the page with post_id passed via app_data parameter.
The article itself contains the facebook like and comments plugins on it. To attach this plugins I use the url of the external website on which pages are prepared for Facebook scraping (Open Graph tags and stuff).
And finally the question!
Is it possible to somehow manage the situation whenever user posts the comment inside an application tab, his comment automatically appears near the wall post performed in step 1?
I really hope that the question is clear. Any help, please?
You can publish comments to a Post via the Graph API:
https://developers.facebook.com/docs/reference/api/post/#comments
You will need to ensure that you have:
Requested publish_stream permission from the user
Indicate to the user very clearly that you are going to publish a comment when they do this (to do otherwise would not only break Platform Policy, but would be a crappy experience for users)
Subscribe to the Javascript comment.create event which is fired when someone posts a comment in a comments plugin: https://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/

How can I make news feeds appear from Facebook page owner using the Facebook API?

Does anybody know how to make news feeds appear as from Facebook Page owner?
IE. I have few page admins on FB, and I have Facebook Integration on my website (PHP), and when someone posting announcements on Facebook thru the website all that feeds are appearing as personal feeds.
Thanks!
You would need to prompt the admin for the additional scope of "manage_pages", then access /me/accounts to get a list of access_token's and pages they manage, and then post a message like normal using that special access_token. There is a good walk through of this: http://www.sergiy.ca/post-on-facebook-app-wall-and-fan-page-wall-as-admin/

Categories