X
    Categories: WordPress

From WordPress to Facebook and back

When you start a new blog you have no visitors so you need to reach out to them. And these days most of your audience can be easily reached on Facebook as your social graph is bound to be stored there these days. I have been facing the issue of making it easy for people to interact with a site without ending up doing it exclusively on Facebook in a few projects so with this new blog I wanted to look for a full solution.

The easy way would be to use the Facebook Comments plugin. Facebook will give you a zero-code solution with interactivity back and forth from your site to Facebook (comments on your site can appear on Facebook and vice-versa) as well as a full administration panel. For that you give away full control over your visitors’ comments, get to be stuck with Facebook’s visualization and color scheme and are chained forever in using Facebook authentication only (I don’t see them offering a Twitter option any time soon).

So I went for the hard(er) way. The problem consists of two parts:

  1. Need to make it for people to login on the site and share their comment on Facebook
  2. Need to have posts automatically published on Facebook
  3. Comments that are made on Facebook should be imported on WordPress

Posting comments and sharing on Facebook with

The first part was achieved with Facebook Connect by Adam Hupp. It’s a pretty straightforward plugin, with little work needed to integrate with the site (mainly adding a PHP code widget to call the fbc_display_login_button function and slight editing in the comments.php to remove the link to login form and replace it with another call to show the connect button). The plugin includes the option for users to post about their comment on Facebook.

The second part involves the use of the Notes application on Facebook. Facebook offer a handy feature of importing an RSS feed to be used a source for your Notes. The hardest part is finding the page that controls the feature, so here is a link to it. Just grabbing the RSS URL that WordPress creates and pasting into the Facebook form and you are done (Update: This doesn’t work well, see Note #2 below)

The third part is a bit tricky. Normally, Facebook doesn’t like sharing the data you have posted on it, so there is no direct way to get the comments of a Note (correction: getting comments of a Note can be made through the Facebook Graph API). Plugin Facebook Comments TNG by Phil Spencer comes to the rescue. It will spider the note page for comments, match them to your posts and insert them in WordPress. Crawling can even be automated you setup it and forget it. There are some limitations (avatars not imported and at least one occasion the time was imported as 1970) but I really can live with them.

Comments coming in from Facebook

All in all, in the first test, this looks to be working! Reality will teach us otherwise and I will be updating accordingly ;)

// Update #1: Apparently Facebook has a signifigant lag in parsing updates from the RSS feed into Notes…
// Update #2: The Facebook import part wasn’t working very much so the above setup has been changed. More at The WordPress vs Facebook Game: Round II
// Update #3: I had forgotten the RSS import setting on Facebook and it run after a week. Definitely not best choice…

Markos Giannopoulos: