Last.fm tool: Create interactive artist & tag maps
';
printMessages( "cloud" );
echo '
A musical user tag cloud is a textual depiction of one\'s listening
habits, here based on musical social networking service Last.fm. The weight of a tag in the cloud is
determined by the play counts of top artists in the user\'s profile, and the
top tags for those artists, labeled as such by the Last.fm community.
Here, we combine the power of artists and tag clouds in an interactive widget, that "maps" a user\'s listening habits. The maps allows you to explore importat links between artists and tags.
Create your interactive artist and tag map!
With the form below, you can generate your personal artist and tag map. The map can be based on your overall top artists, or the weekly top artists in
your profile. You should have Java in your browser to use this app.
';
if( !$type )
$type = "overall";
if( $user ) {
$userfilename = "./users/" . $user . ".xml";
$userurl = "http://ws.audioscrobbler.com/1.0/user/$user/topartists.xml";
$xmlroot = "topartists";
if( $type == "12months" ) {
$userurl .= "?type=12month";
$userfilename .= ".12month";
}
if( $type == "6months" ) {
$userurl .= "?type=6month";
$userfilename .= ".6month";
}
if( $type == "3months" ) {
$userurl .= "?type=3month";
$userfilename .= ".3month";
}
if( $type == "weekly" ) {
$userfilename = "./weeklyusers/" . $user . ".xml";
$userurl = "http://ws.audioscrobbler.com/1.0/user/$user/weeklyartistchart.xml";
$xmlroot = "weeklyartistchart";
}
if( $type == "previousweek" ) {
$userfilename = "./weeklyusers/$user$from-$to.xml";
$userurl = "http://ws.audioscrobbler.com/1.0/user/$user/weeklyartistchart.xml?from=" . $from . "&to=" . $to;
print( $userurl );
$xmlroot = "weeklyartistchart";
}
$userdata = getDataFrom( $userfilename, $userurl, 60*60 );
$data = XML_unserialize( $userdata );
$tags;
$artists;
$nrartists = 0;
$maxartists = 50;
$maxtags = 50;
echo '
Your personal artist & tag map
';
echo "
\n";
echo '
You can use your mouse to drag nodes around and help the system to organize your artists and tags. Here are some tips on how to clean up your map.
-
Be patient. Initially, the network may be cluttered and look more like a knot than a network. The automatic layouter is very capable in organizing the network, but it takes some time. The animatons are not only there for your entertainment, your computer is actually trying to find an optimal layout while you are waiting.
-
Unfortunately, the layouter isn\'t perfect, and can get stuck. Try to remove link intersections by dragging nodes that are stuck in the wrong place. As such, you can clear out crossings and provide space for the nodes to relax.
-
Use the "scramble" and "shake" buttons to reset the map, or shake it around a bit.
-
Use the first slider to scale the font size when the artist and tag names are too big or too small.
-
-
Use the second slider to scale distances between nodes when the network is too dense, or too spread out.
-
Set the applet to pause when you want to make a screenshot. You can organize invisible tags and artists by dragging them out of each other\'s reach without interference of the automated layouter.
-
Some parts of the map may be disconnected from the main network. Since the script only includes strong connections between artists and tags, some obvious links may be missing as they didn\'t reach a threshold. Drag the islands to a place where you feel that they belong to get a better end result. If you have many incoherent islands, the algorithm wasn\'t able to find links between your many choices of music.
-
The map remains an uncontrollable clutter whatever you try? This may imply that your musical choice is very limited, which is why all artists and tags are closely related. Maybe the only solution here is that you start listening to a broader selection of genres ...
';
printLinks( $user, "map" );
echo '
';
}
echo '