LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 04-13-2004, 09:19 PM   #1
Trinity22
Member
 
Registered: Jul 2003
Location: oregon coast
Distribution: Fedora Core 3
Posts: 280

Rep: Reputation: 30
A Program/script making a html playlist?


My .m3u file is littered with tags like
Quote:
#EXTINF:-1,Skinny Puppy - Candle
/home/trinity/Music/Skinny Puppy - Candle.mp3
#EXTINF:-1,Skinny Puppy - Inquistion
/home/trinity/Music/Skinny Puppy - Inquistion.mp3
#EXTINF:-1,Skinny Puppy - Tormentor (Time 4.32)
/home/trinity/Music/Skinny Puppy - Tormentor (Time 4.32).mp3
#EXTINF:-1,Techno - VNV Nation - Futureperfect - Beloved
/home/trinity/Music/Techno - VNV Nation - Futureperfect - Beloved.mp3
#EXTINF:-1,The Cruxshadows - Bloodline
/home/trinity/Music/The Cruxshadows - Bloodline.mp3
so I need a program or something that can make an html playlist for my site based upon what I use in XMMS or something....... I'd be greatful for any suggestion. I've got a friend on aim who doesn't know how to do it either and he knows more about linux than I.

Thanks,
Trinity
 
Old 04-13-2004, 09:25 PM   #2
95se
Member
 
Registered: Apr 2002
Location: Windsor, ON, CA
Distribution: Ubuntu
Posts: 740

Rep: Reputation: 32
What do you mean exactly? You want to have links to the mp3s? Or you want to have it run on your computer when you click on it?
 
Old 04-13-2004, 09:29 PM   #3
Trinity22
Member
 
Registered: Jul 2003
Location: oregon coast
Distribution: Fedora Core 3
Posts: 280

Original Poster
Rep: Reputation: 30
Just a text file showing something like
Quote:
Blahblah - The blah song.mp3
Second Band - Secondsong.mp3
Third Group - Thirdsong.mp3
So I can show what my playlist is on my site. Nothing with links or need to download.

Trinity
 
Old 04-13-2004, 09:58 PM   #4
Komakino
Senior Member
 
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938

Rep: Reputation: 54
Code:
#!/usr/bin/perl

`echo '<HTML><BODY bgcolor=black text=white>' >> playlist.html`;
`echo '<center><h1><u><b>XMMS Playlist</b></u></h1></center>' >> playlist.html`;

foreach $file (`ls /music -R *.mp3`){
        if( $file =~ /mp3$/i ){
     `echo \"$file <br>\" >> playlist.html`;
        }
}

`echo '</BODY></HTML>' >> playlist.html`;
This is a VERY simple perl script. Pretty crude too, but it does the job. This will search your hard disk, starting at the directory /music (change this to your parent music directory) and will output an HTML page called playlist.html with just a title and then every filename listed underneath.

Copy and paste my code into a text file, save it, then do:
chmod +x filename
perl ./filename
to run it. Obviously you need perl installed.
Warning though, if you run this twice it will list all the songs twice, so if you need to run it again, delete the playlist.html file.

Oh yeah, if all your mp3s are in one folder then you can delete the -R from the 'foreach' line, and have the /music bit as your folder.
 
Old 04-13-2004, 10:29 PM   #5
Trinity22
Member
 
Registered: Jul 2003
Location: oregon coast
Distribution: Fedora Core 3
Posts: 280

Original Poster
Rep: Reputation: 30
very, very cool, Komakino Thanks for the script. It works great.

Trinity
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ices config - script for playlist section acc92 Linux - Software 1 05-11-2005 03:53 AM
Is there a Playlist HTML Generator in XMMS like Winamp? vharishankar Linux - Software 2 04-03-2005 10:51 PM
mplayer playlist or script help gotcha Linux - Software 0 09-02-2004 09:08 AM
Possible to produce a HTML playlist in XMMS? Aioth Linux - Newbie 1 06-14-2004 03:41 PM
Automating a playlist using shell script... DesiLILO Linux - Newbie 4 04-03-2004 12:03 AM


All times are GMT -5. The time now is 05:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration