Twitterbook v3 Now Available

A new version of Twitterbook is now available – the mashup that lets you use your Facebook status to update your Twitter account.  For this update, a special thanks goes out to Ryan for his suggestions on handling long Facebook status updates when submitting them to Twitter.

Download Twitterbook v3 (4KB)

Just like the previous versions of Twitterbook, you’ll need to edit the .php file with your personal information before uploading it to your server. On the new Facebook layout, you can find the link for the RSS feed for your status updates here:

http://www.new.facebook.com/minifeed.php?filter=11

You’ll need the actual URL of your feed (found at the link above) to properly setup the twitterbook.php file, along with the URL for your Twitter Feed, your Facebook Name (eg. ‘Stuart’), as well as your Twitter username and password.

Once you’ve edited and saved the twitterbook file and posted it on a web server running PHP, just go to the URL for the script (or call it using an automated Chron task) anytime you want to update your Twitter account with your Facebook status.

Thanks again for the feedback and suggestions!  Post a comment, or connect with me on Twitter: twitter.com/designmeme

18 thoughts on “Twitterbook v3 Now Available

  1. Have just tried installing it and go the following error:

    Fatal error: cannot instantiate non-existent class in simplexmlelement in (path) on line 43.

    Any ideas?

  2. Yeah same problem as nick

    Fatal error: cannot instantiate non-existent class in simplexmlelement in (path) on line 43.

  3. Can you explain the Chron task? I’ve gotten this far with the php updated file and need some help from this point. Thanks!

  4. Solution to my previous problem.
    It has to do with php 5…
    Just make a .htaccess file for the directory of your twitterbook file with the following lines:

    AddType x-mapp-php5 .php
    AddHandler x-mapp-php5 .php

  5. I’m having some type of weird issue. I did try to do the php5 thing someone previously mentioned by adding a htaccess.

    Fatal error: Uncaught exception ‘Exception’ with message ‘String could not be parsed as XML’ in /home/.national/daniel13/dangarion.com/twitterbook/twitterbook.php:43 Stack trace: #0 /home/.national/daniel13/dangarion.com/twitterbook/twitterbook.php(43): SimpleXMLElement->__construct(”) #1 {main} thrown in /home/.national/daniel13/dangarion.com/twitterbook/twitterbook.php on line 43

  6. Try putting this line after setting the USER_AGENT:

    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);

    Works for me at that point. Seems theres a redirect in there that curl is not following, so the XML parser is trying to parse an empty string.

  7. Everything is working great. But now I’m wondering if there is a way to get this to work if you also sometimes just post directly to Twitter on your own. Since it’s only looking at the most recent message on Twitter, if you post directly on Twitter it will, then repeat the message that is on your Facebook shortly after.

  8. Nigel, where would one put the curl_setopt($ch, curlopt_FOLLOWLOCATION, true) line. Where is the user_AGENTentry?
    Is it in the twitterbook.php file?
    If it is, I added it, but still don’t work!!
    Can you be more specific please?
    Thanks

  9. Rafa – in my copy of the code, around line 32 there is a line

    curl_setopt($ch, CURLOPT_USERAGENT, “Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.1) Gecko/20061223 Firefox/2.0.0.1″);

    Add the following on a new line after that line:

    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);

    You should then find the script works for you. At least, it should get your facebook status (I just tried it).