By Steve | January 2, 2010 - 5:49 pm - Posted in Computing, Wordbooker

I’d been using the Wordbook app for quite a bit but I’d always found that it lacked some features that I liked. I’ve now added these functions and got it doing things how I’d like.

So rather than keep cluttering up the original wordbook application page I’ve forked by code off totally.

I created a new Facebook application called Wordbooker and then created a new plugin called Wordbooker in the Wordpress Extensions site.

Upgrading from the Forked Version.

As this is basically a new application its a bit messy as doing a normal removal of the old forked version will remove any record of posts/comments made with the forked version.

If you wish to retain that history then you need to back up the existing wordbook_postcomments table BEFORE you remove the forked version of wordbook.

Go into the options page for Wordbook and reset the configuration for wordbook

From the plugins page de-activate the wordbook plugin.

Delete the wordbook directory from wp-content/plugins

Upload the wordbooker directory into the wp-content/plugins directory

Go into the Plugins page and enable Wordbooker.

Go to the options page for Wordbooker and  it will ask you to get a login key from Facebook and then ask you to grant two extra permissions needed by Wordbooker – these allow Wordbooker to publish to your wall and also to fetch comments from it.

Click on the Save Configuration button.

You can then set up the various options on the option screen:

Wordbooker Options page

Wordbooker Options page

** Multiple Facebook account / WordPress account support **

If you as the blog owner only want it so that WP posts go to your FB account then go into the Options screen and set the default account to be yours, and that should be it, any person using a different WP account to post to your blog will publish those stories to your FB account.

But what if you’ve got a Family WB where different people would like to post to WP and to their OWN FB accounts. Simply get each of them to login to WP as themselves and configure WB as if they were the only user. Then when all of them have done this go back in as yourself and set the Default account to be you.

On the Edit Post page there is a WordBook Options block which includes a drop down list of the blog you wish to post to, if you want to post to your default blog then you don’t need to touch this but if someone wants to post that post to their FB account all they need to do is pick their name from the drop down list before they post.

** Length of Extract **
This allows you to change the length of the extract posted to Facebook. The minimum value is 200 and the maximum is 400 (at the moment) with the default being 256 characters. The extract will be trimmed to the nearest full word BELOW this value.

** Default Publish Post to Facebook **

This allows you to choose if posts should automatically be posted to Facebook. This option can be overridden from the Edit Post page

** Post Attribute **

This allows you to change the attribute line when posts are sent to Facebook. By default this is set to “Posted a new post on their blog”. This option can be overridden from the Edit Post page.

** Republish Post if edited more than x days ago **

This allows you to control how long it should be before Wordbook considers an edited post to be a “new” post and re-publishes it to Facebook.

** Override Re-Publication window  **

This allows to to force all edits to be reposted to Facebook ignoring the republish window. This option can be overridden from the Edit Post page.

** Update Facebook Status **
If this option is checked then the title of your blog post and its permalink will be posted to your status, along with the text specified here. This can be overridden from the Edit Post page. NOTE: If this option is Selected then your status is ALWAYS updated, even if you choose NOT to publish your post to Facebook.

** Import Comments from Facebook for Wordbook Posts  **

This version of Wordbook supports the importing of comments made on Facebook back into your WordPress blog. This allows you to set the default behaviour. This option can be overridden from the Edit Post page

** Auto Approve imported comments **

If you trust your friends on Facebook then you’re probably quite happy for their comments to automatically get posted as comments on your Wordpress blog. If this option is not set then any imported comments are held in the moderation queue.

Once you’ve got the options set how you want then save them.

If you exported the wordbook_postcomments table before upgrading then you can now import it back into the database.

There may be times when you you are posting a blog entry and you’d like to do something differently, like NOT publish a post, or change your choice on what you do with comment. So on the Add New and Edit posts page you should now find a Wordbooker Options Override block where you can override several defaults:

Wordbooker Post options

Wordbooker Post options

If you are the administrator of a Facebook Fan page then you’ll also be given the option of posting to that page instead of posting to your own wall. At the moment there is a bug in the API which means that posts made to Fan Pages are shown as YOU posting on the Fan Page wall – rather than it looking like the Fan Page has posted the post directly.

PROBLEMS

If you’ve got problems its probably best to post them on the Wordbooker Page on Facebook where people can create new threads for each bug/problem and people can easily see if any fixes have been made

By Steve | November 10, 2009 - 6:45 pm - Posted in Computing, Wordbooker

Well I’ve been hard at work on my forked version of the Wordbook plugin which links your own hosted WordPress Blog with your Facebook account. Oh and it also works with WordPress MU too.

Its now really reached a point where I’m quite happy with it.

So what does it now support?

Multiple Facebook account / WordPress account support

If you have multiple users of your blog the old version wouldn’t post to YOUR Facebook account. It would post to THEIRS, if they had set it up. This version of the plugin now handles multiple WP Accounts. If you as the blog owner only want it so that WP posts go to your FB account then go into the Options screen and set the default account to be yours, and that should be it, any person using a different WP account to post to your blog will publish those stories to your FB account.

But what if you’ve got a Family WordPress where different people would like to post to WP and to their OWN FB accounts. Simply get each of them to login to WP as themselves and configure WB as if they were the only user. Then when all of them have done this go back in as yourself and set the Default account to be you.

On the Edit Post page there is a WordBook Options block which includes a drop down list of the blog you wish to post to, if you want to post to your default blog then you don’t need to touch this but if someone wants to post that post to their FB account all they need to do is pick their name from the drop down list before they post.

Length of Extract

This allows you to change the length of the extract posted to Facebook. The minimum value is 200 and the maximum is 400 (at the moment) with the default being 256 characters. The extract will be trimmed to the nearest full word BELOW this value.

Default Publish Post to Facebook

This allows you to choose if posts should automatically be posted to Facebook. This option can be overridden from the Edit Post page

Post Attribute

This allows you to change the attribute line when posts are sent to Facebook. By default this is set to “Posted a new post on their blog”. This option can be overridden from the Edit Post page.

Republish Post if edited more than x days ago

This allows you to control how long it should be before Wordbook considers an edited post to be a “new” post and re-publishes it to Facebook.

Override Re-Publication window

This allows to to force all edits to be reposted to Facebook ignoring the republish window. This option can be overridden from the Edit Post page.

Update Facebook Status

If this option is checked then the title of your blog post and its permalink will be posted to your status, along with the text specified here. This can be overridden from the Edit Post page. NOTE: If this option is Selected then your status is ALWAYS updated, even if you choose NOT to publish your post to Facebook.

Import Comments from Facebook for Wordbook Posts

This version of Wordbook supports the importing of comments made on Facebook back into your WordPress blog. This allows you to set the default behaviour. This option can be overridden from the Edit Post page.

Auto Approve imported comments

If you trust your friends on Facebook then you’re probably quite happy for their comments to automatically get posted as comments on your Wordpress blog. If this option is not set then any imported comments are held in the moderation queue.

Posting using XMLRPC clients

Posts published to your WordPress account using XMLRPC clients will now also publish to Facebook – if the default option of posting to Facebook is set. Posts made via this method will also pick up the default target Facebook account, the default post attribute line, and the Update Status options.


Upgrading from the stock version obtained from the Wordpress plugins repository:

* You need to de-activate the old plug in first.
* Then DELETE the wordbook folder from wp-content/plugins and then upload the new version. DON’T just copy the new files up.
* Re-activate the plugin
* Go to the Options page for the plugin and you can set all the new wizzy options. If you want to pull comments from your Facebook account you’ll need to grant the plugin permission to read from your stream. If you don’t grant this permission then you can’t pull comments, and I’ve no idea what my code will do if it tries to do that because I didn’t test it! So you have been warned!

Debugging

The only place I’ve put any real debugging in is in the cron job code because its very hard to actually work out if its working if there are no comments to pull. Debugging for that can be enabled by editing two lines in wordbook_cron.php:

define (’DEBUG’, false); which you change to true

and

$debug_file=’/tmp/wordbook_’.$table_prefix.’debug’; which you may need to change if you want to change the output directory.

So where is it I here you ask?

Right Here:

wordbook1.5