WordPress and Facebook Part five
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:
November 10th, 2009 at 7:04 pm
I was working with wordbook when I saw your announcement about this fork, and since I’m having issues with the original I’m giving yours a try.
However, when I click the link to get the one-time code, I just get sent to my home page on facebook.
November 10th, 2009 at 7:18 pm
When you go into the options page do you get the
Setup
Wordbook needs to be linked to your Facebook account. This link will be used to publish your WordPress blog updates to your Mini-Feed and your friends’ News Feeds, and will not be used for any other purpose.
First, log in to your Facebook account to generate a one-time code. Record the one-time code and return to this page:
Text with the facebook Icon which if you hover over it shows something like:
http://www.facebook.com/code_gen.php?v=1.0&api_key=21e0776b27318e5867ec665a5b18a850
November 15th, 2009 at 3:42 am
I’m having trouble getting this to even activate on wpmu 2.7.1
i get the error:
Fatal error: Call to undefined function register_sidebar_widget() in /home/myaccount/public_html/wp-content/plugins/wordbook/wb_widget.php on line 29
November 15th, 2009 at 2:13 pm
I didn’t develop under 2.7.1 so its not supported. I’d recommend upgrading to the latest version of WPMU for lots of reasons anyway
November 15th, 2009 at 8:03 pm
updated to the last vrsion of wpmu and nowget an error:
There was a problem with the one-time code “******”: error_code = (). Try re-submitting it, or try generating a new one-time code.
I heeping trying to and still not accepting the code. I tried logging out of both and then logging in again. remove plugin and app from fb and wp.
November 15th, 2009 at 9:45 pm
During testing on my dev account I never managed to re-create this error. Even when I trashed my account and re-entered the details it just worked
November 18th, 2009 at 1:08 am
Ahh… right now I can’t seem to download the plugin file….broken link maybe?
I’m really excited to get this installed! Thanks for the hard work!
November 18th, 2009 at 1:18 am
Sorry about that, try it from the wordbook page:
http://blogs.canalplan.org.uk/steve/wordbook/
Which will always have the current version on it
November 18th, 2009 at 3:36 am
Will this work with multiple blogs (different installations) posting to the same Facebook account.
Gary
http://GarySaid.com/
November 18th, 2009 at 1:26 pm
Well my FB developer account is set up on more than one blog and they all happily post to it. The only thing that changes is the “box” which contains the latest posts as that is rebuilt each time you post, so it will change for each blog you post from.
November 18th, 2009 at 5:07 pm
Let me first say, superb work on this fork of WordBook. I can’t believe these features aren’t in the core version.
I’m trying to figure out a final tweak for my particular needs (and I’m not against modifying the PHP or SQL of my installation if that’s the answer). I’d like to limit cross-posting to Facebook to 1 or 2 Categories (pulled from the WordPress articles). Any thoughts on how I might go about doing that. I came across some promising section in the original WordBook code, but none of them panned out (my own limited understanding of the WP post taxonony).
November 18th, 2009 at 5:46 pm
You could do it crudely by putting a check in on the publish post hook that checks for a “valid” category and if the post isn’t assigned to any of those categories simply returns without doing the post. It is something that I might add to the options screen if I get enough incentive to do it.
When posting the $_POST["post_category"] variable is an array containing a list of the categories assigned to that post. For example: array(2) { [0]=> string(1) “8″ [1]=> string(3) “254″ }
December 22nd, 2009 at 12:47 pm
Stephen, thanks for this great plugin. Will follow all your updates!
Regards.
January 15th, 2010 at 5:02 pm
I installed Wordbooker 1.5 on my WordPress 2.9.1 blog, hosted by 1&1. The setup went fine. However, it’s not actually posting anything on my Facebook Wall.
It will update my status right away, and the Wordbooker widget reflects my Facebook status on my blog. The Wordbooker “box” on my Facebook page updates, but I’m not seeing my post in my news feed.
When I have “publish to Facebook” turned on, and I create a post at http://blog.sloppyedwards.com/wp-admin/post-new.php, then click “Publish,” I get a blank page at http://blog.sloppyedwards.com/wp-admin/post.php. If I uncheck “publish to Facebook,” then I get returned to the post page with the normal “successfully published” message.
Any suggestions for what kind of troubleshooting I should do?
January 15th, 2010 at 5:11 pm
By blank page do you mean a totally blank page? If so then that is a PHP error and you need to look in your PHP error logs to determine what the problem is.
January 15th, 2010 at 5:19 pm
Followup to my comment above:
If I post via Windows Live Writer, I get the following error message:
“The response to the metaWeblog.newPost method received from the blog server was invalid:
Invalid response document returned from XmlRpc server”
It posts successfully to my blog, and as before, Wordbooker updates my status and shows the newest post in the Wordbooker “box,” but not in my news feed.
I’m assuming it’s a problem with my blog configuration, but I’m not sure what to do about it.
January 15th, 2010 at 5:26 pm
Thats a livewriter error – but if you’re getting a crash with my code then its’s probably throwing an error which is confusing Livewriter.
What is the error if you publish from the normal WP edit/add post screen?
February 2nd, 2010 at 9:45 pm
Just installed 1.6.1 yesterday and something broke. It no longer posts to FB. When I look in Edit Post in the WP Admin screen I see the following error message immediately above the “Action Link Option”..
Warning: Invalid argument supplied for foreach() in D:\home\counterpointonline.net\wwwroot\blog\wp-content\plugins\wordbooker\wordbooker_options.php on line 295
February 2nd, 2010 at 9:48 pm
It was working fine with 1.6.0. I just did a new install on my other site and it appear gives the same error.
February 3rd, 2010 at 8:33 am
Its a warning caused by you not having any fan pages. It shouldn’t actually break anything. I assume you’ve got PHP warnings and errors set to be sent to the screen. Its fixed in 1.7
February 3rd, 2010 at 8:19 pm
Hmm, I do have a fan page. But I recall you saying that piece was not working while waiting on FB to fix the API. All I know is that the posts are not going to FB anymore. not sure where to go from here.
February 3rd, 2010 at 8:22 pm
Ok, I will back off on one thing. I re-posted y’day and it does appear the post to my FB main page. But I cannot push to the Fan page. I presume that the Fam Page piece is still broke??
When is 1.7 coming or where can I find it?
February 3rd, 2010 at 9:00 pm
1.7 will be going through a Beta release next week because its a huge recoding of a lot of the system. The best place to keep up to track with things is on the wordbooker page on Facebook.
February 3rd, 2010 at 8:43 pm
OK, i am a bit confused. I will say that I love what the plugin is designed to do but frustrated at trying to find answers. 1) When i hit “visit plug-in site” it takes me to the wrong place on your site. 2) your site does not say anything about 1.6.1. I did find via wordpress.org that 1.6.1 now supports Fan Pages but I don’t see any thing different on the Admin page. Not sure if I need to do anything different from 1.6 to 1.6.1 to make this work.
February 3rd, 2010 at 8:57 pm
I changed the URL but forgot to change the line in the plugin file.
The details are all on
http://blogs.canalplan.org.uk/steve/wordbooker/
1.6 supported Fan Pages – the way they posted was just odd. So from the UI point of view there is no difference between 1.6 and 1.6.1. If you are a page admin then you should see the option “And/Or” which allows you to chose if you want to post to your personal wall AND/OR post to a specific fan page wall.
February 3rd, 2010 at 9:02 pm
Thanks for the quick reply.
I see the “and/or” but the drop down says “no fan page”. However down near the bottom it says “You can also post to the following Facebook pages : PANDORA’s Regret”
February 3rd, 2010 at 9:10 pm
OK, its a feature of how I implemented Fan pages. Try saving your settings and then coming back into the page. You should then get the page appearing in the drop down.
February 3rd, 2010 at 9:18 pm
I did that with no luck. I closed the browser, re-opened…no luck. I closed Chrome and opened IE…no luck. Earlier I had hit “reset configuration” with no luck there either.
February 3rd, 2010 at 9:36 pm
i discovered you have a FB Application. Am I supposed to @add@ the application to the Fan Page or anything like that?
February 3rd, 2010 at 9:38 pm
Save Settings should do it – the drop down list is populated from the saved settings and the list at the bottom is pulled dynamically and is pushed into the variable that is used to populate the drop down.
So Save Settings followed by clicking on the Wordbooker menu doesn’t give you the values in the drop down?
February 3rd, 2010 at 9:52 pm
Theoretically all you need to do it install the plugin and configure it – you don’t need to do anything else for now
February 3rd, 2010 at 9:52 pm
I click Save Options on the Wordbooker admin page. Then I clicked on Wordbooker in the left nav frame to reload that page. Nothing changed.
February 3rd, 2010 at 10:01 pm
I know what’s doing it – does your page name really have an apostrophe in its name?
February 3rd, 2010 at 10:06 pm
yes
February 3rd, 2010 at 10:09 pm
Fan page is here:
http://www.facebook.com/pages/PANDORAs-Regret/222410669138
February 3rd, 2010 at 10:16 pm
I had seen this …
PANDORA's Regret
…under the edit options for the Fan Page.
February 3rd, 2010 at 10:24 pm
Now that is odd…..what I posted in the last note to you contains special characters in place of the apostrophe. But when it posted it actually converted it to the apostrophe. Could we be hanging up in that translation?
February 3rd, 2010 at 10:39 pm
I’d not considered apostrophes in page name
Do you need this now or can you wait for 1.7 which will be about a week? If you need it now I’ll see if I can roll the code change back into the 1.6 code
February 4th, 2010 at 3:19 pm
I can wait Steve. Since it has never worked for a Fan Page until 1.61 it won’t kill me to give you time. Thanks much. I’ll be waiting patiently…..
February 8th, 2010 at 5:38 pm
I’ve a feature request: “Post to Group”
Is there a way to post to a Facebook Group instead of a personal wall?
How much time does it take to implement?
Perhaps I can help.
February 8th, 2010 at 5:45 pm
It depends on the API – if the calls are there and documented then its not a huge job to post to groups. Adding the permission checks and all the rest is the bit that take time.
Unfortunately the Facebook API documentation server is off line right now so I can’t even start to look at it.
February 12th, 2010 at 5:21 am
This is looking really good. Kudos. It appears that this will upload image files to facebook, but hyperlinks seem to get lost. Is the uploading of links supported or am I doing something wrong?
Thanks and nice work!
February 12th, 2010 at 8:13 am
You cant post hyperlinks in text to facebook profiles through the API, or you couldn’t but I can look into it.
February 12th, 2010 at 6:19 pm
I thought you could, but now that I think of it, maybe it was only in Facebook Notes.
February 25th, 2010 at 10:09 pm
Wow, all I did was download this plugin, and now I have no more website. I can’t even get into the admin section. Please help? Fatal error: Call to undefined function register_sidebar_widget() in /home7/wolfsbak/public_html/wp-content/plugins/wordbooker/wb_widget.php on line 29
February 25th, 2010 at 10:31 pm
whew! sorry, i panicked there. i just had to delete some lines via phpmyadmin, and re-enable all of my plugins. no harm, no foul
February 25th, 2010 at 10:59 pm
Wow – that sounds like a very old version of WP if register_sidebar_widget is missing
February 27th, 2010 at 2:57 pm
re: the WLW and WB, it DOES post despite the error which is great but if I decide to make any changes (and I always do
) then publish again, it will post a separate post. It should just update the current post..
It didn’t do that before Wordbooker.
/just sayin’
love WB otherwise
February 27th, 2010 at 3:35 pm
You can’t update Facebook Wall posts – its not possible. You can’t do it from the FB Web interface and you can’t do it from the Facebook API – its a limitation inside Facebook not in my code. Or are you saying that you end up with two WordPress entries? All I do is hook in on ‘xmlrpc_publish_post’ so I shouldn’t be affecting anything inside WordPress
February 27th, 2010 at 3:54 pm
yes, it will post duplicate WP entries.
well. it started happening after i installed Wordbooker. I get the same error mentioned above:
Invalid response document returned from XmlRpc server
I’ll look for causes elsewhere if you’re sure it’s not caused by WB.
thx
February 27th, 2010 at 3:59 pm
I’d try deactivating Wordbooker and see if it still does it, as I don’t do anything with the wordpress post itself and just hook into the XMRPC publish hook I’m not actually doing anything that should be causing any errors like that.
WLR is notorious for having problems with Wordpess
February 28th, 2010 at 4:50 am
hey, I just thought I’d update you…
I deactivated the WB plugin, reactivated, went through the FB authenticating, got a new code etc.
I just posted a new post via WLW. No “invalid response” error. good.
then tried re-publishing the same post to WP again. It didn’t duplicate the blog entry. even better!
that must have done the trick. thanks!!
hopefully the commenter above sees this and will try it too.
again, great plugin. glad I/you got this kink out.