Since Last Fm discontinued supporting single song embedding on external websites, but left the function intact, I wanted to make a workaround as this function was the most useful thing (to me) that last fm removed.
All you need is the URL for the song you wish to generate embed code for.
Just enter the URL in the field, and it will automatically generate the embed code for the song, and also make a little preview button.
The code can be embedded into a wordpress post or page thereafter.
I have also made this script available as a Wordpress Plugin.