Twitter meets WordPress

Print Friendly

Before I get into this, let me point to Alex King’s excellent and comprehensive Twitter Tools. It does just about everything you can imagine involving connecting Twitter and WordPress. You can Twitter when you publish a blog entry or, conversely, publish WordPress digests of your Twitter tweets. While I don’t do the latter anymore, you might be interested in doing it in some context.

In my last entry I talked about the bob_sutor_log Twitter stream account I set up to experimentally capture events around me. There I described using a script to post the music I’m listening to on iTunes.

Since then, I used Alex’s Twitter Tools to send a tweet to the log stream whenever I post a blog entry. By the way, it doesn’t seem to work for blog entries submitted programmatically, such as those from Diigo.

This clearly was a sensible use of WordPress, tweeting about a WordPress event.

I also played with a PHP script by Elliott Back that pulls weather data from Yahoo and produces a tweet from that. I modified the script to use more of the information from Yahoo and to be a bit more general.

Back suggests using cron to run the script once a day. I didn’t really want to do that on my Mac nor did I want to set it up on I remembered, however, that WordPress has some lightweight cron-like functions like wp_schedule_event. So I changed my PHP script into a WordPress plugin and installed it. Now once an hour it will post the latest weather forecast and temperature on bob_sutor_log. It has nothing to do with WordPress per se but instead takes advantage of it being a versatile software platform.

WordPress on is running on top of Linux, but it would work if it was running on another platform such as Windows.

What I really should do here create a WordPress plugin just for Twitter updates. I could pull out a little code from Alex’s Twitter Tools, rework the weather code, grab some other Yahoo APIs for stock quotes (for example), and create some sort of adminstration page for it all. Maybe, time permitting.

I need to figure out what else I want to track from my environment. I do not want to track news items or things for which an RSS or ATOM feed would be more appropriate. Of course I could skip Twitter altogether and just use an RSS or ATOM feed for all this, but where’s the fun in that?

Comments are closed