Given that over the past year Twitter has emerged as one of the new communication tools within social media, one of my natural reactions was to figure out how to connect this blog site to Twitter so that a post/tweet would appear in twitter.com/voxeo whenever we posted a new article. (If you are not aware of Twitter, my external “The 10 ways I learned to use Twitter in 2007” should give you an overview.) My main reason for wanting to do this was to provide another way for people to stay up on what we post here. For some people, myself included, it’s easier to follow someone on Twitter than even to subscribe to their RSS feeds. So I wanted to make it easy for someone to “follow” the posts we create here on blogs.voxeo.com.
My first instinct was to simply go over to Twitterfeed.com and set up a link between our RSS feed for all posts and our new Twitter account. This undoubtedly would have been the simplest path to go – and one I’d probably recommend for others. There were however, several problems/challenges/concerns:
- Twitterfeed.com requires the use of OpenID to login, which, as an OpenID advocate, I delight in. However, I wanted to create the feed using a Voxeo-related OpenID versus one of my own, so first I needed to go and turn this blog site into an OpenID provider.
My second concern was just that Twitterfeed.com seemed somewhat inefficient in that it has to poll to find out if you had new posts to tweet. There’s naturally the potential time delay from posting… and also just the general inefficiency. We are not posting here all that often and don’t need the feeds checked all that much.
My third concern was the issue of introducing yet another site in between this site and Twitter. Given Twitter’s API, it seemed logical that we could connect directly.
By the time I got the site set up to provide OpenID, Twitter was experiencing some performance problems last Friday and the Twitterfeed.com site was also offline.
This last issue caused me to decide I had to solve the problem on our own server so that we aren’t dependent on another site.
A Google search brought me to the “Twitter Updater” plugin for WordPress which, on first glance, seemed to provide exactly what I was seeking. I followed the instructions, activated it for one of the blogs, filled in the credentials, posted a test post and……. nothing. No Twitter post. In further reading down the page, it became clear that the developer stopped further work on this plugin and in fact moved her blog from WordPress over to Drupal and so had no real interest in the plugin anymore. I tried a hack by another user, but it, too did not work.
Meanwhile a friend had recommended that I use Alex King’s great “Twitter Tools” plugin. I actually had it installed, but hadn’t really thought about it for purely posting to Twitter. The strength of the Twitter Tools plugin is really about taking your updates from Twitter and posting it to your blog (which the README clearly shows). However, in our case, we’re not going to be (or don’t expect to be, anyway) posting independently to twitter.com/voxeo. It’s just another publishing medium for us – a one-way publish out to the world of Twitter. So we don’t need to publish our tweets here because there won’t be any.
This is, however, the solution I ultimately used. I activated the plugin for one of the blogs on this site, configured it with our Twitter username and password and then changed the settings so that it was only publishing outbound to Twitter.
There was one change I did make to the PHP code. By default, every new blog post appears in your Twitter stream with the prefix “New blog post: “. However, since our Twitter stream is only new blog posts, this prefix is redundant and wastes some of our precious 140 characters! So I modified line 75 and 76 of “twitter-tools.php” from this:
$this->tweet_prefix = 'New blog post'; $this->tweet_format = $this->tweet_prefix.': %s %s';
$this->tweet_prefix = ''; $this->tweet_format = $this->tweet_prefix.'%s %s';
You can see the result now over on twitter.com/voxeo.
A couple of notes about this implementation:
The good news is that this posts to Twitter as soon as we publish an article to a blog. No polling. No waiting. No reliance on a site in the middle (Twitterfeed). Just direct from our site to Twitter via the Twitter API.
The good or bad news, depending upon your perspective, is that the plugin needs to be activated separately for each of your WPMU blogs. If you have a lot of WPMU blogs and all you want to do is take all the blog posts and post them to Twitter, you are probably far better off taking the Twitterfeed.com route and simply linking a site-wide RSS feed to a Twitter account. In our case, we don’t have a large number of blogs and while we anticipate adding a few more, we don’t expect to add a huge number. Activating/configuring this plugin is now something I’ll just add to my “provisioning checklist” when rolling out a new blog.
Note that on the good news side, we do now have a much higher degree of control over precisely which blogs post to the Twitter.com/voxeo account. Because we have to manually configure it, we wind up having the flexibility to not configure certain blogs, so that their postings do not appear in the Twitter.com/voxeo stream. We also have the flexibility to configure a certain blog to post to a different Twitter account. That’s not something I see us doing, but we do now have the option, which we wouldn’t if we simply connected our “all blogs” RSS feed to a Twitter account.
Do note that since we are using WordPress MU, after dropping the Twitter Tools plugin code into the “plugins” directory, I did need to go into the Site Admin page for the site and “allow” the use of the plugin for blogs on the site. After that, I could go into each individual blog, activate the plugin and then configure the settings.
I have the plugin activated currently in four blogs and all are configured to post to the same Twitter account. Everything seems to be working fine.
So there it is… how I linked our WordPress MU blogs to Twitter to publish notifications to the Twitter account when we post new blog entries. Hopefully some of you out there will find this helpful.