Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Display iTunes songs being listened to by others' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Display iTunes songs being listened to by others
Authored by: jules on Feb 10, '04 06:02:54PM

A little python fun...

#!/usr/bin/env python2.3

from os import popen
from string import split

stuff_to_slice = popen("/usr/sbin/lsof +D ~/Music/iTunes/ | /usr/bin/grep -e '.*[mp3|m4(a|p)]$'").readlines()

if stuff_to_slice:
    for item in stuff_to_slice:
        the_list = split(item,'/')
        artist, album, song = the_list[-3], the_list[-2], the_list[-1]
        print "Artist: %s \nAlbum: %s \nSong: %s " % ( artist, album, song )
else:
    print "Nothing playing or wrong path to your music."


[ Reply to This | # ]