james d. low

live / work / play / worship

Facebook Comments

For a while I’ve been using Adam Hill’s facebook comment importer, to get comments from facebook back in to my blog. I recently realised it wasn’t working, so I tried Thomas Albright’s edit, no joy there either. Did some debugging and got it working my self. You can download it here: facebooknotes.php.

All new changes have been commented incase they need to be moved back, though I think my version is the only one being actively maintained at the moment.

Change Log:
0.28
Option to import from every page of notes from facebook, not just the first one.
0.27
Version 2.5.1 introduced that the GUID might not be the permalink (http://trac.wordpress.org/ticket/6492). The plugin now uses a different method for converting the URL to a post ID. Should also fix some earlier problems with the “Original Comment Post Not Found” error.
0.26
Version 0.26 with fix for latest facebook HTML mark up
0.25
Fix added by Aaron Harp to allow thie plugin to work with feedburner


If you found any of the software useful, please consider supporting its further developement by donating.

6:50pm / Nov 18th / 07
« Donald Miller - Story Hey! Get My IP »

81 Comments

    Facebook seriously need an API for this, and for groups.

    7:19pm / Nov 18th / 07 James Low

    Ok, another update to facebook’s html broke the plugin again, hopefully I’ll have a fix soon.

    11:03am / Nov 23rd / 07 James Low

    Ok its fixed, version 0.21. Also found a bug related to people commenting more than once, which is fixed as well. Can use the same link as before.

    12:59pm / Nov 23rd / 07 James Low

    This is an example comment from facebook…

    12:01pm / Nov 25th / 07 James Low (via Facebook)

    I tried installing verion 0.21 and I get a “fatal error” when I try to activate the plugin. I am changing the extention of the text file from .php.txt to .php Am I doing something wrong?

    10:56am / Nov 26th / 07 Dany

    yep, should change from .php.txt to .php

    What version of wordpress are you using?

    11:01am / Nov 26th / 07 James Low

    I am using version 2.2.1.

    11:08am / Nov 26th / 07 Dany

    I’ve tried on version 2.1.3 to 2.3.0

    11:09am / Nov 26th / 07 James Low

    haha, ok, while i’ve tired on version 2.1.3 and 2.3.0, not on all version inbetween. hmmm. let me see if I can install that version on my test blog.

    11:10am / Nov 26th / 07 James Low

    It seems that the facebook developers are trying to keep pace with us “hackers”. Since their revenue now depends on ads, FB is trying to keep all functionality WITHIN facebook pages (more ads displayed).

    A bit short-sighted if you ask me.

    11:25am / Nov 26th / 07 Dany

    yea, they’re missing tons of functionality from their API, and I think opensocial is a much better idea.

    I’ve tried the plugin on 2.2.1 and it activates, I’m on php 5+, but I’m not sure its that. Have you tried the older versions of the plugin from Adam’s site? I haven’t changed much of the code, so activation should be the same, so if those work, this should work. I mainly changed some of the regular expressions and things.

    11:33am / Nov 26th / 07 James Low

    I just upgraded to WordPress Version 2.3.1. And I just re-installed v.0.21 for the plugin. I used the “manually import” button and it detected the comments from facebook, it said that the comments were added to the WP database… BUT STILL, they do not show up in my page.

    11:39am / Nov 26th / 07 Dany

    Yes, I tried the 0.1 version on both of my WP version. Hmmm…

    I appreciate your help and time. Please find me in facebook, I could not find you. Thanks bro.

    11:42am / Nov 26th / 07 Dany

    * is there a delay? Wordpress is saying that the comments found from FB are already in the database. Nothing shows up. Any ideas?

    11:46am / Nov 26th / 07 Dany

    This is why it is not working. Because although WP detects and imports the comment, it does not associate it with the correct post, as it is shown in the “# 0″ at the end string.

    “Nov 25, 10:48 PM — [ Edit | Delete | Unapprove | Approve | Spam ] — # 0″

    11:57am / Nov 26th / 07 Dany

    ha, sorry this is such a hack, there shouldn’t be a delay, the output that say’s they’re in the database only occurs if they have been selected back from the DB, so if you go to your mysql database they should be in there.

    yes, it does seem that maybe they’re not associated with the correct post. They did the last time I tested on mine. I’ll ad a comment from facebook, and try again.

    12:00pm / Nov 26th / 07 James Low

    hmmmmm… ok my test comment appears, but the date / time stamp is wrong because it doesn’t take into account the time difference between my blog and facebook.

    I wonder why yours isn’t finding the correct post?

    12:06pm / Nov 26th / 07 James Low

    just been going through the code, the plugin detects which post to apply the comment to by using the guid from the database, and comparing with with the url extracted from the facebook “view original post” link.

    if the url fed into facebook from your RSS feed is different from the one in the database, it would fail to find the correct post.

    12:24pm / Nov 26th / 07 James Low

    Thanks, James. The problem was that I was using a feedburner plugin to redirect the rss feed to a central location to keep track of subscribers.
    “http://www.feedburner.com/fb/a/help/wordpress_quickstart”

    I was using the rss feed to import posts into FB. That is the reason why the Notes in FB (original posts) and the WP posts were not matching.

    I had other upgrading issues. Resolved them now.

    Conclusion: Plug-in version 0.21 works like a charm. Thanks.

    Dany

    2:29pm / Nov 26th / 07 Dany

    great, haha until facebook change something and I have to fix things all over again…

    8:47am / Nov 27th / 07 James Low

    can u add support for characters like æøå?

    4:53am / Dec 5th / 07 Patrick

    THANK YOU! It’s nice to have this working again :D

    5:29am / Dec 5th / 07 David Hildreth

    Testing other characters æøå hehehe

    9:05am / Dec 6th / 07 James Low (via Facebook)

    Hi Patrick, I’ll try and see what I can do, no promises on time though :-)

    4:08pm / Dec 6th / 07 James Low

    Hey patrick I just ran a test posting a comment from facebook and it does support the characters you mentioned.

    Let me know if there’s anything you think isn’t working for you.

    9:09am / Dec 7th / 07 James Low

    I just added the plug, and it looks fantastic. Thanks for the time you’ve put into it.

    9:34am / Dec 17th / 07 Dan

    [...] I end up with comments on the blog and some on Facebook. Thankfully, I found a neat little script that pulls in Facebook comments into Wordpress, making everything consolidated. [...]

    8:50am / Dec 20th / 07 Keith Mander’s Blog » Aaargh!

    I’m running on WP v2.1, and it’s not doing anything for me, not even wrong posts, moderation, nada.
    Maybe I’m having the same prob as aforementioned, because I’m importing my FB from a feedburner feed of my WP site? If so, then.. well, I guess i’ll just have to do a CBA of what I prefer, is there no hope though/then? I think I only had a comment on one of my notes, which was sometime back…

    6:30am / Dec 31st / 07 Ajay Tallam

    Installed plugin, was working great, but now all comments are going to entry #0 and don’t display. Any ideas?

    Neil

    3:07am / Jan 22nd / 08 Neil Forker

    [...] More information and the latest version can be found here: http://jameslow.com/2007/11/18/wordpress-plugin-facebook-comments/ [...]

    11:08pm / Jan 22nd / 08 Facebook Comments_Wordpress plugin

    Hi, I submit my site to FB Notes with this address: http://blog.url.com/feed/ (url being my website, obviously) - and it import comments, but all say they are for post #0. Have I used the wrong URL for FB?

    Thanks!

    12:14pm / Feb 9th / 08 Tracey

    Yes, this seems to be a problem with some people’s setup. Its really hard for me to test and figure out why because it doesn’t do it for mine, and several others. I will keep thinking and working on this problem though.

    12:21pm / Feb 9th / 08 James Low

    Thanks! Much appreciated.

    1:02pm / Feb 9th / 08 Tracey

    Hi again,

    My issue appears to be ‘fixed’, so I thought I’d share some information with people who may have been having the same issue.

    I was using http://www.url.com/feed/ as my link in FB and my comments were being imported, but linked to the non-existent post #0.

    I tried again, this time using http://www.url.com/?feed=rss2 - and bingo! Works like a charm.

    Hopefully this can help some other people.

    Cheers,
    T.

    12:30pm / Feb 11th / 08 Tracey

    I haven’t checked, but it sounds to me the plugin might not be detecting that http://www.url.com/feed/ is that same as http://www.url.com/feed, with no back slash.

    8:37am / Feb 12th / 08 James Low

    Or maybe it has something to do with the GUIDs in the database. I’m a little confused now. I use http://www.url.com/feed/rss/

    8:49am / Feb 12th / 08 James Low

    Ok, I just changed my facebook to use http://www.url.com/feed/ and it still works, so it mst be something to do with the permalinks looking differnt in different feeds, glad yours is working now htough.

    9:09am / Feb 12th / 08 James Low

    Hi James,
    I installed version 0.22 of Facebook Comments onto Wordpress v2.3.3, and I can’t seem to get it to do anything.

    When I click “Import Comments Manually,” I get the message “Manually importing comments… ” and then nothing else happens.

    Do you have any suggestions?

    The feed I am importing into Facebook Notes is:
    http://www.bandergrove.com/?feed=rss2

    Thanks for all your hard work on this plugin!

    2:16pm / Feb 13th / 08 Pete

    Pete, not sure what happens, check that there are comments attached to post #0, that seems to be a reoccuring problem that happens.

    If its not that, send me a screenshot of the wordpress admin screen when its doing that.

    As i’ve said before, this is a bit of a hack, taken from someone else’s broken code, so it might take a while to figure out all the issues.

    5:41pm / Feb 13th / 08 James Low

    Thanks for the quick response! I really appreciate this.

    I have posted a screen capture here of what happens right after I click When I click “Import Comments Manually”:
    http://www.awsumpixx.com/DOC/misc/bandergrove_facebook_comments.jpg

    And the full Facebook Notes address I’m trying to import comments from is:
    http://ithaca.facebook.com/notes.php?id=13800780

    I’d love to hear any suggestions / advice you have.

    8:17am / Feb 14th / 08 Pete

    I forgot to mention — I don’t have a post #0 on my blog. I deleted it. The earliest post I have is #3. I don’t know if this has any effect.

    3:49am / Feb 15th / 08 Pete

    I’m not sure what happened, but this plugin magically started working today.

    I didn’t change anything on my wordpress blog (I haven’t even logged in / posted in a week and a half). But somehow the comments started coming through.

    Very odd, but I’m not complaining!

    10:55am / Mar 8th / 08 Pete

    So is there still no certain fix for the #0 thing? I’ve tried all the above and still no go… :(

    12:16pm / Mar 12th / 08 Corey Campbell

    really hard to test as it hasn’t done it to my blog and i can’t seem to make it do it, but i think its just happened to one of my friends, so i may be able to get access to debug.

    12:27pm / Mar 12th / 08 James Low

    Cool. I’d love to hear a solution for this.

    1:27pm / Mar 14th / 08 Corey Campbell

    hahaha, good news everyone, my blog is now doing the #0 post thing, so i can really dig into this and figure out what on earth is happening, and hopefully have a solution for everyone!!!!!

    11:05pm / Mar 14th / 08 James Low

    hey everyone, so i gather that this plugin can only be used to get your comments from your own individual facebook account, not from groups that you started. is that right? when i set it up and give it my name, password, etc., it keeps telling me that i have to authorize the plugin access before i can continue…even though i fill in all the info. suggestions?

    8:17am / Mar 16th / 08 Kelly

    0.23 New version!
    There’s a new version out, with a couple of changes. Firstly there’s a fix for comments appearing on Post #0. Firstly it won’t import the comments at all if that happens, so you shouldn’t get those appearing in your database. Secondly I’ve changed some of the code to better detect if post URL. Let me know if it works for you.

    Kelly, yep, only from individual accounts, RSS feeds that are setup to import that way. As far as i know, groups don’t support importing feeds via RSS.

    2:00pm / Mar 17th / 08 James Low

    So, it no longer imports comments with a post of #0, but I can’t figure out how to have it grab any of my facebook comments still. Error, original comment post not found… is what I always get. All my information is correctly entered into the fields. What could be resulting in this problem. My RSS feed is http://blogs.mkcproductions.com/webmastercorey/feed/

    8:01am / Mar 21st / 08 Corey Campbell

    I’m also having the same issue (”Error, original comment post not found…)

    But, i’m also having issues with Fotobook (which imports your photo albums from Facebook.)

    the only thing Facebook related, which works for me, is Wordbook.

    10:03pm / Mar 21st / 08 Steve Richardson

    This is the plugin that I’ve been looking for, it’s a great one! Are you in the process of making it compatible with Wordpress 2.5?

    5:21am / Apr 8th / 08 Puissance

    At some point I will upgrade my blog to 2.5, so I’ll be doing some testing for that, will keep you posted.

    1:35pm / Apr 8th / 08 James Low

    Did the Feedburner issue ever get figured out? Feedburner rewrites all the post permalinks for stats keeping so the plugin looks up these URLs and doesn’t find anything. I’ll probably go in and figure this out later, but I wanted to check first and see if someone had fixed it. It’d be nice to fix this in the main release as many people use Feedburner for their feeds. Thanks for your work on this.

    11:26am / Apr 12th / 08 Aaron Harp

    I’ll have a look at it sometime, probably won’t be for a while. I’ve got to upgrade a lot of blogs I maintain to wordress 2.5 first.

    If you figure out something that works first though let me know, and I’ll include it in the official version of the plugin.

    11:34am / Apr 12th / 08 James Low

    James…here is a link to an update that resolves Feedburner URLs: http://www.aaronharp.com/wp-content/uploads/2008/04/facebook-comments.zip

    3:15pm / Apr 12th / 08 Aaron Harp

    A great idea for a plugin — is there anything I’m supposed to do to modify the plugin so it’ll work? I’ve set up my FB to receive my WP posts and I’ve got comments over at FB that I’d love to have appear on my WP post… but I’ve installed the plugin and the posts aren’t showing up.
    Any help would be appreciated - thanks!

    10:18pm / Apr 14th / 08 Dianab

    Hi Aaron, thanks for doing that fix to make it work with feedburner. Its now in the main repository as version 0.25

    3:50pm / Apr 24th / 08 James Low

    Hi James, I’ve installed it on my wordpress 2.5, but its not working. The plugin page says its compatible up to 2.3, so, should I wait for your magic?

    9:31am / Apr 28th / 08 Cliff

    I’m getting an “original comment post not found” error when I try and get comments from Facebook.

    8:46am / Apr 29th / 08 David Hildreth

    Yep, that problem still occurs for some people. I’ll keep trying to figure out why.

    9:22am / May 3rd / 08 James Low

    I really appreciate the work you guys are doing. I had a look at the source there, and there’s enough regexes in there, I’m surprised even PHP can understand them.

    I’m getting the “Error, original comment post not found…” error, and it’s driving me nuts. But there’s no way I’m going to hack around with that. It’s crazy. :-P

    4:53pm / May 3rd / 08 Ash

    yep, those were inherited from the orginal plugin that I edited when it stopped working, and no one else updated it. when they go wrong they can be a pain to figure out.

    can’t wait till I finally crack where that error is coming from, or maybe if i’m lucky some else will do before me :-P

    11:21pm / May 3rd / 08 James Low

    James, I’m running wp 2.5, and the plugin does not seem to be working. Any tips? Or, plans to make it compatible? Thank you!

    8:51pm / May 23rd / 08 John

    Hi!
    I’m using WP 2.5, which I just realized you might not support yet, but my bug is still salient.
    ALL my FB comments, NOT just on my imported posts, are being imported into the comments DB.
    The part that might be WP 2.5-related is that its importing them all into post #1 (Hello World), but I’m not sure. I’m definitely a little complicated, I’m using a custom URL on WP (does that affect things?) and feedburner from there, to go to FB. Maybe that’s what is causing it problems with importing to the correct blog # and so it just defaults to 1 everytime?

    8:34am / May 29th / 08 Ajay

    [...] a mi blog, centra lizando así la información en este sitio.  El plugin que hace esto es el Facebook Comments para Wordpress. (No Ratings Yet)  Loading [...]

    Hey everyone, my blog is now at the latest version of Wordpress, so I’ll be testing Facebook comments with that.

    I have noticed that it is no longer importing comments at all for me, though this was caused by changes to the facebook HTML not upgrading my wordpress. Will let you know when its fixed.

    12:20pm / Jun 23rd / 08 James Low

    Stopped working for me also. WP 2.5.1.

    3:09pm / Jun 23rd / 08 Keith Mander

    Ok, new version, works fo me, but its a mission to keep up with wordpress.

    12:12pm / Jul 3rd / 08 James Low

    I meant a mission to keep up with facbeook.

    Wordpress is normally ok, but with 2.5+ I’ve realised they’ve changed what the GUID means in the database, so it won’t always be the permalink, so I need to come up with another way to compare.

    1:01pm / Jul 3rd / 08 James Low

    Ok new version 0.27

    1:34pm / Jul 3rd / 08 James Low

    James - running wp 2.5 latest and 0.27.This is the error I’m getting:

    Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in [EDITEDOUT/public_html/wp-content/plugins/facebooknotes.php on line 252]

    2:14pm / Jul 3rd / 08 smi

    Has this ever worked for you, or are you a first time you’ve tried? There was nothing changed with that part of the script, so I’m guessing this is the first time you tried to use it.

    Its something to do with your curl setup on your server, though I’m not sure specifically whats wrong.

    Ok everyone, I was in a good mood, so I’ve edited things again, and there’s now version 0.28 which will go through ever page of facebook notes, not just the first one.

    5:43pm / Jul 3rd / 08 James Low

    First time - tried again with 0.28. Same problem, plus “cannot find original post”, etc. Thanks though.

    9:26pm / Jul 3rd / 08 smi

    Facebook Comments…

    Facebook comments is a Wordpress plugin that will import comments from your facebook notes back into your wordpress blog….

    11:59pm / Jul 3rd / 08 Leonaut.com

    Hey dude, just wanted to say thanks so much for updating your plugin. The latest updates have done the trick and it’s now fully compatible with the latest WP 2.5.1 engine (at least, as far as I can tell!)

    Btw, I couldn’t help but notice on your blog that a) you’re from Hong Kong, and b) you’re a Christian. So am I, and I figured the English-speaking Christian community in HK can’t be all that huge.

    Well anyhow, Facebook tells me we have mutual friends. I take it you go to The Vine? I’ve been there myself quite a few times, but when I’m in town I usually go to ECC.

    9:26am / Jul 7th / 08 B.J.

    Does this work in 2.6? I’m having troubles getting the comments to import at all! (Er, namely, they don’t, but don’t give me an error message?)

    7:42am / Jul 28th / 08 sarah

    Hi, I haven’t tested it on 2.6 yet, but I don’t see why it should’t. I’ll upgrade my blog sometime and let you know.

    8:05am / Jul 28th / 08 James Low

    I just ran it on 2.6 and it works fine, so there’s something else going wrong. Can you send me a screenshot of what happens when you click manually import comments?

    12:47am / Jul 30th / 08 James Low

    hey i am using the facebook comment and was wondering whats the code so i can put it in the side bar?? the code? LOL!

    2:07am / Aug 19th / 08 Sheena

    Um, what exactly do you wan to put in your sidebar? What facebook comments does is import comments on notes from facebook to regular comments in wordpress.

    7:54am / Aug 19th / 08 James Low

    Very nice plugin.

    I have been looking for a way to intergrate my facebook comments, thanks!

    11:37am / Aug 27th / 08 Abe