2009
09.25
09.25
Facebook CommentsTNG:
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!
Issues:
- 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!
That setting if you use the default which is facebook@philtopia.com will use a gravatar I set up with a fancy facebook icon for the comments otherwise you can set up any gravatar you want and put that e-mail address in
KingPhil, thanks alot for your Feedback, I appreciate it ver much!
Alright, I will for sure let the Facebook icon there, I thought it was from Facebook itself… cool solution!
Fooling around with the plugin, I noticed, that the automatic Import doesn´t seem to work properly. Yesterday I imported all the Facbook comments manually, which worked for me just fine. So I set the “Automatic Crawl” to hourly and, today, I really wanted to know if it will do so. I Posted a new Article to my Blog which showed up on Facebook, using the “Simplaris Blogcast” Module on Facebook. I did throw in an example comment and so I am waiting for the plugin to update… until now, two hours later, nothing happend.
Is there any problem which you know with this settup?
I will wait some more time and then try to update manually again… let´s see.
Again, thanks for sharing the code!
Hello KingPhil…
Waiting until today, the plugin did not crawl the comments so I tried to import manually, what worked a couple of day ago. To my surprise, the plugin did not import any of the new comments…
Klicking the “Test” button really doesn´t show any of the new comments and… it doesnt show the last two blog articels, which are displayed in facebook! It is, as it would skip the last two entries. Is this a problem regarding Simplaris Blogcast?
Does the plugin create any error log, if the import of comments fails?
I will test the Blogimport to Facebook with another RSS-Feeder and I will report back, if the entries are recognized by Facebook CommentsTNG, which would nail down a flaw with Simplaris.
I just realizes that this Plugin just imports comments made on notes. Is it possible to make it also import comments from my feed??? I just ping.fm to post my status updates to twitter facebook and wordpress. Would be great if i could import facebook (and twitter) replys to wordpress.
if you wish to write a plugin to do that it may be possible
I hoped you might wanted to implement this as well. I have no idea how to code php. Guess i just have to wait a little more.
thx a lot for your quick reply
thank for this plug-in…
but i have notofication from my hosting service, what the meaning of this?
“Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 75 bytes) in /home/frijalc/public_html/wp-content/plugins/facebook-commentstng/simple_html_dom.php on line 878″
Thanks for helping me…
Kibot, this means that you went over your memory limit (the hosting company gives you a certain amount of memory to be used apparently yours is around 67mb) while trying to import your notes. You have a few options 1] ask your host to give you a larger limit (often times they will do this either temporarily or permanently if you ask) 2] see where the plugin left off and only import the notes from that point on. For example, if it’s already imported your first 50 notes start the import at 51. As a side-note, i would recommend not posting the complete url which contains your username. This is just a small security risk.
Phil, I also had this issue, I think it’s something we should look at fixing in a future release, is there a way to clear the cache or only curl so much information at once? I believe that the error is happening on the last line of simple_html which is normal for this type of error. Let me know if I’m wrong and if you have any ideas or thoughts. In your words “looks like we exploded something”
Brooke
Using this plugin and it works very well. Could be better if it pulls comments from Facebook Pages notes aswell?
Immensely good idea for a plugin! :-]
Does it work with multiple blog authors and Wordbook plugin also?
Once I’ve downloaded and activated it in WP then what? thx
Thank you so much for this. I have been using it for a few days now. It sometimes only imports SOME of the comments on each note (maxing out at 15) but this is such an improvemnet over nothing at all. Thanks again
@archiworks, No, the current version dose not work with notes inside of a page. At current/to my knowledge there are no plans to make this work with Page notes. Feel free to modify this plugin to do that.
@Erick, I have not tested the plugin in a multiblog environment or with Wordbook. Feel free to test it yourself and report any errors.
@Scott, Go to Settings > Facebook Comments TNG enter your facebook details and then hit run. For more help see the WordPress Plugin Page or the README file. (http://wordpress.org/extend/plugins/facebook-commentstng/installation/)
@Jamie, how many comments are showing up per page? I suppose I’m asking before the “read more” link appears? I don’t think I’ve had more than 15 comments on a Note. I may have to look into this as it appears to be a bug.
I also have never had that many comments which is probably why it doesn’t work!
@kingphil, I may run some test and look for a solution. I think (this is pure speculation) that what is happening is that after 15 comments it shows a “more” link. We’ll need to somehow tell the plugin to click that link on those notes and then get the rest of the comments. Any ideas?
If I get a code sample of a page with the “next” link i can write in a recursion similar to the one that looks for word press notes
oh, thank you for looking into this. It has only happened a few times; a sort of conversation happened in the comments thread of my FB notes and in each of those cases the comments went above 20. And each time the imported comments (back to the bLOG) stopped at the 15th.
You are probably right that it is when there are more than 15 there is a SEE ALL COMMENTS link that appears and may explain why any extra above that are not spidered. I am sorry that I am not at all technically savvy about this sort of thing.
Thanks again for making this plugin. In recent years the actual comment traffic on my blog has dropped off in direct proportion to how many of my old blog viewing public are now seeing it on FB, so it is wonderful to have those comments also appear on the blog itself.
Thanks for this plugin, it works fine !! Great job !
But the automatic scanning doesn´t seem to work. The manual import is Ok.
I try to import the notes and all I get is that
Starting manual pull please be patient this may take time…
Completed, check the comments tab for any pending comments
I check on the comments or in the posts, I dont see anything new
Any thoughts?
Can I second this?
“I just realizes that this Plugin just imports comments made on notes. Is it possible to make it also import comments from my feed??? I just ping.fm to post my status updates to twitter facebook and wordpress. Would be great if i could import facebook (and twitter) replys to wordpress.”
Would be really cool if someone who knows what they are doing could do this!
Dear Phil,
First of all, awsome plugin, really connects my blog with my facebook.
I use the Facebook Comments TNG, but lately I have been getting the same error:
CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /home/web78259/domains/momeni.se/public_html/blogg/wp/wp-content/plugins/facebook-commentstng/fbntng.php on line 19
How do I fix this?
@Zig, I’ll look into this, any further information would be great.
@Michael, check your username and password, also are you sure you have comments in Facebook to import? I would like to add a comment count to let the user know how many (if any) comments were imported.
@Ehsan, If you feel comfortable editing your source code you I believe the fix can be found
here: http://www.brurls.com/k4zqs. We should be able to integrate this into the next release of the script so if you’d like you can wait till then. To my knowledge this is just a warning so you should be able to (although not recommended) suppress php warnings and so you wont see this.
Thanks, for you help. But it was way above my editing knowleage!
Ehsan,
Do you know if you’re running PHP in safemode? If so, turn off (or ask your host) to turn off safemode and see what happens.
Hi everybody. Read all previsious comments, but still have a problem.
Plugin – great job! – seems to work because I successfully imported 3 comments. However through test button I get a list of notes, but not a complete one. So some notes are missing. Any suggestions?
I apparently have too many large posts because I keep running out of memory every time I run the script. I see the option to “Start Crawl at Note” but I do not want to have to manually change this. I also see the option for “Limit how many posts the plugin will parse.”
My guess is that this will start at post 1, the first post (because of the first setting I mentioned) and read the next x posts (the second setting I mentioned). Is this the case? I would prefer to only crawl the most recent 25 posts instead of starting at the beginning.
Or am I just reading this wrong? It is not the clearest explanation.
By the way, from a fellow programmer, great job on this one! It works like a champ and the configuration is (mostly) straight forward (except for the mentioned item above). Keep up the good work, I hope to see development continue on this project.
minor correction in the above post:
s/change this/change this every time I add a few blogs
hi,
i’ve got the same problems of other people…
i set an hourly scanning of my facebook account but the plugin don’t import anything…
Manually it works fine
i set hourly import, auto approve comments, limits notes at 5 and start from note 1
can somebody help me?
When i used the plugin in my local site, it works fine… somebody can help me?
thanks
My site is http://www.egioiasia.com
I have a similar problem. When I try to import my comments manually, i get this error:
Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /srv/www/web111/html/wordpress/wp-content/plugins/facebook-commentstng/fbntng.php on line 19
Warning: curl_setopt() [function.curl-setopt]: Unable to access cookiefile.txt in /srv/www/web111/html/wordpress/wp-content/plugins/facebook-commentstng/fbntng.php on line 21
Warning: curl_setopt() [function.curl-setopt]: Unable to access cookiefile.txt in /srv/www/web111/html/wordpress/wp-content/plugins/facebook-commentstng/fbntng.php on line 22
Then, no comments appear in the comments tab. The box that says “Completed, check the comments tab for any pending comments” is there, however. safe_mode should be off.
Probably, someone has an idea or I have to wait until the next release to fix the curl problem.
I can’t fix safe mode. Fortunately one day your service provider will be forced to stop using safe mode as future php releases won’t support it. When that day arrives the plugin will work as expected for you.
You’re my hero, mate! I’ve been importing my blog feed as Facebook notes for a year, and looking for a working plugin to bring the comments back to my blog for months. If you like horror books, drop me a line; I got something for ya!
Hello,
In the 0.17 version I got the following error:
CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /home/web78259/domains/momeni.se/public_html/blogg/wp/wp-content/plugins/facebook-commentstng/fbntng.php on line 19
In the new 0.18 version I now get this error:
Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /home/web78259/domains/momeni.se/public_html/blogg/wp/wp-content/plugins/facebook-commentstng/fbntng.php on line 42
Why??
Because your host uses safe mode which is interfering with what the plugin does.
I was able to get safe mode off after I talked to my Host. Now, the Plugin parses the comments, which is great. However, not all comments are imported for some reasons, but it’s definetly a nice thing, thanks a lot!
Are some of your posts titled with other language characters? That can piss off the plugin. I’ve been hoping some unicode master would come along and fix it for me by now because I haven’t been able too…
If it is some other reason a bit more detail would be great and I can look into it and if i can repo it then I can work on it
I can’t seem to get this working at all. I’m not getting any error messaging, but it doesn’t seem to be pulling comments either. When I run the Test, it leads to a blank square in the page and when I try a manual pull, it doesn’t lead to any new comments. I have over 2500 notes in Facebook, so maybe it’s too big, but I’ve tried starting at note 1 and note 2500 and it doesn’t grab anything, but again, there’s no error — it seems to think it’s working.
Does it use the RSS at all, and if it does, does that create any Feedburner or FeedSmith plugin conflicts?
Any help would be great as the number of comments I get on Facebook outnumbers comments on my blog like 10 to 1.
There is no rss feed it loads the site and reads it and parses it. Now your 2500 notes are also on wordpress? or at least some of them are? It will only show them if they are on both. However 2500 is a big number it is possible there is an issue there. Limit it to 10 or 20 notes and see if it does anything, 2500 would take a very long time to scan. The 33 I have takes about 30seconds to scan so 2500 would probably be well past the PHP timeout which there isn’t anything I can do about that so set the limit lower and see what happens.
It doesn’t timeout, though. And I’ve tried it with only five and ten notes. Still doesn’t pull anything.
Here’s an image: http://drop.io/facebooktng
go to plugins > editior > select Facebook CommentsTNG > the first line after the description section is $tng_debug = 0; set it to $tng_debug = 1;
Update the file
Do a test
If you get Not note:
then the note titles on facebook do not match the wp database titles
if you get nothing at all then the only conclusion is that these are not standard facebook notes, some wp plugin or facebook app is changing them in some manner.
If however something else happens let me know and we’ll see what we can figure out
Hey ich bekomme auch einen Fehler mit dem Plugin:
Fatal error: Call to undefined function curl_init() in /********/html/wp-content/plugins/facebook-commentstng/fbntng.php on line 39
Hey I get also a Error with that Plugin:
Fatal error: Call to undefined function curl_init() in /********/html/wp-content/plugins/facebook-commentstng/fbntng.php on line 39
Same, and I installed it today
Fatal error: Call to undefined function curl_init() in /home/***/public_html/blog/wp-content/plugins/facebook-commentstng/fbntng.php on line 39
Guess something went wrong
yes it means neither of your web servers have curl bundled with php. Unfortunately the plugin relies on curl
So I have to activate “curl” ?
Ok thanks, installed curl and it works great! Good Job!
Excellent
Hi Phil. First of all many thanks for the time you’re putting into supporting this plugin. It’s appreciated!
I seem to be having the same problem as Tyler above. I tried setting the debug to ’1′ and I still get a blank box when doing a test or manual fetch. Do you have an idea what could be causing this?
Cheers,
Tim
[...] Facebook Comments TNG A new and re written Facebook notes comments grabber. Version 0.18 | By Phil Spencer [...]
Tim, do you have 5 blog posts (notes) or less? If yes, then we have the same problem.
Phil,
Looking at the code, it seems to me that counting posts only works if there are more than 5 notes. I only have 2 notes so $posts was always empty when I ran the script. Everything is fine now that I added a bit that checks the post count if there are 5 notes or less:
[code]
else if ($pos = strpos($element->innertext," notes.")){
$posts = substr($element->innertext, $pos - 1, 1);
}
[/code]
That’s just inserted at line 76, the part where you count the posts.
There seems to be a problem with posts with “umlauts” (ä, ö at least) or some special characters (€ for example) on titles.
I wondered why the plug-in improted some comments but not some others. Now I realized that the above-mentioned titles (with umlauts or € signs) are missing on the test run list.
Is there something you can do about that?