Remove Facebook Comments from Site - html

I've got the basic comment box on my site. NOT attached to an app or part of one (as I don't develop apps).
<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";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-comments" data-href="http://www.-----.com/tech" data-num-posts="3" data-width="500" data-colorscheme="dark"></div>
In the head tag:
<meta property="fb:admins" content="My User ID"/>
Now, when someone comments on a friend's comment, I don't want that to show on my site. How the heck can I remove the comments from my site!? This is driving me insane.
So other than this https://developers.facebook.com/tools/comments, what can I do to remove some of these comments?

Ensure that you have replaced the code with your user_id from facebook
You can find out your user id by going to the following address:
http://graph.facebook.com/[YOUR USERNAME]
For example, mine is http://graph.facebook.com/coulton resulting in the following.
<meta property="fb:admins" content="543270572"/>
This must be in the tag of the page which contains the Comments plugin
Now when you're logged in to Facebook with this account, you will see a "moderator view" button appear at the top of the comments window.
You should now see the interface to edit the comments from your site.

Also when you don't develop an app on FB, you can use the comments-tool from facebook and it's what I strongly recommend, because it's the easiest one. The comment-box itself can be registered to an app and you don't need to write a real app to use it, that's just what Facebook calls it.
So therefore you just create an 'app', which is only responsible for comment administration. Create an app and register it in your meta-tags with fb:app_id on your page with the comment box! Instantly you can use it to moderate all your comments.
The other solution is to be logged in with the user defined in the fb:admins tag and go to the comment box and choose moderation view. Use the tips mentioned by Coulton. Use the debugger to see if everything is set up right.

Related

Facebook like button disappears when going to a previous page and then returning to the original page

I am using a Facebook like button in my webpage and it appears on my website, but after clicking to the previous page and returning to the original page it disappears. To prevent it, I should go to the previous page, reload it and click the exact page where the like button appears.
Here is my like button code. I fixed it by using $window.reload in angular, but I am looking for another solution (if one exists).
Please help.
#fb-root
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 = 'https://connect.facebook.net/ru_RU/sdk.js#xfbml=1&version=v3.2';
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
.fb-like( data-layout='box_count', data-action='like', data-show-faces='true', data-share='false')
The JS SDK goes through your document once on initialization and looks for elements to replace with social plugins.
In a system where you switch out content dynamically via AJAX, you need to call the method the SDK provides to re-iterate the current state of the document:
https://developers.facebook.com/docs/reference/javascript/FB.XFBML.parse/

Nginx - Share on Facebook button - 403 being shared

I created a Coming Soon page with a "Share on Facebook" button but when it's clicked it'll open up Facebook on the "Say something about this" page but the actual content it's shows is nothing but a 403: Forbidden. When I end up sharing it anyway it still appears on my wall as the 403: Forbidden but the link as it should works though, i.e. by clicking on it on my wall it'll take me to my site just fine. Also when I go to my site normally it also works. I'm using Nginx as my server and from what I've seen 403s are quite common for Nginx and I've found multiple articles dealing with 403s but none of them talk about solving it for FB share buttons (only for when you get a 403 trying to access the site normally).
In my HTML I have the following meta tags in the head, the following script and the following share button:
<!-- Meta Tags: -->
<meta property="og:url" content="http://www.example.com" />
<meta property="og:type" content="website" />
<meta property="og:title" content="exampleName" />
<meta property="og:description" content="exampleSlogan" />
<!-- FB Script -->
<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 = 'https://connect.facebook.net/i/suspect/i/should/maybe/keep/this/part/secret';
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<!-- Share button -->
<div class="social-btn btn-fb" data-href="http://example.com" data-layout="button" data-mobile-iframe="false">
<a target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=example.com;src=sdkpreparse"><i class="fa fa-facebook"></i></a>
</div>
I'm sure you'll be able to tell where I censored urls, values, etc. but if you're not sure whether or not something is wrong or if it's censored, feel free to ask
As far as Nginx goes my skills are still pretty limited so I don't really know what to include here to help solve the issue so If you want me to post something Nginx related let me know and I'll do it. Also let me know if I need to supply any other information.
Edit I don't know if this is relevant to my issue but when I open the my web page it gives my js error: FB.NativeExtensions.onready only works when the page is rendered in a WebView of the native Facebook app. Test if this is the case calling FB.UA.nativeApp()
To figure out what goes wrong in such a case, re-scrape the URL using the Facebook debug tool, and then check the server logs around this time.
If scraping alone solved the issue, then your server for some reason blocked the request the last time the Facebook scraper did try to gather data, but doesn't any more now. If this wasn't a one-off occurrence, but turns out to be a more systematic issue with new articles, then check if you maybe have a like button embedded in a preview of the URL that is only available to the logged-in admin, or something like that, that could trigger a scrape by Facebook before your system is willing to answer the request "properly" to outsiders.
If you need to correct this issue for more than a few URLs now, you can also trigger a re-scrape via the API.

Facebook like button not rendering in Firefox and IE

I really hope someone can get me started on this one.
I generated the HTML5 integration code for the Facebook like and share buttons using the facebook developer form. After integrating the code on a client's website, the buttons are only shown using Chrome, but they are not rendering in Firefox or IE.
Looking at the generated code it seems that the Facebook API does not create the code needed to show the buttons when using the latter.
I searched quite a lot and experimented with all kind of initializations (synchronous vs asynchronous loading, different integration methods like iFrames, xml declarations, app publishing, etc...) - with no change in behaviour at all.
I also thought I might have trouble with other scripts running on the page, but when creating a new website only holding the like button codes the problem remains.
By now I am running out of ideas and I cannot find anyone having the same problem. Seems to be some stupid error I cannot see myself. Would someone help me out having a look at:
http://www.berliner-bueroverzeichnis.de
http://www.berliner-bueroverzeichnis.de/debug.html
CODE:
Insert title here
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '470372866398003', // App ID
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
};
// Load the SDK Asynchronously
(function(d){
var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/de_DE/all.js";
d.getElementsByTagName('head')[0].appendChild(js);
}(document));
</script>
<div class="fb-like" data-href="https://www.facebook.com/berlinbueros.de" data-width="250" data-layout="button" data-action="like" data-show-faces="false" data-share="true"></div>
</body>
</html>`

Facebook Like Button on Blogger is showing total like count of the mainpage, but not of each individual article (for new articles)

So I'm trying to help a friend out with his Blogger blog and its integration with Facebook. He'd been having several issues (like a messed up og meta tags and what not) and we were finally able to get everything sorted, and running the site on Facebook's Debugger, everything came out fine. But now we have an issue where new posts show the overall likes of the main page, and not of each individual post for their Facebook Like buttons, while old posts are unaffected (have individual like counts.)
FYI, the site in question is Los Heladeros (which apparently has around 87 likes at this point), and the Facebook site is /LOSH3LAD3ROS (which has 765 likes, so the likes aren't tied to the Facebook site, but rather the main page domain).
Now, we followed this tutorial to create the code for the Like button to show up on each post (which it does, no problem). Here is the code for the button:
<div>
<b:if cond='data:post.isFirstPost'>
<script>(function(d){
var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
d.getElementsByTagName('head')[0].appendChild(js);
}(document));</script>
</b:if>
<fb:like expr:href="data:post.canonicalUrl" layout='standard' send='true' show_faces='false' font="lucida grande" action="like" colorscheme="light"></fb:like>
</div>
However, now, any new posts on the site are including the total likes for the main page (not the FB page), and not likes for the individual post (i.e., every new post starts off immediately with something like 87 likes at this point), yet all the old posts (before we fixed the Open Graph metadata issues) are perfectly fine (i.e., they show maybe a few likes, and are not affected by new likes or shares from the main page.)
FYI, I've just noted that a post that was before the fix, and previously only showed a few shares, has now reverted to the overall count...
Here's the Open Graph metadata for the site:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html>
<html b:version='2' class='v2' expr:dir='data:blog.languageDirection' xmlns='http://www.w3.org/1999/xhtml' xmlns:b='http://www.google.com/2005/gml/b' xmlns:data='http://www.google.com/2005/gml/data' xmlns:expr='http://www.google.com/2005/gml/expr' xmlns:fb='http://www.facebook.com/2008/fbml' xmlns:og='http://ogp.me/ns#'>
<title>Los Heladeros: TU UPDATE MUSICAL ANTES QUE SE DERRITA</title>
<!-- Facebook Open Graph Meta Tags -->
<meta content='Los Heladeros' property='og:title'/>
<meta content='blog' property='og:type'/>
<meta content='http://www.losheladeros.com' property='og:url'/>
<meta content='https://fbcdn-sphotos-h-a.akamaihd.net/hphotos-ak-ash4/377165_310579818971632_1169246050_n.jpg' property='og:image'/>
<meta content='Los Heladeros' property='og:site_name'/>
<meta content='502365163' property='fb:admins'/>
<meta content='335887849786080' property='fb:app_id'/>
<meta content='Descargas gratis de música que no es cool, pero lo será mañana | HOUSE | INDIE | DISCO |' property='og:description'/>
<!-- Open Graph Meta Tags by: www.MetaTagGenerator.org -->
So I've read on other posts that you have to set the "og:url" to the specific site in question (i.e., every single post) and not the overall site, but isn't that what the "data:post.canonicalUrl" bit in the FB Like button code supposed to do? I know there has to be a way to have one universal code on the template page, and have the urls be pulled dynamically and the counts be individual for each post (and looking back at the old code before the meta tags were cleaned up, he had the same overall site URL as we have now, and never encountered this issue, so clearly before it was somehow working in a way).
Also, if I share any of the new articles, I subsequently get the picture and description of the main page, and not of the individual post, but when I share an old post, it auto generates the correct image and description. I've tried comparing the Facebook Debugger on both an old post and a new post and there is no discrepancy (as there shouldn't be any). I'm so confused as to what could possibly be doing this since it's a universal, over arching code, and I guess I would expect ALL posts to act the same way, and not just some (i.e., new and old).
FYI, since I'm a new user I can only post two links, but if you go to the main page, the newer posts are up top and have the 87+ like counts on the buttons and if you scroll down you'll eventually see older posts which have more modest counts (i.e., they're being counted correctly).
I would greatly appreciate any help you guys can give me. This is my first stackoverflow post, and I've read almost every single related post and still cannot find an answer to this problem.
OK, so I'm pretty much calling this one solved. I stumbled upon the following tutorial which details a thorough way of creating the correct Facebook Open Graph meta tags for Blogger:
Open Graph markup for Blogger [version 3]
Here are my updated meta tags, which seem to work perfectly fine going forward:
<!-- OPEN GRAPH MARKUP FOR BLOGGER [VER. 3] TAGS http://goo.gl/tyJ9a FOR ORIGINAL TUTORIAL -->
<meta expr:content='data:blog.pageName' property='og:title'/>
<meta expr:content='data:blog.title' property='og:site_name'/>
<meta expr:content='data:blog.canonicalUrl' property='og:url'/>
<b:if cond='data:blog.metaDescription'>
<meta expr:content='data:blog.metaDescription' property='og:description'/>
</b:if>
<b:if cond='data:blog.pageType == "item"'>
<meta content='article' property='og:type'/>
<b:if cond='data:blog.postImageThumbnailUrl'>
<meta expr:content='data:blog.postImageThumbnailUrl' property='og:image'/>
</b:if>
<b:else/>
<meta content='blog' property='og:type'/>
<meta content='https://fbcdn-sphotos-h-a.akamaihd.net/hphotos-ak-ash4/377165_310579818971632_1169246050_n.jpg' property='og:image'/>
<meta content='502365163' property='fb:admins'/>
<meta content='335887849786080' property='fb:app_id'/>
</b:if>
<!-- OPEN GRAPH MARKUP FOR BLOGGER [VER. 3] TAGS http://goo.gl/tyJ9a FOR ORIGINAL TUTORIAL -->
Of note, I added the admin and app id at the bottom, indented under and the Facebook Debugger/Linter seemed to be OK with that (before it gave me a warning that it was out of place). Also, my friend had a mismatch of APP IDs between the meta tags and the javascript implementation. I fixed that and put the same APP ID, and although the posts that were messed up are still messed up with their counts, going forward, all posts behave as they should with correct Like counts and when shared, the posts' info is correctly pulled into the share on FB (Title, Photo, Description).
Hope this helps anybody else who might be running into the same problem. Props to George B Moga. Here is the stackoverflow post where I found his link to the template for the meta tags.

How to implement Facebook or Twitter login in Blackberry Playbook Application

I have been working with development of Blackberry Playbook Application, i.e.. HTML5/Webworks, I would like to implement a feature of Facebook Login for my application, but for some reasons I couldn't do that.
For testing I have been using Ripple Emulator
Code for facebook login button -
Button - Facebook Developers
I have added this code just below the body tag
<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=APP_ID";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-login-button" data-show-faces="true" data-width="200" data-max-rows="1"></div>
With this code I am able to see the login button, but when I click on the button it does not generate the popup like we get on web application.
Please suggest any ideas for the same.
Regards
js.src="//connect.facebook.net/en_US/all.js#xfbml=1&appId=**APP_ID**";
APP_ID is your app_id, you've got to replace it.