This program spiders through a directory, creating simple web pages that list all directories and files recursively. I know there are plenty of programs that do this already, I just wanted to make something on my own.
http://www.cemetech.net/programs/index.php?mode=file&path=/win/DirectoryToHTML.zip
I made it because my friend wanted to know what music I had, and rather than telling her everything, it was easier to do it this way. You can see an example of what it produces at:
http://imaginashaun.com/Music/
The code is included (C#), so you can change to formatting and such as you see fit.
Edit: Also, I should thank Ben Ryves for his help with making my HTML validate correctly and look nicer. Thanks, Ben!
Nice work there Merth. I can't really think of any other uses for this off the top of my head but its still cool none the less.
merthsoft wrote:
This program spiders through a directory, creating simple web pages that list all directories and files recursively. I know there are plenty of programs that do this already, I just wanted to make something on my own.
http://www.cemetech.net/programs/index.php?mode=file&path=/win/DirectoryToHTML.zip
I made it because my friend wanted to know what music I had, and rather than telling her everything, it was easier to do it this way. You can see an example of what it produces at:
http://imaginashaun.com/Music/
The code is included (C#), so you can change to formatting and such as you see fit.
Fun stuff. Is it for producing static HTML rather than a server-side CGI program?
Also, it would be entertaining to diff our artist lists.
Yeah, it just creates static pages. My music is on my laptop, not my server (though my external hdd is where I back it all up), so it was easier to just do it this way.
As for diffing our artist list, we should! Fire up my program and we can compare
![Smile](images/smiles/icon_smile.gif)
(it should work on Macs with mono).
Hey, pretty cool! I'd say that a simple web server daemon could generate a similar list, but yours is list-read-only, which is good, especially since you have the source code to my gCnClients in there.
merthsoft wrote:
Yeah, it just creates static pages. My music is on my laptop, not my server (though my external hdd is where I back it all up), so it was easier to just do it this way.
As for diffing our artist list, we should! Fire up my program and we can compare
![Smile](images/smiles/icon_smile.gif)
(it should work on Macs with mono).
well I could also just ls -1 in my iTunes directory
How does that print a static HTML page?
What do you mean? The source is there if you want to see. I use an XmlTextWriter.
KermMartian wrote:
Hey, pretty cool! I'd say that a simple web server daemon could generate a similar list, but yours is list-read-only, which is good, especially since you have the source code to my gCnClients in there.
![Smile](images/smiles/icon_smile.gif)
Not in my music directory, I don't...
merthsoft wrote:
KermMartian wrote:
[...]which is good, especially since you have the source code to my gCnClients in there.
![Smile](images/smiles/icon_smile.gif)
Not in my music directory, I don't... Ohhh, that was your Programming directory, which I see that you removed, nevermind.
ComicIDIOT, are you talking along the lines of "writing to a .html file", or "programmatically generating HTML markup"?
elfprince stated he could "ls -1" his iTunes directory. So I tried it, it just creates a list inside the terminal rather than printing it do an HTML file.
comicIDIOT wrote:
elfprince stated he could "ls -1" his iTunes directory. So I tried it, it just creates a list inside the terminal rather than printing it do an HTML file.
I meant if we wanted to diff our collections
comicIDIOT wrote:
elfprince stated he could "ls -1" his iTunes directory. So I tried it, it just creates a list inside the terminal rather than printing it do an HTML file.
ls -l >myfile.txt
That would be good enough for in-browser viewing. It's -l, not -1.
According to the font set on my computer, elfprince typed -1, and Terminal reads it correctly.
But then I'd need to manually add the links for each directory, as I don't have every MP3 as "Artist-Album-Song.mp3" inside one folder
Ah, ls -1 just lists filenames in a list and nothing else. ls -l does a list with file size, permissions, and last-modified times.
![Smile](images/smiles/icon_smile.gif)
Actually, you could do ls -R -1 to get a recursive listing separated by directory.
But it still wouldn't be as cool.
merthsoft wrote:
But it still wouldn't be as cool.
Not quite as cool, no.
I think you could actually come up with a four- or five-line shell script that could do the same thing as this; I'm pondering at the moment.
Maybe. And, like I said, I'm sure this exists in a lot of permutations. I imagine it'd take more than five lines, but I could be wrong. My code would be a lot shorter if I didn't use the XmlTextWriter and instead just wrote out raw html. It would also be shorter if I didn't care about it validating, but I figured I might as well. The nice thing about use the text writer is it'll give me a runtime error if I did something wrong, and it makes it pretty simple to add elements and attributes as I see fit.
I've made an update! I've added an "up one level" button. I also set it up to target .Net Framework 2.0, so it'll work on earlier Mono versions and earlier .Net versions than before. Also some code refactoring. Download it here:
http://www.cemetech.net/programs/index.php?mode=file&path=/win/DirectoryToHTML.zip
See example here:
http://merthsoft.com/Music
merthsoft wrote:
Are we friends yet on Last.fm?
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.
»
Go to Registration page
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum