Integrating Twitter and WordPress

I’ve known about WordPress for a long time, and this is the first time I’m really playing with it in order to integrate a blog into my online presence. Like many these days, I have a Twitter account, so I made this my first target for integration.  There were four primary goals here:

  1. Make it so that when I post a blog entry have it automatically posted to Twitter.
  2. Show my recent tweets.
  3. Show my favorite tweets.
  4. Show the photos I’ve tied to my Twitter account using Twitpic.

#1 took me a while to sort out.  The problem is that my first inclination was to use a plugin.  Initially I gravitated toward Twitter Tools, because it seemed to do everything I wanted and more.  It’s that last bit that was tricky, because it walked me into something that wasn’t really what I wanted in the first place.  Don’t get me wrong, this is a very good plugin – it’s just overkill for my needs.  I just really wanted something to post my blog posts to Twitter – and it’s the “and more” part that was overkill for me.  Sure it posted my blog posts, but it also has one feature that I really didn’t need at all – posting my Tweets as blog posts – and another feature to do a daily or weekly digest of my Tweets.  This second one was something I tried, and what I ultimately realized was that I didn’t need it either.

My conclusion was simple:

People may come to my blog from Twitter, but they don’t come to my blog for Twitter.  Though it’s okay for my blog to refer them to Twitter.

And that’s why I stopped ditched Twitter Tools.  I tried several other things in short succession, but also none of them stuck.  So I decided to go with something that existed outside of my blog itself.  Something I already knew about: Twitterfeed.  Though very basic and simple in use, what Twitterfeed does for me is exactly what I wanted it to do, monitor my blog (via RSS feed) and when it sees a new post (I have it set to check every 30 minutes) it posts it to Twitter.  And Twitter in turn posts it to Facebook (blog => Twitter=> Facebook).

#2 and #3 became a joint task.  For me it started as I imagine it does for many: try the standard Twitter widgets.  Don’t get me wrong, these do work, but they’re very limited from a CSS perspective, and I quickly abandoned them.  I tried to use the widget supplied with Twitter Tools, and while I could theme it nicely – it really was removed as a whole as I mentioned above.  I then tried the Wickett Twitter Widget and that gave me an idea to dive into doing it myself.  Yes that’s right I dove head first into the world of WordPress Plugin programming.

Now some might think I’m a bit crazy for doing this, but I’m a software engineer by trade and I already know PHP which is the programming language for WordPress Plugins.  So I rolled my own Twitter widget that can do both regular Tweets and Favorites.  I took some ideas from the other plugins I had seen, and the product of this, and some time spent learning has produced something I’m really happy with.  You can see the results of this to the right hand side of the blog.

#4 was solved in similar manner: I wrote a plugin to interact with Twitpic. The model for this plugin is very similar to what I had done for my Twitter plugin, only the API for Twitpic is much less complicated.  You can also see the results for this on the right hand side of the blog.

I will discuss the plugins in more detail in a future post.

1 thought on “Integrating Twitter and WordPress”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.