menu
I’ll be there when you fall
And they’ll be no pain at all
And I’ll be your shelter...
Your shelter from the storm
Tager for Amarok 1.4
I don't have time nor will to explain. It just takes top 10 last.fm tags for the now playing track and adds them as labels in Amarok 1.4.
I have written it within half an hour, it may contain (a lot of) errors. Sorry.
Tested by myself on OpenSuSE 12.2 + KDE 3.5.10 r.218 + amarok 1.4.10
url=`dcop amarok default path`; echo "$url"; wget -O - -q "http://ws.audioscrobbler.com/2.0/?method=track.getTopTags&api_key=9ccff478258ffbc30c1db203c4897084&artist=`dcop amarok default artist`&track=`dcop amarok default title`&autocorrect=1" | grep '<name>' | sed -e 's/<name>//' -e 's/<\/name;>//' | (i="0"; while [ $i -lt 10 ]; do read line; echo $line; if [ -n "$line" ]; then dcop amarok collection addLabels "$url" \[ "$line" \]; fi; let i++; done );
Alternative (and nice formated) version:
Takes both top 10 track labels AND top 10 artist labels. Just copy to bash and every time the song changes, call amatager ;)
amatager(){
url=`dcop amarok default path`
artist=`dcop amarok default artist`
track=`dcop amarok default title`
wget -O - -q "http://ws.audioscrobbler.com/2.0/?method=track.getTopTags&api_key=9ccff478258ffbc30c1db203c4897084&artist=$artist&track=$track&autocorrect=1" | grep '<name>' | sed -e 's/<name>//' -e 's/<\/name>//' | (
i="0"
while [ $i -lt 10 ]
do read line
if [ -n "$line" ]
then echo -n $line\
dcop amarok collection addLabels "$url" \[ "$line" \]
fi
let i++
done
)
wget -O - -q "http://ws.audioscrobbler.com/2.0/?method=artist.getTopTags&api_key=9ccff478258ffbc30c1db203c4897084&artist=$artist&autocorrect=1" | grep '<name>' | sed -e 's/<name>//' -e 's/<\/name>//' | (
i="0"
while [ $i -lt 10 ]
do read line
if [ -n "$line" ]
then echo -n $line\
dcop amarok collection addLabels "$url" \[ "$line" \]
fi
let i++
done
)
}
added: November 12, 2012
edit: November 18, 2012