Saturday, September 25, 2010

Filth

In honour of a new Swans album. Here's to it being as good as this.
Filthy motherfucking Swans, bitches.
Swans - Filth

Saturday, September 4, 2010

Bash scripting

I wrote a little last.fm related script today. Before you start bashing, I'll point out this is (one of) my first bash scripts. It takes as input an artist or band name (the target), along with an optional depth (D, defaults to 5) and width (W, defaults to 7). Starting from the target, it takes the first W similar artists, creates and edge (target, similar) for each. This is performed for each of the similar artists, until depth D is reached (where initial target = depth 0). This creates a graph of (at most): sum( (for i=0..D : W^(i)) nodes (so 1+7+7^2+7^3+7^4+7^5 for the default values). The tool dot makes it really easy to create directed graphs from edges; all I had to do was filter out duplicates.

I use the following tools (which I believe aren't strictly part of bash):
wget
sed
grep
dot (part of graphviz)

The script is here.