2009
09.25

Plugins

Facebook CommentsTNG:Screen shot 2009-10-02 at 11.48.58 PM

Facebook CommentsTNG is a plugin for your WordPress blog that will spider your notes page and find imported WordPress blogs and bring the comments back into WordPress. This is a complete rewrite from the original but I did borrow some ideas from it. Kudos to the original authors for their initial effort and for their plugin giving me the motivation to write this one!

Features:

  • Will recursively scan through all notes and bring in comments
  • Test mode to see what would be imported without risking the database
  • Uses simple html dom which means it’ll be easier to fix if Facebook changes
  • Limit option to limit how far it goes back
  • Timed automatic scanning
  • Set what note you want it to start on
  • E-mail field for setting a custom e-mail, The default is facebook at philtopia dot com which has a Gravatar set up with a Facebook picture
  • Plugin can crawl your notes despite language set
  • Plugin can get accurate post time from Facebook
  • Auto approval of comments (make sure the plugin works for you before you turn this on)
  • Option to link to generic facebook.com or directly to the profile of the commenter
  • Now supports Facebook Pages!

Screen shot 2009-10-02 at 11.50.59 PMIssues:

  • Parse error: syntax error, unexpected T_OBJECT_OPERATOR happens when you use PHP 4. You need PHP 5
  • Still seem to have issues with the UTF8 … character in a Post title

Working on for next version:

  • Ideas welcome

Download: Facebook CommentsTNG


Development takes time and every bit helps!

390 comments so far

Add Your Comment
  1. Hey Phil – great plugin – would be willing to donate a couple if you could help get past this curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set error. It was working fine for a while then BOOM, error and no imports.

  2. Just to add, I can’t turn off safe_mode, I’ve tried the following in a .htaccess

    Action php-script /interpreters/php-script
    AddHandler php-script .php AddHandler php-script .php3

    to run the php scripts in CGI mode, but that didn’t work either.

  3. http://www.edmondscommerce.co.uk/curl/php-curl-curlopt_followlocation-and-open_basedir-or-safe-mode/

    Here is a site that has a workaround. I am editing your code to fit this in, if I get a working copy before you do, I’ll release the fix.

  4. I had no use for this plugin because it didn’t support pages…now it does, so I was stoked!

    Unfortunately, I’ve since moved to using RSS Graffiti instead of the built-in FB Notes import method, which is clumsy, IMHO.

    I know you can’t possibly develop to each and every FB app that pulls in RSS feeds, but maybe you could for the major ones? Or maybe just scan all posts instead of just notes? I would LOVE to have comments from FB appear on my blog, but not enough to give up RSS Graffiti. :)

  5. First off, Love this plugin so thanks a bunch!

    Secondly, found a tiny (but rare) bug.

    If someone comments on your post and the plugin pulls it in… then they change their name, the plugin pulls it in again with the new name. Perhaps it should use the profile ID to differentiate rather than the name? Just a guess that that’s what’s going on.

    Thanks again!

  6. ohhh and if you need to see an example:

    http://randyandrachel.com/2010/05/31/falling-brook-moving-in/

    See ‘Emily Riley’ & ‘Emily Behnke’

  7. After an hour of fighting the CURL_FOLLOWLOCATION issue, I’m about ready to give up – the Location: headers that Facebook gives back to cURL just don’t seem to be the same as the ones it gives Firefox, even with the same UserAgent string.

    Using cURL, looking up http://m.facebook.com/notes.php gives “Location: /?r9e4ed6c8&refid=21″ in the response (the hex changes every time). However, I can’t find a way of combining that string into a URL that when cURLed results in a proper notes page. I’ve seen blank pages, login pages and infinite loops, but not the notes page that Firefox can clearly see! When I try looking at the headers in Firefox, I just get 200 OK for http://m.facebook.com/notes.php, so I’m not sure what’s going on there.

    Anyone got any ideas? I’ll admit I’m a bit new to cURL and all its intricacies.

  8. I would like to check if this plugin is working, as whenever I do a test run, nothing comes out of the box, even though login credentials are correct.

    I’m running WP3.0.

    Thank you.

  9. I just tested mine and I also have WP 3.0 and it does still work. Some people have reported that facebook blocked the plugin because they replied to a message about an unknown client connecting to their account. Also make sure you are using vanilla blog importing and not any other method of importing your WP blog into facebook.

  10. Hi Phil,

    Just to clarify, when I installed the plugin, I keyed in my FB username and password on the plugin config page, and the Page ID is the Page where I’m importing the WordPress blog, right?

    When I clicked on Test, a small window within the same page is just blank. When I clicked on Manual Update, it says completed but nothing happens. Does the plugin fetch past comments too?

    On another blog, which I use to test plugins ,and has no other plugins installed, it does connect to my facebook account, but not fetching anything.

    Please advise, I might be doing something wrong here. Thank you!

  11. I’m using the original FB Notes, where I import the feed from my WordPress blog.

    Thanks

  12. This is a great plugin, but we should really have the option to hide commenters’ last names. I’m looking at my analytics and seeing people being linked to my page after searching google for some of my girlfriends’ names, because this plugin shows the full name of facebook commenters. These people didn’t intentionally put their full name on my website, and I don’t want weirdos visiting my site to find out information about some girl. I feel responsible.
    Can we get a feature to hide the last name, or perhaps just show the last initial?

  13. Hmmm, when I click “Test”, a lot of posts show up, but when I run the manual update, no comments get added to my blog. Any ideas?

  14. [...] out the author’s page for the plugin: Facebook CommentsTNG. Possibly related postsFacebook [...]

  15. Is there hope for importing a person’s facebook picture with their comment?

  16. No, that’s going a Tad far regarding privacy as is I’m already looking into limiting the name it displays (as an option) as per someone else’s post

  17. Hi Phil! GREAT Plugin!

    I have a request for the future! I have “Link to authors profile” set to NO, but in my comments it still outputs a link – to the front page of Facebook. I don’t find that useful – could it be an option in the future to have no link at all? I know I could solve it on my own, by eliminating links for all comments, but I want to preserve links for anyone who comments directly on my blog, and has a website to promote. Does that sound possible?

    I also have a helpful hint for anyone adding this to a Fan Page, rather than their regular profile – if you’re using a custom URL, and don’t know what your Page ID is – just go to your Fan Page, and click on the profile photo and then look in the URL bar – your Page ID is at the very end of the URL.

    Once again, thanks for this plugin – it’s really cool!

  18. First of all, great plugin!

    I’m also encountering the cURL FOLLOWLOCATION issue. Not sure what I can do about it as I’m completely new to cURL. Any ideas?

  19. RSS Grafitti support would be genius!!

  20. Naw, that’s alright

  21. I’m not a programmer but any chance Facebook Connect functionality will allow the plugin uninterpreted access to Facebook? Between the previous bug that Facebook took forever to fix and now some other unknown hangup (maybe Facebook, maybe WP 3.01), it seems Facebook is always fighting with you. This plug has been very useful and hope to keep using it.

    Thanks for this, Phil.

  22. I believe there is a facebook connect plugin that does all sorts of facebook things already> I don’t like the idea of having to explain the whole generating an app key business so that is not what I will be doing and other than when it didn’t work in March mine has always worked uncontested. Even now.

  23. ah those sneaky buggers i see what you mean now, I made a minor change and it is working again, I almost have all the features i wanted for .20 ready (first name only, Name change causing Duplicate fix, No url fix) so expect an update soon

  24. Hey Phil! You’ve made THE plugin I was searching for a long time!
    But it doesn’t work with my WordPress blog: version 3.0.1. I thought it was possible when reading the comments above…
    I cannot activate it; I receive this message:

    “Plugin cannot be activated because it caused a fatal error.
    Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /********/wp-content/plugins/facebook-commentstng/fbntng.php on line 155″

    Thanks for your help! I really need your plugin!!!

  25. Sounds like you have PHP 4, PHP 4 does not have the required features for this to work

  26. Haven’t had any new notes file in the past few days. There are no error messages. It seems like it should be working, but it’s just not recognizing any new comments. Thoughts? http://whereinde.com
    http://www.facebook.com/whereinde

  27. Upgrade to 0.20

  28. Hey Phil,

    First, I want to thank you because I was lokking for a Facebook fan page comment grabber since a long time, and yours work very well !

    I want to know if it’s possible to have the facebook avatar picture, instead of a generix facebook gravatar. Maybe it’s to complicated ? Thanks a lot,

    Anthony / Paris

  29. Thanks Phil. I guess I shoulda checked the obvious first.

  30. Great job Phil!

    I love it and it works well. Do you intend to support sending comments in the other direction as well (from the blog to Facebook)? It would be great if they were in sync…

    Thanks!

    Fabrice

  31. I keep getting this error btw:
    Fatal error: Out of memory (allocated 32243712) (tried to allocate 14539 bytes) in /homepages/8/d120270329/htdocs/wp-content/plugins/facebook-commentstng/fbntng.php on line 219

    Any ideas?

    Thanks!

  32. Get this error – don’t know why. Any suggestions? Fatal error: Call to undefined function curl_init() in /home/nosta/public_html/blog/wp-content/plugins/facebook-commentstng/fbntng.php on line 52

  33. Have you tried limiting your crawl?

    I limit mine to the last 10 posts

  34. Yes, I tried that.

  35. I’ve been having a problem that just recently started. Someone left me a comment with a “<3" in the begining which Facebook turned into a "♥" which is now being imported as a "?"

    The real problem is that the comment is getting imported every time the plugin checks for new comments. I think it has something to do with the weird character in the beginning because it's only that one comment that is having the issue. It started happening 2 versions ago but I've sorta been ignoring the problem and hoping it would go away. If I get the time I'll look into fixing this myself.

    Thanks,
    Brooke

  36. yea that sucks

  37. It would be great id it worked, but on the “test” I get this, “…CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in…”, and I know PHP is not in safe_mode. Must be something to do with open_basedir, but I’m not sure the adjustments I should make to correct this.

    Anyone have a suggestion?
    It looks as though I may not be the only person experiencing this error.

    -B

  38. Hi, it looks to be a great plugin, but I have installed it on my site hogar-verde.com but it doesn´t “capture” the FB comments back. Do you what is wrong? Thanks!

  39. bcarter- Are you running PHP in safe mode? If so this plugin will not work for you please turn safe mode off and try again.

    Cesar- please provide more infomation of “it dosen’t ‘capture’” What does it do? What happens when you run test?

  40. Hi BandonRandon!!! in a few words, It can´t it import the comments from FB, if i reply a comment in my post this will appear in FB, but if someone put a comment in my FB this doesnt appear in my blog.. I ran the test but the screen return a blank screen! could you help me about this! thanks!