2005-10-27

Slashdotting the Speaker

I've been an avid reader of Slashdot for years, but only occasionally submit a story to them. It does, however, always give me a 15-seconds-of-fame feeling when they pick my submission. That happened today, when I submitted an item about Denny Hastert, the Speaker of the House, starting his own blog. The story got picked up, and the comments started flying. Now, by Slashdot standards, this was small potatoes -- I've seen stories that generated thousands of comments. What didn't occur to me until I started reading the comments, though, was that I had just unleashed the Slashdot Effect on the unsuspecting Congressman.

Ah, well, it will be an good learning experience for him. I hope the server holds up okay.

As a follow-up to the prior post, I've been flipping back and forth between Flock and Firefox for a while. Flock has some nice features, but I lose Flash and GreaseMonkey when I'm in it. Also, I tried to post this entry with their built-in blogging, and it gave me a very Microsoft-like error message -- in other words, one that doesn't actually tell you what went wrong. Note to the Flock developers: More error information is better than less. Especially for a "Developer Preview".

Tags: ,

2005-10-20

Testing the Flock browser

I got an email today inviting me to test the "Developer Preview" of Flock, a new Mozilla-based web browser. The interesting thing about it is that it is designed to integrate with social bookmarking sites, blog sites, and other collaborative uses of the web. In fact, I'm writing this blog entry inside Flock's blog editor, as one of my initial tests. If you're reading this, the test worked.

If this is a new paragraph, it's worked even better.

I think I'll try running this in lieu of Firefox for a while, and see what my comfort level is. So far, for a pre-beta, it looks very, very promising.


2005-10-13

Live365 radio from the command line

One of my passions is the music of Harry Nilsson. Luckily for me, one of the perks of the Internet Age is that finding others that share your passions is pretty easy. For Nilsson fans around the world, the website and mailing list run by Roger Smith has been the medium for that sharing. (Click on Harry's name above to see Roger's site.)

One of the longtime members of the NilssonWeb is Tom Westendorf, or "Old Tom" as he calls himself. Recently, Old Tom started a radio station on Live365.com, heavily featuring our Harry in the playlist. Naturally, I wanted to hear it. I couldn't, however, stand the idea of having to run a graphical client or a web browser in order to listen. I run Linux, after all, so I'm no stranger to the command line. Not to mention that we're talking about audio streaming here. There's no pictures, folks, so why should a GRAPHICAL User Interface be required?

This leads me to this episode's Scripting Pet Trick, which requires only two appications installed on your box: curl, an incredibly useful URL retriever, and mplayer, the best media player ever.

The trick here is to tell curl to remember the cookies it gets when browsing Live365, using the Unix 'cut' utility to pull information out of the cookie jar, and feeding that information into the URL for mplayer.

Other things to note: you have to register (free) with Live365.com, and get your userid and password, and fill them in at the top of the script. Obviously, this is not a secure way of handling things. I should probably have the script ask me the password every time. Also, you'll see that I had to yank the userid out of the session cookie value before passing it to mplayer. I'm also hard-coded to Tom's station here. You may want to browse Live365 for some other choices.

The script:

#! /bin/sh

USERID=useridgoeshere
PASSWD=passwordgoeshere

curl --cookie-jar curlcookies   --output curldump --location-trusted "http://www.live365.com/cgi-bin/login.cgi?url=http://www.live365.com/index.live&membername=${USERID}&password=${PASSWD}"

SANE=`grep SaneID curlcookies | cut -f7`
SESS=`grep sessionid curlcookies | cut -f7 | sed s/${USERID}%3A//`

# Westendorf radio
STATION=326329

mplayer "http://www.live365.com/play/${STATION}?SaneID=${SANE}&membername=${USERID}&session=${SESS}"

Happy streaming! (Oh, and Tom? Nice playlist...)

Tags: , , , , , , ,

2005-09-28

Hacking the playlist II

In a previous post, I was extolling the virtues of the moosic audio server, and mentioned that I wanted to create a nice on-screen display showing what's currently playing. As it turns out, it's much easier than I hoped, thanks to two useful Perl modules: Audio::Moosic and X::Osd.

So, without further ado, here's the Perl script. I call it moosic_osd.pl, but you can call it whatever you like.

#! /usr/bin/perl -w

use Audio::File;
use Audio::Moosic;
use X::Osd;

my $osd = X::Osd->new(3); # arg means 3 lines

$osd->set_font("-adobe-helvetica-medium-r-normal-*-*-100-*-*-p-*-iso8859-1");
$osd->set_colour("Red");
$osd->set_timeout(30);
$osd->set_pos(XOSD_bottom);
$osd->set_align(XOSD_right);
$osd->set_horizontal_offset(0);
$osd->set_vertical_offset(10);
$osd->set_shadow_offset(1);

my $moo = Audio::Moosic::Unix->new();

while (1)
{
    my $fspec = $moo->current;

    if (! $fspec)
    {
        $artist = "John Lennon";
        $title = "Two minutes silence";
        $album = "";
    }
    else
    {
        my $af = Audio::File->new($fspec);
        $artist = $af->tag->artist() || "";
        $title = $af->tag->title() || "";
        $album = $af->tag->album() || "";
    }
    $osd->string(0, $title);
    $osd->string(1, $artist);
    $osd->string(2, $album);

    sleep(1);
}

So, copy and paste that somewhere, and run it as a background job:

perl ./moosic_osd.pl &

...and you'll get a nice little on-screen display.

Tags: , , , ,

2005-09-23

GP2X will be Dad's toy

My son gets all the good stuff. The Rio Karma, the PS2, the GameCube. Every time some cool gadget comes along, someone in the friends-and-relations gift mill buys it for my son. Hell, sometimes it's me, as in the case of the Karma. That, of course, was part of my open-standards education program for him, since the Karma had support for Ogg Vorbis format audio files. So, I don't begrudge him his teenager toys.

I do get jealous, though.

The one that hurt the most was the Playstation Portable (PSP). My wife happened to be at Target the day the PSP was released, and happened to ask the electronics clerk about it, and he happened to have one that hadn't already been claimed. So we had one in the house on the day of release. I wasn't allowed to claim it for myself, because my wife already had it on my son's gifting schedule.

It's just as well, because it's my turn now. The GP2X is coming out in October, and I've already pre-ordered. I'm a long-time Linux hacker, and now a portable game machine with a Linux kernel and bundled SDK comes along. At the risk of employing an overused geek codeword, w00t!

And yes, I know about the DRM, as reported on BoingBoing. The UK folks have posted a reasonable explanation, and I'm going to take them at their word.

So, it should be here sometime next month, at which time I'll report on it. And, in case I didn't make this clear: This one is mine, son.

UPDATE: Officially, it's called the GP2X, not the GPX2, so I fixed that.

Tags:

2005-09-15

If I'm not here, it's Wikipedia's fault.

It's fairly obvious that blogging has not become an obsession with me. Let's see... I haven't checked in since March. For me, that's not bad.

A lot of my online time these days is spent contributing to Wikipedia. For those people who haven't encountered this yet, it's an encyclopedia inside a wiki, with no edit restrictions. In other words, anyone on the net can edit any page, either credited or anonymous. Short-term accuracy is always questionable, but most pages end up with concerned nannies watching for every edit and pouncing on incorrect information and vandalism.

All the regulars in this wiki, who have dubbed themselves Wikipedians, tend to gravitate into interest groups. I've ended up concentrating on musical theatre, certain favorite rock and roll performers, and chess. My two major contributions were articles on Harry Nilsson and Jack Gilford.

I encourage everyone to stop by the Wikipedia, and can guarantee that if you surf there for more than five minutes, you will end up editing something.

Tags:

2005-03-18

Hacking the playlist

Now playing: Bruce Springsteen / Lost in the flood

I've amassed a, well, massive amount of recorded music over the years. Lately, I've been methodically encoding it all to computer-readable formats, so that I now have a 20 gigabyte disk partition full of .mp3 and .ogg files. I've got no time to assemble playlists. What I want is to have a program to which I can say, "Go look in /media/music, and shuffle the lot."

Now playing: The Beatles / Mr. Moonlight (alt version from Anthology 1)

For the past year or so, I've been using the open source program gqmpeg for this purpose. There were two minor annoyances I found with this setup. First, it took forever to load up that 20 gig into its playlist. Second, I was tied to my X Windows session, because the player is tied to its GUI frontend. I wanted the player to manage the playlist invisibly. If I want to see what's going on, I'll ask the playlist manager.

Now playing: Original cast of 'Take Me Along' / We're home

So, I went on a search for a new playlist manager, and found moosic. Now, this does exactly what I want. It separates the playlist manager functionality from the user interface, and its default user interface is command-line! Outstanding.

Now playing: Leon Redbone / She's my gal

Naturally, I couldn't leave well enough alone. The one weakness I saw with moosic is when I asked it what the currently playing song was, it would reply with the full filename. Well, I add nice Artist, Title and Album tags to my .oggs, so I want to see them. So, it's time for a Perl Hack.

#! /usr/bin/env perl -w

use Audio::File;
use Audio::Moosic;

my $moo = Audio::Moosic::Unix->new();

my $fspec = $moo->current;
my $af = Audio::File->new($fspec);

my $artist = $af->tag->artist() || "";
my $title = $af->tag->title() || "";
my $album = $af->tag->album() || "";

print "$artist\n$title\n$album\n";

Now, of course, if you want constant display, a nice shell script will take care of that.

#! /bin/sh

onscreen=
while true
do
 playing=`perl ./main.pl`
 if [ ! "$playing" = "$onscreen" ]
 then
     clear
     perl ./main.pl
     onscreen=$playing
 fi
 sleep 10
done

By the way, the reason I separated this into the perl and shell portions (other than the fact that this is the Unix Way) is that eventually I'm going to pipe the output of the perl script into osd_cat, which does overlaid text.

Now playing: Clannad / Dheanainn sugradh

Eventually, this is going to lead to my extremely local radio station (only within the walls of the house), but that can wait until next post.

Tags: , , ,