I occasionally get the fancy to mine my Last.fm records. In the past, I've used Python for this effort, but Bash is a little more convenient for such informal tasks. As such, I wrote the following Last.fm Curl wrapper in Bash script:

# $1 Last.fm API method.
# ... Optional method parameters.
fm()
{
  local method="$1"
  shift

  # Append '-d' to specify URL encoding is necessary. There's probably a better
  # way to do this.
  local params=
  local i=0
  while [ $# -gt 0 ]
  do
    params[i]="-d$1"
    let i+=1
    shift
  done

  curl \
    -d 'api_key=fede83da81dbe5c79f0f056286a0c379' \
    -d "method=$method" \
    ${params:+"${params[@]}"} \
    'http://ws.audioscrobbler.com/2.0/'
}

  Since I'm often curious what Last.fm's considers similar artists, I also made a similar artists wrapper and a Sed alias to tear out raw XML data:

# $1 Artist.
# $2 Number of similar artists returned (optional).
fm_sim_art()
{
  fm artist.getSimilar "artist=$1" ${2:+"limit=$2"}
}
alias fmsn="sed -nr 's_^    <name>(.*)</name>_\1_p'"

  With these wrappers, I can, for example, kludge together a list of the most common similar artists for a set of bands with these commands at the Bash prompt:

fm_sim_art 'The Pillows'|fmsn > pillows.sim_art
fm_sim_art 'The Beach Boys'|fmsn > beach.sim_art
fm_sim_art 'Vampire Weekend'|fmsn > vampire.sim_art
fm_sim_art 'The Shins'|fmsn > shins.sim_art
fm_sim_art 'Surfer Blood'|fmsn > surfer.sim_art
fm_sim_art 'The Drums'|fmsn > drums.sim_art
sort *.sim_art|uniq -dc|sort -r

  This generated the following list:

4 The Morning Benders
4 Telekinesis
4 Local Natives
4 Julian Casablancas
4 Broken Bells
3 Yeasayer
3 Wolf Parade
3 Wild Beasts
3 White Rabbits
3 Vampire Weekend
3 Two Door Cinema Club
3 The Unicorns
3 The National
3 Ted Leo and The Pharmacists
3 Tapes 'n Tapes
3 Spoon
3 Shout Out Louds
3 Rogue Wave
3 MGMT
3 Los Campesinos!
...

  Unfortunately, the only data that's close to approximate are my Last.fm listening logs. All other correlations, such as 'similar' artists are dependent on the quality of Last.fm algorithms.

  The Last.fm API documentation is available here: http://www.last.fm/api.