Alex King‘s Twitter Tools is a great little WordPress plugin for integrating your Twitter presence with your blog. It can show your latest tweets in a sidebar widget, create a “digest” post daily / weekly with a list of your tweets, and announce your blog posts to your twitter account.

In this post I’ll show you what changes are necessary to make it work with instead of Twitter.

Why would you want to do that? is often described as “an open source twitter” which it is, but it’s also the first instance of the Open Microblogging standard, which I believe will become increasingly important. Where Twitter users all share the same service, and are entirely dependent on Twitter for their ability to reach other, enables subscriptions across services, removing the need for a single point of failure.

Twitter Fail Whale, screenshot by John Rees
Twitter Fail Whale, screenshot by John Rees

In other words, Twitter is a bit like the early days of email, when Compuserve users couldn’t email AOL users, and neither set of users could email the Internet. (I quality that with “a bit” since the Twitter API certainly makes possible clients which can do more than just post to Twitter). (or, as the software project behind is called) is more like modern, decentralized, global-address-space email.

When first launched, many folks were left stuck between the two alternatives: use, which was more open and federated, or stay on Twitter, where a strong, rapidly developing community already existed (and, frankly, where many of the folks you were already talking to and listening to were unlikely to be persuaded to move en masse).

Evan Prodromou of (photo by Zach Copley)
Evan Prodromou of (photo by Zach Copley)

Now, however, can be set to automatically cross-post to Twitter. Still doesn’t remove the need to “watch” two streams, but at least you only need to post one place. (Services like are often used in this way as well, to move posts between Twitter,, Jaiku, etc).

This ability means that for me, a version of Twitter Tools which would post to (and let cross-post to Twitter) was preferrable. Luckily, has also implemented an API which responds to the same commands in the same way as the Twitter API.

This means that the changes needed are very simple.

In version 1.5.1a of Twitter Tools, lines 67-72 define the API endpoints to be used:

define('AKTT_API_POST_STATUS', '');
define('AKTT_API_STATUS_SHOW', '');
define('AKTT_PROFILE_URL', '');
define('AKTT_STATUS_URL', '');
define('AKTT_HASHTAG_URL', '');

The key is to change these to map to the corresponding API endpoints:

define('AKTT_API_POST_STATUS', '');
define('AKTT_API_STATUS_SHOW', '');
define('AKTT_PROFILE_URL', '');
define('AKTT_STATUS_URL', '');
define('AKTT_HASHTAG_URL', '');

For the most part, this just means replacing ‘’ with ‘’ except that the individual post urls and hashtag url have to be handled differently.

If you’re planning to use the sidebar widget, which includes a link to hashtags when you use them in a notice. , you’ll also need to find this line:

$hashtag = urlencode('#' . $hashtag);

And change it to:

$hashtag = urlencode($hashtag);

Finally, I also chose to update the “give credit” line, which occurs in two places in the code (not to remove credit for Twitter Tools but to point out the changes):

First, at roughly line 403 (this one is used in the blog post digest of tweets):

$content .= '<p class="aktt_credit">Powered by <a href="">Twitter Tools</a>.</p>';

I changed that to:

$content .= '<p class="aktt_credit">Powered by <a href=""> Tools</a>, a modified version of <a href="">Twitter Tools</a>.</p>';

And again later at line 768 (this is the one used in the sidebar widget):

$output .= '<p class="aktt_credit">Powered by <a href="">Twitter Tools</a>.</p>';

Which I changed to:

$output .= '<p class="aktt_credit">Powered by <a href=""> Tools</a>, a modified version of <a href="">Twitter Tools</a>.</p>';

This same approach could also be leveraged for other based sites with little effort.

Remember that these changes will get overwritten if you upgrade to newer versions of the Twitter Tools plugin.

(Here’s my modified copy of twitter-tools.php – just change the extension back to .php)


  1. The daily/weekly digest feature of Twitter Tools is great—if it worked properly. I’ve been testing that functionality for a couple of weeks now, and have not been able to reliably publish digests yet. It’s supposed to be an experimental feature so I don’t blame the developers, but what it promises is so great that I just wish it worked. Still trying though.

  2. Two parts to the question, really:

    Where to set the “source” in the Twitter Tools code
    How to get to recognize that “source”

    For the first, see lines 403, 620 (which actually sets the useragent doing the posting to the server), and 768 in the file attached to this post.

    For the second, I believe the Laconica code base just stores a set of strings and corresponding URLs for the “source” of a given “notice” posted to a Laconica site. See my question and Evan’s response.

  3. Thanks. I was referring to the URL for a source. Still a little confused by Evan’s response though. So do I just need to file a bug with Laconica to get a URL added for a string? Thanks a lot for your help!

  4. Hi John, any reason why you wouldn’t use a ‘ping this’ plugin from for easy posting to both of these? I’m curious what your thoughts are on that.

  5. @dudenhofer – Actually can automatically cross post to Twitter. So when I post to (through the web, through a client, or through this script) it automagically gets cross posted to Twitter.

    One certainly could use to accomplish the same goal, or use RSS To Twitter type tools which read your RSS feed as well.

  6. Hey Don – replied on another post as well.

    Afraid you do need to have a userid/pass – lets you have a userid/pass but also assciate your openid to that account.

    I set up my account first (get a username and pass) and then associated an openID to it, so I’m not sure how to do it the other way round (set up an openID and then get a userid and pass).

  7. Hey John, I may be digging an old post but do you know of anything that integrates logins of StatusNet (aka with WordPress?

Comments are closed.