Ubuntu Recipe: How to automagically post your Last.fm feed to Twitter.

I signed up for Twitter this morning, opening an account at http://twitter.com/palewire. Since I haven’t seen or heard from my cell phone in a week or two, don’t count on much on the scene reporting. But I did take a few minutes this morning to line up my Last.fm feed, so that my lastest listenings are now automatically Twittered to the huddled masses yearning to have my musical taste shoved down their throat.

For any other Ubuntu users who’d like to follow along, here’s a quick recap on how I made it happen.

1. Move to the folder where you store random scripts. Me, I use…

cd /usr/local/bin

2. Create a new Perl script and open it in gedit.

sudo gedit twitter_fm.pl

3. Copy and paste in the ready-to-serve code provided by Walter Higgins.

4. Edit in your Twitter and Last.fm login information. Save and exit the file.

5. Create a new shell script.

sudo gedit twitter_fm.sh

6. Paste in the following, editing the folder structure to reflect wherever you stuck your steez.

#!/bin/sh
 
perl /usr/local/bin/twitter_fm.pl

7. Set the shell script so it becomes executable.

sudo chmod +x twitter_fm.sh

8. Navigate through the System>Preferences>Session menu as described here and add the shell script to your startup processes.

9. Restart!

I just patched this mess together a couple minutes ago, so there might be some bugs. Either in my setup or in Walter’s script. Don’t know yet. Let me know if you see anything idiotic on my part.

I also installed Wordpress’s Twitter Tools plugin, so now my latest blog posts will also be sent out via Twitter.

Also on the Twitter tip, earlier this week we launched a feed at work for our popular political blog, Top of the Ticket. It includes the latest posts from our team of writers, and, on election nights, live election results as they come in. You can sign up here. For anyone looking to reroute their own data streams to Twitter, I can’t recommend Chris Thompon’s Net::Twitter Perl module enough. Easy. Peasy.

Ben’s Music Quilt.

Like many of my fellow pale, white Americans, I have a job that requires I spend most of the work day seated in front of a computer.

It comes with a few negatives. I have minor neck pain. I’ve gained a little weight. And I’ve developed a highly refined, and easily inflamed, sensitivity toward the shortcomings of different varieties of database development software. None of which is probably doing much for my sex appeal. Especially that last one.

But it has its advantages, too. I enjoy the work. I’m blessed with great coworkers. And it’s possible to complete most of my job while also engaging in one of my favorite hobbies: listening to pop music.

To make the most of the opportunity, I decided several months ago to purchase a good pair of headphones, the Grado SR-80. While I won’t pretend to be an expert on the subject, they’ve certainly been great for me.

And, more recently, I’m signed up for an account at the social networking site last.fm. Now every time I listen to a song it’s cataloged by a little bug on my computer that sends the track back to their site. You can watch what I’m up to here. You should go join yourself, too. It’ll be fun. (And if you do, add me as a friend!)

Since I’ve written about last.fm and the RSS feed of recent tracks over there in the sidebar before, I won’t ramble too far. But I do have something new. Below is a quilt of album covers that displays artwork from the music I’ve been listening to lately.

It’s dynamically generated and updated by last.fm. You can check it out anytime right here or over on my media diet page. Pointless indeed, but at least marginally entertaining. Sort of like this blog, I suppose. When we’re clicking, at least.

Ben’s Live Playlist (with Assists from Jon and Otto).

I’ve added another feature to the sidebar. This one, called Ben’s Live Playlist, is a feed of my latest listens served up automagically via last.fm and a couple Web toys.

Here’s how it works. Every time I play a song it’s recorded by a little bug on my computer trained to ship the titles to my last.fm profile page. The data is harvested there by a widget created by a guy named Jonathan and then published here using another widget by a guy named Otto.

Since the code was done in AJAX the listing should be updated every few minutes, which means that you can find out what I’m listening to literally as I listen to it. How about that?

If you’re not already a member at last.fm, I encourage you to sign up. It’s a neat way to track your listening behavior and the social networking features are a good deal of fun. If you join, be sure to add me as a friend!