Computer Science Canada

HTML Writer

Author:  Acid [ Tue Apr 13, 2004 9:11 am ]
Post subject:  HTML Writer

My friend has a photo album on his web page, and he uses three HTML files for every picture. Every file is similar, but needs to have different picture names, etc. in different spots. Until now he's been going through the files and changing them, but that takes a long time. I want to make a program that creates the file and writes all the necessary code for him when he inputs the picture names, etc.. What's the easiest way to do this?

Author:  wtd [ Tue Apr 13, 2004 3:07 pm ]
Post subject: 

Hmmm.... something like PHP or eRuby would work really well. Python or Perl wil make it easy enough as well. Much easier than VB, actually.

code:
<%# eRuby sample %>

<html>
<head>
   <title>My Simple Page</title>
</head>
<body>
   <img src="<%= image_name %>"/>
</body>
</html>

Author:  Acid [ Tue Apr 13, 2004 7:12 pm ]
Post subject: 

Yeah, and that'd be great if I knew anything but VB Laughing

Author:  wtd [ Tue Apr 13, 2004 8:05 pm ]
Post subject: 

The Pragmatic Programmers book online.

Ruby is exceptionally easy to learn, and eRuby is just Ruby embedded in a text document.

Author:  Acid [ Tue Apr 13, 2004 9:48 pm ]
Post subject: 

Thanks man. But if it takes learning a new language, then to hell with it, I'll let my friend keep doing it the way he has been. Laughing

Author:  wtd [ Tue Apr 13, 2004 11:13 pm ]
Post subject: 

Well, what if learning the language and learning how to accomplish the task is easier than learning how to do it in VB?

Author:  Tony [ Tue Apr 13, 2004 11:18 pm ]
Post subject: 

lol, wtd - just show poor Acid how to do that in VB Rolling Eyes

you basically write the same as to any other text file, but you save it as *.html and write your tags in there

code:

Open "C:\webpage.html" For Append As 1
Print #1, "<html><head><title>Some Title, this could be a variable</title></head><body>"
Print #1, "this goes on the actual page... some variables, some counters, etc"
Print #1, "</body></html>
Close 1

Author:  wtd [ Tue Apr 13, 2004 11:50 pm ]
Post subject: 

Well, actually I'm not familiar with how to do it in VB myself. Smile

Author:  Acid [ Wed Apr 14, 2004 9:11 am ]
Post subject: 

tony wrote:
code:

Open "C:\webpage.html" For Append As 1
Print #1, "<html><head><title>Some Title, this could be a variable</title></head><body>"
Print #1, "this goes on the actual page... some variables, some counters, etc"
Print #1, "</body></html>
Close 1


Yeah, I started it that way, but there are too many quotation marks in the HTML code. You can see how that might be a problem... Well, to someone who's basically clueless, anyway.


: