Okay, here a very simple example.
It attempts to get the cover from
www.last.fm
If it finds the cover, it will safe a copy in a directory on your server and display it.
You should keep Duesi's point in mind though. You could get in trouble with that... Use at own risk, lol.