2 Jun
One of the main issues that some people have been having with the FriendFeed Comments Plugin is that sometimes, seemingly randomly, it will fail to match up a post with the information from FriendFeed. There are a couple of reasons why this does happen, but the problems all centre around the fact that I have to use the post title to match up the details because there’s no other uniquely identifiable piece of information available.
This is of course a problem when people edit the title, either due to a typo or a editorial change. Also there seems to be some string encoding issues, especially around the 32,000 different characters that can render to look like an apostrophe. I’ve spent quite a lot of time trying to strip out the special characters and normalise the titles so I can be sure of getting a match between what’s on the blog & what’s coming back from the FriendFeed API. I even tried just stripping out non-alphanumeric characters, but then I had a complaint from an amazingly patient person who’s site was using Cyrillic. So what I’ve got now is a rather hodgepodge solution where it tries to strip out as many characters as possible, then does an md5 hash on that to use as the id, and some people are still having issues where, for no apparent reason, the posts won’t match up.
However the night before last as I was going to bed I realised something. Why am going to so much trouble here? I can keep the matching system I’ve got now, but rather than spend hours trying to find a solution that will work for everyone (I don’t really think there is one, especially for when people edit the title) I could just leave it up to the users themselves to fix the occasional missed post. So, there is now a new section on the WordPress post editing page. After you’ve published a post (and it’s been picked up by FriendFeed) you can now go the the post edit page and select the correct FriendFeed item from a list. Normally the correct title should already be selected in the list, but if it’s not you can update it to the right one. If the right title isn’t in the list & you know it’s already on FriendFeed, click the ‘Refresh list’ link and it will reload the page and force an update from FriendFeed (normally it only updates every hour).
The actual id is stored as a custom field on the post, so it’s visible in the Custom Fields section. It’s not going to mean much though because it’s not the id of the FriendFeed post, it’s the md5 hashed string of the post’s title. Don’t delete this.
So once again the solution to a problem isn’t throwing more technology at it, but to think differently about it. Sure, it would be much simpler if the GUID field from the RSS feed was passed through the FriendFeed API, but it’s not. And this is, I think, guaranteed to work every time. The new version of the plugin is available now (version 1.5.7) either from here or from the auto-update tool in your WordPress admin.
P.S. I’d like to thank the person who dropped a donation into PayPal for this plugin. That was much appreciated!
Add New Comment
Viewing 4 Comments
Thanks. Your comment is awaiting approval by a moderator.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Loading FriendFeed Data
Fatal error: Call to undefined method wpdb::update() in /home/.../wp-content/plugins/friendfeed-comments/friendfeed-comments.php on line 377
If I go to the edit page of a single post, under the 'FriendFeed Comments post', the pulldown menu lists all the posts for my blog. Choosing the right title and clicking save gives the following error:
Fatal error: Call to undefined method wpdb::update() in /home/.../wp-content/plugins/friendfeed-comments/friendfeed-comments.php on line 418
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Add New Comment
Trackbacks