/    Sign up×
Community /Pin to ProfileBookmark

outputting directory contents to html

I need to write a script that will output folder contents into html. The only thing needed on the page(s) is the filenames themselves. This is going to be used for a music collection.

Example:

The script looks in the tree artistalbumtrack.mp3

and outputs a folder named for the artist and a subfolder named for the album with a single html page containing the tracklisting. Basically the same directory structure as the original, just with an html page in the album folder instead of the mp3s.

So I’d have folders (artist1 artist2 artist3) with subfolders (album1 album2 album3) containing html files that list the tracks in text.

I’ve done this before with perl but lost the script in a hdd crash and figured it would be quicker to post this request than try and figure it out again. This version is not for online use however. It just needs to be able to run on a machine and output the files.

Thanks!

to post a comment
JavaScript

7 Comments(s)

Copy linkTweet thisAlerts:
@sciguyryanJun 16.2004 — I'm not shure JS can do this. You want too lok into PHP for this.
Copy linkTweet thisAlerts:
@AdamGundryJun 16.2004 — Actually, JS can do this since it needs to run on the local machine. Check out the attached file - this will hopefully do something similar to what you want. There are instructions in the file - basically you rename it to something.js, put it at the top of the directory tree and run it.

Bear in mind this comes with no guarantees, etc. You probably will need to modify the variables at the start of the script to customise the resulting HTML pages.

Adam

[upl-file uuid=3fd6c82e-1e13-4c9b-880a-ae1784d16cc0 size=3kB]file-list.txt[/upl-file]
Copy linkTweet thisAlerts:
@jester22cauthorJun 16.2004 — Thanks Adam, that will work nicely. I know JS well enough to get it to do exactly what I need. Thanks alot for the quick help, much faster than me figuring it out myself!
Copy linkTweet thisAlerts:
@jester22cauthorJun 17.2004 — I have one more small request.

Would it be possible for an 'index.html' file to be created in the output folder with a list of hyperlinks to the artist folders? Perhaps a new index in the artists folders as well with links to the album htmls. It seems like it shouldn't be that hard with the variable handling to have it do that but I'm not exactly sure how to code it.

Thanks again!
Copy linkTweet thisAlerts:
@AdamGundryJun 18.2004 — How's this?

Adam

[upl-file uuid=64e76b8e-f891-41fb-80f5-05cd9c8393b4 size=4kB]file-list-2.txt[/upl-file]
Copy linkTweet thisAlerts:
@jester22cauthorJun 18.2004 — You are the man! I really need to brush up on my java I should have been able to do that myself...

Thanks again! It's hard to find people so helpful these days.
Copy linkTweet thisAlerts:
@heathincSep 08.2006 — Hello,

I don't know if your willing or able to help me with this, but I'm looking for something similar. I have and html page that has a list of gallery's (pictures) and i want to be able to jut upload a folder called "MOONDANCE has arrived" and have the web page in the ../ directory to show MOONDANCE has arrived on the page somewhere. and then be able to click on it and it will open to the directory ../MOONDANCE has arrived. I will try to explain it a diffrent way to.. im bad at explaining things... SORRY!

your domain.com/index.html

--this is where the gallery selection page is where people can choose what gallery they want to see (ie' family, cars, hobbies, etc)

your domain.com/My Cars/

-- this is the directory that i would upload to the site. this directory has a index.html already generated by adobe web gallery generator already.

..............so i want to be able to upload the folder to the site and have the yourdomain.com/index.html page to automatically update and list the new directory and be able to click on it to go to yourdomain.com/my cars


Let me know if i was to confusing or if someone could greatly help me... Thanks to anyone for help on this!! ?


Regards,

Chris
×

Success!

Help @jester22c spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...