NBA game recaps, not game info!

With reference to this post, I decided to write my first Greasemonkey script.

I don’t subscribe to cable TV, so I get my sports news fix mostly by reading. Now that the NBA playoffs are in progress, I use NBA.com on a daily basis to read recaps like this one. I’m upset enough that the Lakers — one of the eight teams I’m rooting for — lost, without having to right-click “Game Scoreboard”, copy the link, and replace “gameinfo.html” with “recap.html” — which is what I’m most interested in, since I didn’t watch the match.

This is a pain, and since I can’t control NBA.com, I’ve written nba_recap_not_gameinfo, a Greasemonkey userscript to do it automatically for me.

This uses the excellent jQuery, of course, and since this blog does programming-related posts, we’ll take at the important (super-simple) part consists of just 3 lines of Javascript.

So we’ll look for a descendants of span with class “gamelinks”, and then we regex-replace “gameinfo” with “recap”.

jQuery("span.gamelinks a").each(function() {
var $this = $(this);
$this.attr("href", $this.attr("href").replace(/gameinfo/, "recap"));
});
Advertisements

Java plugin (Firefox) on MEPIS

I found this link useful. It helped me to get Java running in Firefox. The instructions are a bit outdated, so I thought to repost.

First we need Java installed:

apt-get install sun-java6-plugin

We go to the Firefox “plugins” folder, and rename for the existing (not working!) plugin with a .bak extension, and then create a symlink to the (hopefully working!) plugin:

cd /usr/lib/firefox/plugins
mv libjavaplugin.so libjavaplugin.so.bak
ln -s /usr/lib/jvm/java-6-sun-1.6.0.12/jre/plugin/i386/ns7/libjavaplugin_oji.so libjavaplugin.so

You’ll need to restart Firefox for the changes to take effect. Hope this helps!

Firefox 2 on SimplyMEPIS 6.0

Would you believe it? This is the first time I’m using Firefox 2 on a Linux distro.

My previous attempts (in FC6) to use the binary, just untar and gunzip to /usr/local/firefox failed as there was some library missing, can’t remember the error now when I ran:

$ /usr/local/firefox/firefox

MEPIS however was nice. It worked right out of the box, no configuration required. :)